summaryrefslogtreecommitdiffstats
path: root/tools/h5import/h5importtest.c
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2017-12-01 18:41:26 (GMT)
committerLarry Knox <lrknox@hdfgroup.org>2017-12-01 18:41:26 (GMT)
commitb8c6b68c35fa2be23ef488a1d81097ff3ed55000 (patch)
treec3429ee577e454526c8704d66a84f0c45b7959a1 /tools/h5import/h5importtest.c
parent23a702e7bad93fc4f14eab07678c75d276e2d0ad (diff)
parent60f76980aab92f0e0730170b99a2363acd3c97fa (diff)
downloadhdf5-b8c6b68c35fa2be23ef488a1d81097ff3ed55000.zip
hdf5-b8c6b68c35fa2be23ef488a1d81097ff3ed55000.tar.gz
hdf5-b8c6b68c35fa2be23ef488a1d81097ff3ed55000.tar.bz2
Merge pull request #811 in HDFFV/hdf5 from hdf5_1_8_20 to 1.8/masterhdf5-1_8_20
* commit '60f76980aab92f0e0730170b99a2363acd3c97fa': (108 commits) Update version numbers and remove empty sections in RELEASE.txt. Restore line 1154: C2Cppfunction_map.mht to HTML_EXTRA_FILES. Update version for 1.8.20 release. Fixed documentation warnings HDFFV-10329 Correct LINK INTERFACE and VS20013 compile Switch default build mode from development to production. Increment version string to pre2. Add RELEASE.txt note for HDFFV-10274. (cherry picked from commit f7a7d0a00613cba997212fa8032091629a678797) Initialize hid_t variables in test_Attr_bug9. (cherry picked from commit 97bc393449f3fe02c5992872ab2842e12f611ef0) Fix HDFFV-10274. When deleting all (or almost all) of the messages in an object header chunk, where the total amount deleted was greater than 64K, an error would occur due to an off by one error in the code that handled that case. Fixed this and added a test case. (cherry picked from commit 1b2c2ca9a6a7d7e1fcd5c3302e203f2e2dabf0af) Fix linking of libs Changed file path to relative. iAdd NAG to supported compilers in RELEASE.txt. Add description to RELEASE.txt for HDFFV-10323 Correct issue number Set version to 1.8.20-pre1 Update supported and tested platforms in RELEASE.txt. HDFFV-10321 Merge from 1.8 Incremented lib file .so numbers: revision for all except c++ for code change; current incremented, revision and age set to 0 for c++ due to symbols added and removed. updated issues related to Fortran Incremented lib file .so numbers: revision for all except c++ for dcode change; current incremented, revision and age set to 0 for c++ due to symbols added and removed. ...
Diffstat (limited to 'tools/h5import/h5importtest.c')
-rw-r--r--tools/h5import/h5importtest.c132
1 files changed, 111 insertions, 21 deletions
diff --git a/tools/h5import/h5importtest.c b/tools/h5import/h5importtest.c
index 135b8e4..489bc01 100644
--- a/tools/h5import/h5importtest.c
+++ b/tools/h5import/h5importtest.c
@@ -11,7 +11,6 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#include <stdio.h>
#include "H5private.h"
#ifdef H5_HAVE_WIN32_API
@@ -25,7 +24,7 @@
* h5importtest
*
* Description:
- * This program creates that can be
+ * This program creates files that can be
* used to test the h5import program.
*
*/
@@ -36,6 +35,7 @@ main(void)
int nrow = 3, ncol = 4, npln = 5;
int i, j, k;
FILE *sp;
+ char machine_order[3] = {0, 0, 0};
float row4[3], col4[4], pln4[5];
float rowo4 = 11.0F, colo4 = 21.0F, plno4 = 51.0F;
@@ -67,6 +67,14 @@ main(void)
double rowo8 = 11.0F, colo8 = 21.0F, plno8 = 51.0F;
double rowi8 = 1.0F, coli8 = 2.0F, plni8 = 5.0F;
+ /* Initialize machine endian */
+ volatile uint32_t ibyte=0x01234567;
+ /* 0 for big endian, 1 for little endian. */
+ if ((*((uint8_t*)(&ibyte))) == 0x67)
+ strncpy(machine_order, "LE", 2);
+ else
+ strncpy(machine_order, "BE", 2);
+
/*
* initialize the row, column, and plane vectors
@@ -217,7 +225,7 @@ main(void)
#endif
/*-------------------------------------------------------------------------
- * TOOLTEST binin32.bin -c $srcdir/testfiles/binin32.conf -o binin32.h5
+ * TOOLTEST binin32.bin -c binin32.conf -o binin32.h5
*-------------------------------------------------------------------------
*/
@@ -234,8 +242,21 @@ main(void)
}
(void) HDfclose(sp);
+ sp = HDfopen("binin32.conf", "w");
+ (void) fprintf(sp, "PATH /int/bin/32-bit\n");
+ (void) fprintf(sp, "INPUT-CLASS IN\n");
+ (void) fprintf(sp, "INPUT-SIZE 32\n");
+ (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
+ (void) fprintf(sp, "RANK 3\n");
+ (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n");
+ (void) fprintf(sp, "OUTPUT-BYTE-ORDER BE\n");
+ (void) fprintf(sp, "DIMENSION-SIZES 5 3 4\n");
+ (void) fprintf(sp, "CHUNKED-DIMENSION-SIZES 1 2 1\n");
+ (void) fprintf(sp, "\n");
+ (void) HDfclose(sp);
+
/*-------------------------------------------------------------------------
- * TOOLTEST binuin32.bin -c $srcdir/testfiles/binuin32.conf -o binuin32.h5
+ * TOOLTEST binuin32.bin -c binuin32.conf -o binuin32.h5
*-------------------------------------------------------------------------
*/
@@ -252,11 +273,20 @@ main(void)
}
(void) HDfclose(sp);
-
-
+ sp = HDfopen("binuin32.conf", "w");
+ (void) fprintf(sp, "PATH /int/buin/32-bit\n");
+ (void) fprintf(sp, "INPUT-CLASS UIN\n");
+ (void) fprintf(sp, "INPUT-SIZE 32\n");
+ (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
+ (void) fprintf(sp, "RANK 3\n");
+ (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n");
+ (void) fprintf(sp, "OUTPUT-BYTE-ORDER LE\n");
+ (void) fprintf(sp, "DIMENSION-SIZES 5 3 4\n");
+ (void) fprintf(sp, "\n");
+ (void) HDfclose(sp);
/*-------------------------------------------------------------------------
- * TOOLTEST binin16.bin -c $srcdir/testfiles/binin16.conf -o binin16.h5
+ * TOOLTEST binin16.bin -c binin16.conf -o binin16.h5
*-------------------------------------------------------------------------
*/
@@ -273,8 +303,22 @@ main(void)
}
(void) HDfclose(sp);
+ sp = HDfopen("binin16.conf", "w");
+ (void) fprintf(sp, "PATH /int/bin/16-bit\n");
+ (void) fprintf(sp, "INPUT-CLASS IN\n");
+ (void) fprintf(sp, "INPUT-SIZE 16\n");
+ (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
+ (void) fprintf(sp, "RANK 3\n");
+ (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n");
+ (void) fprintf(sp, "OUTPUT-BYTE-ORDER LE\n");
+ (void) fprintf(sp, "DIMENSION-SIZES 2 3 4\n");
+ (void) fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n");
+ (void) fprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 8\n");
+ (void) fprintf(sp, "\n");
+ (void) HDfclose(sp);
+
/*-------------------------------------------------------------------------
- * TOOLTEST binuin16.bin -c $srcdir/testfiles/binuin16.conf -o binuin16.h5
+ * TOOLTEST binuin16.bin -c binuin16.conf -o binuin16.h5
*-------------------------------------------------------------------------
*/
sp = HDfopen("binuin16.bin", OPEN_FLAGS);
@@ -290,10 +334,22 @@ main(void)
}
(void) HDfclose(sp);
-
+ sp = HDfopen("binuin16.conf", "w");
+ (void) fprintf(sp, "PATH /int/buin/16-bit\n");
+ (void) fprintf(sp, "INPUT-CLASS UIN\n");
+ (void) fprintf(sp, "INPUT-SIZE 16\n");
+ (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
+ (void) fprintf(sp, "RANK 3\n");
+ (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n");
+ (void) fprintf(sp, "OUTPUT-BYTE-ORDER BE\n");
+ (void) fprintf(sp, "DIMENSION-SIZES 2 3 4\n");
+ (void) fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n");
+ (void) fprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 8\n");
+ (void) fprintf(sp, "\n");
+ (void) HDfclose(sp);
/*-------------------------------------------------------------------------
- * TOOLTEST binin8.bin -c $srcdir/testfiles/binin8.conf -o binin8.h5
+ * TOOLTEST binin8.bin -c binin8.conf -o binin8.h5
*-------------------------------------------------------------------------
*/
@@ -310,13 +366,27 @@ main(void)
}
(void) HDfclose(sp);
-#endif /* UNICOS */
-
-
+ sp = HDfopen("binin8.conf", "w");
+ (void) fprintf(sp, "PATH /int/bin/8-bit\n");
+ (void) fprintf(sp, "INPUT-CLASS IN\n");
+ (void) fprintf(sp, "INPUT-SIZE 8\n");
+ (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
+ (void) fprintf(sp, "RANK 3\n");
+ (void) fprintf(sp, "OUTPUT-CLASS IN\n");
+ (void) fprintf(sp, "OUTPUT-SIZE 16\n");
+ (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n");
+ (void) fprintf(sp, "OUTPUT-BYTE-ORDER LE\n");
+ (void) fprintf(sp, "DIMENSION-SIZES 5 3 4\n");
+ (void) fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n");
+ (void) fprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 -1\n");
+ (void) fprintf(sp, "COMPRESSION-PARAM 3\n");
+ (void) fprintf(sp, "\n");
+ (void) HDfclose(sp);
+#endif /* UNICOS */
/*-------------------------------------------------------------------------
- * TOOLTEST binfp64.bin -c $srcdir/testfiles/binfp64.conf -o binfp64.h5
+ * TOOLTEST binfp64.bin -c binfp64.conf -o binfp64.h5
*-------------------------------------------------------------------------
*/
@@ -337,10 +407,23 @@ main(void)
}
(void) HDfclose(sp);
-
+ sp = HDfopen("binfp64.conf", "w");
+ (void) fprintf(sp, "PATH /fp/bin/64-bit\n");
+ (void) fprintf(sp, "INPUT-CLASS FP\n");
+ (void) fprintf(sp, "INPUT-SIZE 64\n");
+ (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
+ (void) fprintf(sp, "RANK 3\n");
+ (void) fprintf(sp, "OUTPUT-ARCHITECTURE IEEE\n");
+ (void) fprintf(sp, "OUTPUT-BYTE-ORDER LE\n");
+ (void) fprintf(sp, "DIMENSION-SIZES 5 3 4\n");
+ (void) fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n");
+ (void) fprintf(sp, "MAXIMUM-DIMENSIONS -1 6 7\n");
+ (void) fprintf(sp, "COMPRESSION-PARAM 8\n");
+ (void) fprintf(sp, "\n");
+ (void) HDfclose(sp);
/*-------------------------------------------------------------------------
- * TOOLTEST binin8w.bin -c $srcdir/testfiles/binin8w.conf -o binin8w.h5
+ * TOOLTEST binin8w.bin -c binin8w.conf -o binin8w.h5
*-------------------------------------------------------------------------
*/
@@ -357,13 +440,20 @@ main(void)
}
HDfclose(sp);
+ sp = HDfopen("binin8w.conf", "w");
+ (void) fprintf(sp, "INPUT-CLASS IN\n");
+ (void) fprintf(sp, "INPUT-SIZE 8\n");
+ (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
+ (void) fprintf(sp, "RANK 1\n");
+ (void) fprintf(sp, "OUTPUT-CLASS IN\n");
+ (void) fprintf(sp, "OUTPUT-SIZE 8\n");
+ (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n");
+ (void) fprintf(sp, "OUTPUT-BYTE-ORDER LE\n");
+ (void) fprintf(sp, "DIMENSION-SIZES 4\n");
+ (void) fprintf(sp, "\n");
+ (void) HDfclose(sp);
}
-
-
-
-
-
return (EXIT_SUCCESS);
}