File: tst_hdf5_file_compat.c

package info (click to toggle)
netcdf 1%3A4.7.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 104,952 kB
  • sloc: ansic: 228,683; sh: 10,980; yacc: 2,561; makefile: 1,319; lex: 1,173; xml: 173; awk: 2
file content (63 lines) | stat: -rw-r--r-- 1,575 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/* This is part of the netCDF package.
   Copyright 2018 University Corporation for Atmospheric Research/Unidata
   See COPYRIGHT file for conditions of use.

   Tests library ability to open files generated by a netcdf
   instance linked against libhdf5 1.10.0.  This is an issue at this point
   because, without specifying libver bounds, netcdf linked against
   libhdf5 1.8 cannot read those generated by libhdf5 1.10.0.

   This test will undoubtedly not age well, but right now it is
   fairly critical, and will help test if we've corrected the
   issue.

   Details: https://github.com/Unidata/netcdf-c/issues/250

   Files testing against (copied from nc_test4):

   * ref_hdf5_compat1.nc <- tst_vars.nc
   * ref_hdf5_compat2.nc <- tst_vars4.nc
   * ref_hdf5_compat3.nc <- tst_compounds.nc

   */

#include <nc_tests.h>
#include "err_macros.h"
#include "netcdf.h"


#define FILE_NAME1 "ref_hdf5_compat1.nc"
#define FILE_NAME2 "ref_hdf5_compat2.nc"
#define FILE_NAME3 "ref_hdf5_compat3.nc"


int main(int argc, char **argv) {

  int ncid = 0;

  printf("\n*** Testing libhdf5 file compatibility (open files generated by hdf5 1.10).\n");

  {
    printf("Testing %s\n",FILE_NAME1);
    if (nc_open(FILE_NAME1, NC_NOWRITE, &ncid)) ERR;
    if (nc_close(ncid)) ERR;
  }

  {
    printf("Testing %s\n",FILE_NAME2);
    if (nc_open(FILE_NAME2, NC_NOWRITE, &ncid)) ERR;
    if (nc_close(ncid)) ERR;
  }

  {
    printf("Testing %s\n",FILE_NAME3);
    if (nc_open(FILE_NAME3, NC_NOWRITE, &ncid)) ERR;
    if (nc_close(ncid)) ERR;
  }



  SUMMARIZE_ERR;
  FINAL_RESULTS;

}