diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2011-07-18 15:37:26 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2011-07-18 15:37:26 (GMT) |
commit | 6c0f470d9dc4cc1d5e75687fef7245aa2d2fd0c6 (patch) | |
tree | 395fe5ecfa5fa9fa3e6b9bdb8fa4471113504d44 /tools | |
parent | 3686703e86580a4c016ec1009e7bce146f868677 (diff) | |
download | hdf5-6c0f470d9dc4cc1d5e75687fef7245aa2d2fd0c6.zip hdf5-6c0f470d9dc4cc1d5e75687fef7245aa2d2fd0c6.tar.gz hdf5-6c0f470d9dc4cc1d5e75687fef7245aa2d2fd0c6.tar.bz2 |
[svn-r21111] Renamed test files to more descriptive name
Tested: local linux
Diffstat (limited to 'tools')
-rw-r--r-- | tools/h5import/CMakeLists.txt | 100 | ||||
-rwxr-xr-x | tools/h5import/h5import.c | 185 | ||||
-rwxr-xr-x | tools/h5import/h5importtest.c | 94 | ||||
-rwxr-xr-x | tools/h5import/h5importtestutil.sh | 113 | ||||
-rwxr-xr-x | tools/h5import/testfiles/binfp32.conf | 12 | ||||
-rw-r--r-- | tools/h5import/testfiles/binfp64.h5 (renamed from tools/h5import/testfiles/test8.h5) | bin | 10760 -> 10760 bytes | |||
-rw-r--r-- | tools/h5import/testfiles/binin16.h5 (renamed from tools/h5import/testfiles/test9.h5) | bin | 10760 -> 10760 bytes | |||
-rw-r--r-- | tools/h5import/testfiles/binin32.h5 (renamed from tools/h5import/testfiles/test11.h5) | bin | 9472 -> 9472 bytes | |||
-rw-r--r-- | tools/h5import/testfiles/binin8.h5 (renamed from tools/h5import/testfiles/test10.h5) | bin | 10760 -> 10760 bytes | |||
-rw-r--r-- | tools/h5import/testfiles/binin8w.conf | 9 | ||||
-rw-r--r-- | tools/h5import/testfiles/binin8w.h5 | bin | 0 -> 2852 bytes | |||
-rw-r--r-- | tools/h5import/testfiles/binuin16.h5 (renamed from tools/h5import/testfiles/test12.h5) | bin | 10760 -> 10760 bytes | |||
-rw-r--r-- | tools/h5import/testfiles/binuin32.h5 (renamed from tools/h5import/testfiles/test13.h5) | bin | 6384 -> 6384 bytes | |||
-rw-r--r-- | tools/h5import/testfiles/textpfe.h5 (renamed from tools/h5import/testfiles/test15.h5) | bin | 2064 -> 2064 bytes | |||
-rw-r--r-- | tools/h5import/testfiles/textpfe64.txt (renamed from tools/h5import/testfiles/in64.txt) | 0 | ||||
-rwxr-xr-x | tools/h5import/testfiles/txtfp32.conf (renamed from tools/h5import/testfiles/textfp32.conf) | 0 | ||||
-rw-r--r-- | tools/h5import/testfiles/txtfp32.h5 (renamed from tools/h5import/testfiles/test6.h5) | bin | 4192 -> 4192 bytes | |||
-rwxr-xr-x | tools/h5import/testfiles/txtfp32.txt (renamed from tools/h5import/testfiles/fp1.txt) | 0 | ||||
-rwxr-xr-x | tools/h5import/testfiles/txtfp64.conf (renamed from tools/h5import/testfiles/textfp64.conf) | 0 | ||||
-rw-r--r-- | tools/h5import/testfiles/txtfp64.h5 (renamed from tools/h5import/testfiles/test7.h5) | bin | 9784 -> 9784 bytes | |||
-rwxr-xr-x | tools/h5import/testfiles/txtfp64.txt (renamed from tools/h5import/testfiles/fp2.txt) | 0 | ||||
-rwxr-xr-x | tools/h5import/testfiles/txtin16.conf (renamed from tools/h5import/testfiles/textin16.conf) | 0 | ||||
-rw-r--r-- | tools/h5import/testfiles/txtin16.h5 (renamed from tools/h5import/testfiles/test2.h5) | bin | 9784 -> 9784 bytes | |||
-rw-r--r-- | tools/h5import/testfiles/txtin16.txt (renamed from tools/h5import/testfiles/in32.txt) | 0 | ||||
-rwxr-xr-x | tools/h5import/testfiles/txtin32.conf (renamed from tools/h5import/testfiles/textin32.conf) | 0 | ||||
-rw-r--r-- | tools/h5import/testfiles/txtin32.h5 (renamed from tools/h5import/testfiles/test1.h5) | bin | 4192 -> 4192 bytes | |||
-rw-r--r-- | tools/h5import/testfiles/txtin32.txt (renamed from tools/h5import/testfiles/in16.txt) | 0 | ||||
-rwxr-xr-x | tools/h5import/testfiles/txtin8.conf (renamed from tools/h5import/testfiles/textin8.conf) | 1 | ||||
-rw-r--r-- | tools/h5import/testfiles/txtin8.h5 (renamed from tools/h5import/testfiles/test3.h5) | bin | 9784 -> 9784 bytes | |||
-rw-r--r-- | tools/h5import/testfiles/txtstr.conf (renamed from tools/h5import/testfiles/textstr.conf) | 0 | ||||
-rw-r--r-- | tools/h5import/testfiles/txtstr.h5 (renamed from tools/h5import/testfiles/test14.h5) | bin | 10240 -> 10240 bytes | |||
-rw-r--r-- | tools/h5import/testfiles/txtstr.txt (renamed from tools/h5import/testfiles/str.txt) | 0 | ||||
-rwxr-xr-x | tools/h5import/testfiles/txtuin16.conf (renamed from tools/h5import/testfiles/textuin16.conf) | 0 | ||||
-rw-r--r-- | tools/h5import/testfiles/txtuin16.h5 (renamed from tools/h5import/testfiles/test5.h5) | bin | 10240 -> 10240 bytes | |||
-rwxr-xr-x | tools/h5import/testfiles/txtuin32.conf (renamed from tools/h5import/testfiles/textuin32.conf) | 0 | ||||
-rw-r--r-- | tools/h5import/testfiles/txtuin32.h5 (renamed from tools/h5import/testfiles/test4.h5) | bin | 6240 -> 6240 bytes | |||
-rwxr-xr-x | tools/h5import/testfiles/txtuin32.txt (renamed from tools/h5import/testfiles/in1.txt) | 0 |
37 files changed, 251 insertions, 263 deletions
diff --git a/tools/h5import/CMakeLists.txt b/tools/h5import/CMakeLists.txt index 10be869..abd0b7d 100644 --- a/tools/h5import/CMakeLists.txt +++ b/tools/h5import/CMakeLists.txt @@ -31,48 +31,49 @@ IF (BUILD_TESTING) TARGET_LINK_LIBRARIES (h5importtest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) SET (HDF5_REFERENCE_CONF_FILES - binfp32.conf binfp64.conf binin8.conf + binin8w.conf binin16.conf binin32.conf binuin16.conf binuin32.conf - textfp32.conf - textfp64.conf - textin8.conf - textin16.conf - textin32.conf - textuin16.conf - textuin32.conf + txtfp32.conf + txtfp64.conf + txtin8.conf + txtin16.conf + txtin32.conf + txtuin16.conf + txtuin32.conf textpfe.conf - textstr.conf + txtstr.conf ) SET (HDF5_REFERENCE_TXT_FILES - fp1.txt - fp2.txt - in1.txt - in16.txt - in32.txt - in64.txt - str.txt + txtfp32.txt + txtfp64.txt + txtuin32.txt + txtin16.txt + txtin32.txt + textpfe64.txt + txtstr.txt ) SET (HDF5_REFERENCE_TEST_FILES - test1.h5 - test2.h5 - test3.h5 - test4.h5 - test5.h5 - test6.h5 - test7.h5 - test8.h5 - test9.h5 - test10.h5 - test11.h5 - test12.h5 - test13.h5 - test14.h5 - test15.h5 + binfp64.h5 + binin8.h5 + binin8w.h5 + binin16.h5 + binin32.h5 + binuin16.h5 + binuin32.h5 + txtfp32.h5 + txtfp64.h5 + txtin8.h5 + txtin16.h5 + txtin32.h5 + txtuin16.h5 + txtuin32.h5 + txtstr.h5 + textpfe.h5 ) FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") @@ -132,7 +133,7 @@ IF (BUILD_TESTING) SET (last_test "H5IMPORT-${testname}-clear-objects") ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5IMPORT-${testname} COMMAND $<TARGET_FILE:h5import> ${importfile} -c testfiles/${conffile} -o ${testfile}) + ADD_TEST (NAME H5IMPORT-${testname} COMMAND $<TARGET_FILE:h5import> ${importfile} -c testfiles/${conffile} -o ${testfile}) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5IMPORT-${testname} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") @@ -200,50 +201,53 @@ IF (BUILD_TESTING) ENDIF (NOT "${last_test}" STREQUAL "") SET (last_test "H5IMPORT-h5importtest") - # ----- TESTING "ASCII I32 rank 3 - Output BE " - ADD_H5_TEST (ASCII_I32 in32.txt textin32.conf test1.h5) + # ----- TESTING "ASCII I32 rank 3 - Output BE " ; + ADD_H5_TEST (ASCII_I32 txtin16.txt txtin32.conf txtin32.h5) # ----- TESTING "ASCII I16 rank 3 - Output LE - CHUNKED - extended" - ADD_H5_TEST (ASCII_I16 in16.txt textin16.conf test2.h5) + ADD_H5_TEST (ASCII_I16 txtin16.txt txtin16.conf txtin16.h5) # ----- TESTING "ASCII I8 - rank 3 - Output I8 LE-Chunked+Extended+Compressed " - ADD_H5_TEST (ASCII_I8 in16.txt textin8.conf test3.h5) + ADD_H5_TEST (ASCII_I8 txtin16.txt txtin8.conf txtin8.h5) # ----- TESTING "ASCII UI32 - rank 3 - Output BE" - ADD_H5_TEST (ASCII_UI32 in1.txt textuin32.conf test4.h5) + ADD_H5_TEST (ASCII_UI32 txtuin32.txt txtuin32.conf txtuin32.h5) # ----- TESTING "ASCII UI16 - rank 2 - Output LE+Chunked+Compressed " - ADD_H5_TEST (ASCII_UI16 in1.txt textuin16.conf test5.h5) + ADD_H5_TEST (ASCII_UI16 txtuin32.txt txtuin16.conf txtuin16.h5) # ----- TESTING "ASCII F32 - rank 3 - Output LE " - ADD_H5_TEST (ASCII_F32 fp1.txt textfp32.conf test6.h5) + ADD_H5_TEST (ASCII_F32 txtfp32.txt txtfp32.conf txtfp32.h5) # ----- TESTING "ASCII F64 - rank 3 - Output BE + CHUNKED+Extended+Compressed " - ADD_H5_TEST (ASCII_F64 fp2.txt textfp64.conf test7.h5) + ADD_H5_TEST (ASCII_F64 txtfp64.txt txtfp64.conf txtfp64.h5) # ----- TESTING "BINARY F64 - rank 3 - Output LE+CHUNKED+Extended+Compressed " - ADD_H5_TEST (BINARY_F64 binfp64.bin binfp64.conf test8.h5) + ADD_H5_TEST (BINARY_F64 binfp64.bin binfp64.conf binfp64.h5) # ----- TESTING "BINARY I16 - rank 3 - Output order LE + CHUNKED + extended " - ADD_H5_TEST (BINARY_I16 binin16.bin binin16.conf test9.h5) + ADD_H5_TEST (BINARY_I16 binin16.bin binin16.conf binin16.h5) # ----- TESTING "BINARY I8 - rank 3 - Output I16LE + Chunked+Extended+Compressed " - ADD_H5_TEST (BINARY_I8 binin8.bin binin8.conf test10.h5) + ADD_H5_TEST (BINARY_I8 binin8.bin binin8.conf binin8.h5) # ----- TESTING "BINARY I32 - rank 3 - Output BE + CHUNKED " - ADD_H5_TEST (BINARY_I32 binin32.bin binin32.conf test11.h5) + ADD_H5_TEST (BINARY_I32 binin32.bin binin32.conf binin32.h5) # ----- TESTING "BINARY UI16 - rank 3 - Output byte BE + CHUNKED " - ADD_H5_TEST (BINARY_UI16 binuin16.bin binuin16.conf test12.h5) + ADD_H5_TEST (BINARY_UI16 binuin16.bin binuin16.conf binuin16.h5) # ----- TESTING "BINARY UI32 - rank 3 - Output LE + CHUNKED " - ADD_H5_TEST (BINARY_UI32 binuin32.bin binuin32.conf test13.h5) + ADD_H5_TEST (BINARY_UI32 binuin32.bin binuin32.conf binuin32.h5) # ----- TESTING "STR" - ADD_H5_TEST (STR str.txt textstr.conf test14.h5) + ADD_H5_TEST (STR txtstr.txt txtstr.conf txtstr.h5) + + # ----- TESTING "BINARY I8 CR LF EOF" + ADD_H5_TEST (BINARY_I8_EOF binin8w.bin binin8w.conf binin8w.h5) # ----- TESTING "ASCII F64 - rank 1 - INPUT-CLASS TEXTFPE " - ADD_H5_TEST (ASCII_F64_R1 in64.txt textpfe.conf test15.h5) + ADD_H5_TEST (ASCII_F64_R1 textpfe64.txt textpfe.conf textpfe.h5) ENDIF (BUILD_TESTING) diff --git a/tools/h5import/h5import.c b/tools/h5import/h5import.c index bbd8746..cfed58b 100755 --- a/tools/h5import/h5import.c +++ b/tools/h5import/h5import.c @@ -25,6 +25,12 @@ /* Name of tool */ #define PROGRAMNAME "h5import" +#ifdef WIN32 +#define READ_OPEN_FLAGS "rb" +#else +#define READ_OPEN_FLAGS "r" +#endif + int main(int argc, char *argv[]) { struct Options opt; @@ -50,8 +56,8 @@ int main(int argc, char *argv[]) (void) HDsetvbuf(stderr, (char *) NULL, _IOLBF, 0); (void) HDsetvbuf(stdout, (char *) NULL, _IOLBF, 0); - if (argv[1] && (strcmp("-V", argv[1]) == 0)) { - print_version("h5import"); + if (argv[1] && (HDstrcmp("-V", argv[1]) == 0)) { + print_version(PROGRAMNAME); exit(EXIT_SUCCESS); } @@ -185,15 +191,15 @@ int main(int argc, char *argv[]) for (i = 0; i < opt.fcount; i++) { in = &(opt.infiles[i].in); if (in->sizeOfDimension) - free(in->sizeOfDimension); + HDfree(in->sizeOfDimension); if (in->sizeOfChunk) - free(in->sizeOfChunk); + HDfree(in->sizeOfChunk); if (in->maxsizeOfDimension) - free(in->maxsizeOfDimension); + HDfree(in->maxsizeOfDimension); if (in->externFilename) - free(in->externFilename); + HDfree(in->externFilename); if (in->data) - free(in->data); + HDfree(in->data); } return (EXIT_SUCCESS); @@ -202,15 +208,15 @@ err: for (i = 0; i < opt.fcount; i++) { in = &(opt.infiles[i].in); if (in->sizeOfDimension) - free(in->sizeOfDimension); + HDfree(in->sizeOfDimension); if (in->sizeOfChunk) - free(in->sizeOfChunk); + HDfree(in->sizeOfChunk); if (in->maxsizeOfDimension) - free(in->maxsizeOfDimension); + HDfree(in->maxsizeOfDimension); if (in->externFilename) - free(in->externFilename); + HDfree(in->externFilename); if (in->data) - free(in->data); + HDfree(in->data); } return (EXIT_FAILURE); } @@ -311,28 +317,17 @@ static int processDataFile(char *infile, struct Input *in, hid_t file_id) */ if (in->inputClass == 4 /* "IN" */|| in->inputClass == 3 /* "FP" */|| in->inputClass == 7 /* "UIN" */) { -#ifdef WIN32 - - if ((strm = fopen(infile, "rb")) == NULL) { - (void) fprintf(stderr, err1, infile); - return(-1); - } -#else - - if ((strm = fopen(infile, "r")) == NULL) { + if ((strm = HDfopen(infile, READ_OPEN_FLAGS)) == NULL) { (void) fprintf(stderr, err1, infile); return (-1); } - -#endif - } /*------------------------------------------------------------------------- * if the input class is not binary, just use "r" *------------------------------------------------------------------------- */ else { - if ((strm = fopen(infile, "r")) == NULL) { + if ((strm = HDfopen(infile, "r")) == NULL) { (void) fprintf(stderr, err1, infile); return (-1); } @@ -343,13 +338,13 @@ static int processDataFile(char *infile, struct Input *in, hid_t file_id) case 4: /* IN */ if (allocateIntegerStorage(in) == -1) { (void) fprintf(stderr, err2, infile); - fclose(strm); + HDfclose(strm); return (-1); } if (readIntegerData(strm, in) == -1) { (void) fprintf(stderr, err4, infile); - fclose(strm); + HDfclose(strm); return (-1); } break; @@ -359,14 +354,14 @@ static int processDataFile(char *infile, struct Input *in, hid_t file_id) case 3: /* FP */ if (allocateFloatStorage(in) == -1) { (void) fprintf(stderr, err3, infile); - fclose(strm); + HDfclose(strm); return (-1); } if (readFloatData(strm, in) == -1) { (void) fprintf(stderr, err5, infile); - fclose(strm); + HDfclose(strm); return (-1); } break; @@ -375,7 +370,7 @@ static int processDataFile(char *infile, struct Input *in, hid_t file_id) if (processStrData(strm, in, file_id) == -1) { (void) fprintf(stderr, err11, infile); - fclose(strm); + HDfclose(strm); return (-1); } @@ -385,22 +380,22 @@ static int processDataFile(char *infile, struct Input *in, hid_t file_id) case 7: /* UIN */ if (allocateUIntegerStorage(in) == -1) { (void) fprintf(stderr, err6, infile); - fclose(strm); + HDfclose(strm); return (-1); } if (readUIntegerData(strm, in) == -1) { (void) fprintf(stderr, err7, infile); - fclose(strm); + HDfclose(strm); return (-1); } break; default: (void) fprintf(stderr, "%s", err10); - fclose(strm); + HDfclose(strm); return (-1); } - fclose(strm); + HDfclose(strm); return (0); } @@ -410,7 +405,7 @@ static int readIntegerData(FILE *strm, struct Input *in) H5DT_INT16 *in16; H5DT_INT16 temp; H5DT_INT32 *in32; -#ifndef WIN32 +#ifdef H5_SIZEOF_LONG_LONG H5DT_INT64 *in64; char buffer[256]; #endif @@ -442,7 +437,7 @@ static int readIntegerData(FILE *strm, struct Input *in) case 4: /* IN */ in08 = (H5DT_INT8 *) in->data; for (i = 0; i < len; i++, in08++) { - if (fread((char *) in08, sizeof(H5DT_INT8), 1, strm) != 1) { + if (HDfread((char *) in08, sizeof(H5DT_INT8), 1, strm) != 1) { (void) fprintf(stderr, "%s", err1); return (-1); } @@ -470,7 +465,7 @@ static int readIntegerData(FILE *strm, struct Input *in) case 4: /* IN */ for (i = 0; i < len; i++, in16++) { - if (fread((char *) in16, sizeof(H5DT_INT16), 1, strm) != 1) { + if (HDfread((char *) in16, sizeof(H5DT_INT16), 1, strm) != 1) { (void) fprintf(stderr, "%s", err1); return (-1); } @@ -497,7 +492,7 @@ static int readIntegerData(FILE *strm, struct Input *in) case 4: /* IN */ for (i = 0; i < len; i++, in32++) { - if (fread((char *) in32, sizeof(H5DT_INT32), 1, strm) != 1) { + if (HDfread((char *) in32, sizeof(H5DT_INT32), 1, strm) != 1) { (void) fprintf(stderr, "%s", err1); return (-1); } @@ -510,7 +505,7 @@ static int readIntegerData(FILE *strm, struct Input *in) } break; -#ifndef _WIN32 +#ifdef H5_SIZEOF_LONG_LONG case 64: in64 = (H5DT_INT64 *) in->data; switch (in->inputClass) { @@ -526,7 +521,7 @@ static int readIntegerData(FILE *strm, struct Input *in) case 4: /* IN */ for (i = 0; i < len; i++, in64++) { - if (fread((char *) in64, sizeof(H5DT_INT64), 1, strm) != 1) { + if (HDfread((char *) in64, sizeof(H5DT_INT64), 1, strm) != 1) { (void) fprintf(stderr, "%s", err1); return (-1); } @@ -538,7 +533,7 @@ static int readIntegerData(FILE *strm, struct Input *in) return (-1); } break; -#endif /* ifndef _WIN32 */ +#endif /* ifdef H5_SIZEOF_LONG_LONG */ default: (void) fprintf(stderr, "%s", err3); @@ -553,7 +548,7 @@ static int readUIntegerData(FILE *strm, struct Input *in) H5DT_UINT16 *in16; H5DT_UINT16 temp; H5DT_UINT32 *in32; -#ifndef _WIN32 +#ifdef H5_SIZEOF_LONG_LONG H5DT_UINT64 *in64; char buffer[256]; #endif @@ -584,7 +579,7 @@ static int readUIntegerData(FILE *strm, struct Input *in) case 7: /* UIN */ in08 = (H5DT_UINT8 *) in->data; for (i = 0; i < len; i++, in08++) { - if (fread((char *) in08, sizeof(H5DT_UINT8), 1, strm) != 1) { + if (HDfread((char *) in08, sizeof(H5DT_UINT8), 1, strm) != 1) { (void) fprintf(stderr, "%s", err1); return (-1); } @@ -611,7 +606,7 @@ static int readUIntegerData(FILE *strm, struct Input *in) case 7: /* UIN */ for (i = 0; i < len; i++, in16++) { - if (fread((char *) in16, sizeof(H5DT_UINT16), 1, strm) != 1) { + if (HDfread((char *) in16, sizeof(H5DT_UINT16), 1, strm) != 1) { (void) fprintf(stderr, "%s", err1); return (-1); } @@ -638,7 +633,7 @@ static int readUIntegerData(FILE *strm, struct Input *in) case 7: /* UIN */ for (i = 0; i < len; i++, in32++) { - if (fread((char *) in32, sizeof(H5DT_UINT32), 1, strm) != 1) { + if (HDfread((char *) in32, sizeof(H5DT_UINT32), 1, strm) != 1) { (void) fprintf(stderr, "%s", err1); return (-1); } @@ -651,7 +646,7 @@ static int readUIntegerData(FILE *strm, struct Input *in) } break; -#ifndef _WIN32 +#ifdef H5_SIZEOF_LONG_LONG case 64: in64 = (H5DT_UINT64 *) in->data; switch (in->inputClass) { @@ -667,7 +662,7 @@ static int readUIntegerData(FILE *strm, struct Input *in) case 7: /* UIN */ for (i = 0; i < len; i++, in64++) { - if (fread((char *) in64, sizeof(H5DT_UINT64), 1, strm) != 1) { + if (HDfread((char *) in64, sizeof(H5DT_UINT64), 1, strm) != 1) { (void) fprintf(stderr, "%s", err1); return (-1); } @@ -679,7 +674,7 @@ static int readUIntegerData(FILE *strm, struct Input *in) return (-1); } break; -#endif /* ifndef _WIN32 */ +#endif /* ifdef H5_SIZEOF_LONG_LONG */ default: (void) fprintf(stderr, "%s", err3); @@ -733,7 +728,7 @@ static int readFloatData(FILE *strm, struct Input *in) case 3: /* FP */ for (i = 0; i < len; i++, fp32++) { - if (fread((char *) fp32, sizeof(H5DT_FLOAT32), 1, strm) != 1) { + if (HDfread((char *) fp32, sizeof(H5DT_FLOAT32), 1, strm) != 1) { (void) fprintf(stderr, "%s", err1); return (-1); } @@ -775,7 +770,7 @@ static int readFloatData(FILE *strm, struct Input *in) case 3: /* FP */ for (i = 0; i < len; i++, fp64++) { - if (fread((char *) fp64, sizeof(H5DT_FLOAT64), 1, strm) != 1) { + if (HDfread((char *) fp64, sizeof(H5DT_FLOAT64), 1, strm) != 1) { (void) fprintf(stderr, "%s", err1); return (-1); } @@ -830,8 +825,8 @@ static int processStrData(FILE *strm, struct Input *in, hid_t file_id) *------------------------------------------------------------------------- */ - while (!feof(strm)) { - c = fgetc(strm); + while (!HDfeof(strm)) { + c = HDfgetc(strm); if (c == 10) { /* eol */ nlines++; @@ -845,7 +840,7 @@ static int processStrData(FILE *strm, struct Input *in, hid_t file_id) dims[0] = nlines; /* rewind */ - fseek(strm, 0L, 0); + HDfseek(strm, 0L, 0); /*------------------------------------------------------------------------- * read file again and generate an HDF5 dataset @@ -897,8 +892,8 @@ static int processStrData(FILE *strm, struct Input *in, hid_t file_id) line = 0; - while (!feof(strm)) { - c = fgetc(strm); + while (!HDfeof(strm)) { + c = HDfgetc(strm); str[i] = c; @@ -1120,7 +1115,7 @@ static int processConfigurationFile(char *infile, struct Input *in) process the output file according to the options */ - if ((strm = fopen(infile, "r")) == NULL) { + if ((strm = HDfopen(infile, "r")) == NULL) { (void) fprintf(stderr, err1, infile); return (-1); } @@ -1128,24 +1123,24 @@ static int processConfigurationFile(char *infile, struct Input *in) while (fscanf(strm, "%s", key) == 1) { if ((kindex = mapKeywordToIndex(key)) == -1) { (void) fprintf(stderr, err2, infile); - fclose(strm); + HDfclose(strm); return (-1); } switch (kindex) { case 0: /* PATH */ if (in->configOptionVector[PATH] == 1) { (void) fprintf(stderr, err3a, infile); - fclose(strm); + HDfclose(strm); return (-1); } if (fscanf(strm, "%s", temp) != 1) { (void) fprintf(stderr, "%s", err18); - fclose(strm); + HDfclose(strm); return (-1); } if (parsePathInfo(&in->path, temp) == -1) { (void) fprintf(stderr, err3b, infile); - fclose(strm); + HDfclose(strm); return (-1); } in->configOptionVector[PATH] = 1; @@ -1154,18 +1149,18 @@ static int processConfigurationFile(char *infile, struct Input *in) case 1: /* INPUT-CLASS */ if (in->configOptionVector[INPUT_CLASS] == 1) { (void) fprintf(stderr, err4a, infile); - fclose(strm); + HDfclose(strm); return (-1); } if (fscanf(strm, "%s", temp) != 1) { (void) fprintf(stderr, "%s", err18); - fclose(strm); + HDfclose(strm); return (-1); } if (getInputClass(in, temp) == -1) { (void) fprintf(stderr, err4b, infile); - fclose(strm); + HDfclose(strm); return (-1); } @@ -1186,17 +1181,17 @@ static int processConfigurationFile(char *infile, struct Input *in) case 2: /* INPUT-SIZE */ if (in->configOptionVector[INPUT_SIZE] == 1) { (void) fprintf(stderr, err5a, infile); - fclose(strm); + HDfclose(strm); return (-1); } if (fscanf(strm, "%d", (&ival)) != 1) { (void) fprintf(stderr, "%s", err19); - fclose(strm); + HDfclose(strm); return (-1); } if (getInputSize(in, ival) == -1) { (void) fprintf(stderr, err5b, infile); - fclose(strm); + HDfclose(strm); return (-1); } in->configOptionVector[INPUT_SIZE] = 1; @@ -1209,13 +1204,13 @@ static int processConfigurationFile(char *infile, struct Input *in) case 3: /* RANK */ if (in->configOptionVector[RANK] == 1) { (void) fprintf(stderr, err6a, infile); - fclose(strm); + HDfclose(strm); return (-1); } if (getRank(in, strm) == -1) { (void) fprintf(stderr, err6b, infile); - fclose(strm); + HDfclose(strm); return (-1); } in->configOptionVector[RANK] = 1; @@ -1224,18 +1219,18 @@ static int processConfigurationFile(char *infile, struct Input *in) case 4: /* DIMENSION-SIZES */ if (in->configOptionVector[DIM] == 1) { (void) fprintf(stderr, err7a, infile); - fclose(strm); + HDfclose(strm); return (-1); } if (in->configOptionVector[RANK] == 0) { (void) fprintf(stderr, err7b, infile); - fclose(strm); + HDfclose(strm); return (-1); } if (getDimensionSizes(in, strm) == -1) { (void) fprintf(stderr, err7c, infile); - fclose(strm); + HDfclose(strm); return (-1); } in->configOptionVector[DIM] = 1; @@ -1244,13 +1239,13 @@ static int processConfigurationFile(char *infile, struct Input *in) case 5: /* OUTPUT-CLASS */ if (in->configOptionVector[OUTPUT_CLASS] == 1) { (void) fprintf(stderr, err8a, infile); - fclose(strm); + HDfclose(strm); return (-1); } if (getOutputClass(in, strm) == -1) { (void) fprintf(stderr, err8b, infile); - fclose(strm); + HDfclose(strm); return (-1); } in->configOptionVector[OUTPUT_CLASS] = 1; @@ -1259,13 +1254,13 @@ static int processConfigurationFile(char *infile, struct Input *in) case 6: /* OUTPUT-SIZE */ if (in->configOptionVector[OUTPUT_SIZE] == 1) { (void) fprintf(stderr, err9a, infile); - fclose(strm); + HDfclose(strm); return (-1); } if (getOutputSize(in, strm) == -1) { (void) fprintf(stderr, err9b, infile); - fclose(strm); + HDfclose(strm); return (-1); } in->configOptionVector[OUTPUT_SIZE] = 1; @@ -1274,13 +1269,13 @@ static int processConfigurationFile(char *infile, struct Input *in) case 7: /* OUTPUT-ARCHITECTURE */ if (in->configOptionVector[OUTPUT_ARCH] == 1) { (void) fprintf(stderr, err10a, infile); - fclose(strm); + HDfclose(strm); return (-1); } if (getOutputArchitecture(in, strm) == -1) { (void) fprintf(stderr, err10b, infile); - fclose(strm); + HDfclose(strm); return (-1); } in->configOptionVector[OUTPUT_ARCH] = 1; @@ -1289,13 +1284,13 @@ static int processConfigurationFile(char *infile, struct Input *in) case 8: /* OUTPUT-BYTE-ORDER */ if (in->configOptionVector[OUTPUT_B_ORDER] == 1) { (void) fprintf(stderr, err11a, infile); - fclose(strm); + HDfclose(strm); return (-1); } if (getOutputByteOrder(in, strm) == -1) { (void) fprintf(stderr, err11b, infile); - fclose(strm); + HDfclose(strm); return (-1); } in->configOptionVector[OUTPUT_B_ORDER] = 1; @@ -1304,19 +1299,19 @@ static int processConfigurationFile(char *infile, struct Input *in) case 9: /* CHUNKED-DIMENSION-SIZES */ if (in->configOptionVector[CHUNK] == 1) { (void) fprintf(stderr, err12a, infile); - fclose(strm); + HDfclose(strm); return (-1); } /* cant appear before dimension sizes have been provided */ if (in->configOptionVector[DIM] == 0) { (void) fprintf(stderr, err12b, infile); - fclose(strm); + HDfclose(strm); return (-1); } if (getChunkedDimensionSizes(in, strm) == -1) { (void) fprintf(stderr, err12c, infile); - fclose(strm); + HDfclose(strm); return (-1); } in->configOptionVector[CHUNK] = 1; @@ -1325,13 +1320,13 @@ static int processConfigurationFile(char *infile, struct Input *in) case 10: /* COMPRESSION-TYPE */ if (in->configOptionVector[COMPRESS] == 1) { (void) fprintf(stderr, err13a, infile); - fclose(strm); + HDfclose(strm); return (-1); } if (getCompressionType(in, strm) == -1) { (void) fprintf(stderr, err13b, infile); - fclose(strm); + HDfclose(strm); return (-1); } in->configOptionVector[COMPRESS] = 1; @@ -1345,13 +1340,13 @@ static int processConfigurationFile(char *infile, struct Input *in) case 11: /* COMPRESSION-PARAM */ if (in->configOptionVector[COMPRESS_PARAM] == 1) { (void) fprintf(stderr, err14a, infile); - fclose(strm); + HDfclose(strm); return (-1); } if (getCompressionParameter(in, strm) == -1) { (void) fprintf(stderr, err14b, infile); - fclose(strm); + HDfclose(strm); return (-1); } @@ -1365,13 +1360,13 @@ static int processConfigurationFile(char *infile, struct Input *in) case 12: /* EXTERNAL-STORAGE */ if (in->configOptionVector[EXTERNAL] == 1) { (void) fprintf(stderr, err15a, infile); - fclose(strm); + HDfclose(strm); return (-1); } if (getExternalFilename(in, strm) == -1) { (void) fprintf(stderr, err15b, infile); - fclose(strm); + HDfclose(strm); return (-1); } in->configOptionVector[EXTERNAL] = 1; @@ -1380,18 +1375,18 @@ static int processConfigurationFile(char *infile, struct Input *in) case 13: /* MAXIMUM-DIMENSIONS */ if (in->configOptionVector[EXTEND] == 1) { (void) fprintf(stderr, err16a, infile); - fclose(strm); + HDfclose(strm); return (-1); } /* cant appear before dimension sizes have been provided */ if (in->configOptionVector[DIM] == 0) { (void) fprintf(stderr, err16b, infile); - fclose(strm); + HDfclose(strm); return (-1); } if (getMaximumDimensionSizes(in, strm) == -1) { (void) fprintf(stderr, err16c, infile); - fclose(strm); + HDfclose(strm); return (-1); } in->configOptionVector[EXTEND] = 1; @@ -1408,11 +1403,11 @@ static int processConfigurationFile(char *infile, struct Input *in) if (validateConfigurationParameters(in) == -1) { (void) fprintf(stderr, err17, infile); - fclose(strm); + HDfclose(strm); return (-1); } - fclose(strm); + HDfclose(strm); return (0); } @@ -1424,7 +1419,7 @@ static int validateConfigurationParameters(struct Input *in) const char *err4a = "OUTPUT-ARCHITECTURE cannot be STD if OUTPUT-CLASS is floating point (FP).\n"; const char *err4b = "OUTPUT-ARCHITECTURE cannot be IEEE if OUTPUT-CLASS is integer (IN).\n"; const char *err5 = "For OUTPUT-CLASS FP, valid values for OUTPUT-SIZE are (32, 64) .\n"; -#ifdef _WIN32 +#ifndef H5_SIZEOF_LONG_LONG const char *err6 = "No support for reading 64-bit integer (INPUT-CLASS: IN, TEXTIN, UIN, TEXTUIN files\n"; #endif @@ -1471,7 +1466,7 @@ static int validateConfigurationParameters(struct Input *in) return (-1); } -#ifdef _WIN32 +#ifndef H5_SIZEOF_LONG_LONG if (in->inputSize == 64 && (in->inputClass == 0 || in->inputClass == 4 || in->inputClass == 6 || in->inputClass == 7) ) { (void) fprintf(stderr, "%s", err6); return -1; diff --git a/tools/h5import/h5importtest.c b/tools/h5import/h5importtest.c index 9c839a3..2869236 100755 --- a/tools/h5import/h5importtest.c +++ b/tools/h5import/h5importtest.c @@ -16,6 +16,12 @@ #include <stdio.h> #include "H5private.h" +#ifdef WIN32 +#define OPEN_FLAGS "wb" +#else +#define OPEN_FLAGS "w" +#endif + /* * Name: * h5importtest @@ -42,7 +48,7 @@ main(void) int rowo4i = (int)11 , colo4i = (int)21 , plno4i = (int)51 ; int rowi4i = (int)1 , coli4i = (int)2 , plni4i = (int)5 ; -#ifndef WIN32 +#ifdef H5_SIZEOF_LONG_LONG long long row4i64[3], col4i64[4], pln4i64[5]; long long rowo4i64 = (long long)11 , colo4i64 = (long long)21 , plno4i64 = (long long)51 ; long long rowi4i64 = (long long)1 , coli4i64 = (long long)2 , plni4i64 = (long long)5 ; @@ -91,7 +97,7 @@ main(void) col4i[0] = colo4i; pln4i[0] = plno4i; -#ifndef WIN32 +#ifdef H5_SIZEOF_LONG_LONG row4i64[0] = rowo4i64; col4i64[0] = colo4i64; pln4i64[0] = plno4i64; @@ -110,7 +116,7 @@ main(void) row4[i] = row4[i - 1] + rowi4; row8[i] = row8[i - 1] + rowi8; row4i[i] = row4i[i - 1] + rowi4i; -#ifndef WIN32 +#ifdef H5_SIZEOF_LONG_LONG row4i64[i] = row4i64[i - 1] + rowi4i64; #endif row4i16[i] = row4i16[i - 1] + rowi4i16; @@ -122,7 +128,7 @@ main(void) col4[j] = col4[j - 1] + coli4; col8[j] = col8[j - 1] + coli8; col4i[j] = col4i[j - 1] + coli4i; -#ifndef WIN32 +#ifdef H5_SIZEOF_LONG_LONG col4i64[j] = col4i64[j - 1] + coli4i64; #endif col4i16[j] = col4i16[j - 1] + coli4i16; @@ -133,7 +139,7 @@ main(void) pln4[k] = pln4[k - 1] + plni4; pln8[k] = pln8[k - 1] + plni8; pln4i[k] = pln4i[k - 1] + plni4i; -#ifndef WIN32 +#ifdef H5_SIZEOF_LONG_LONG pln4i64[k] = pln4i64[k - 1] + plni4i64; #endif pln4i16[k] = pln4i16[k - 1] + plni4i16; @@ -165,7 +171,7 @@ main(void) */ - sp = fopen("txtin16.txt", "w"); + sp = HDfopen("txtin16.txt", "w"); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) @@ -175,14 +181,14 @@ main(void) (void) fprintf(sp, "\n"); } } - (void) fclose(sp); + (void) HDfclose(sp); /*------------------------------------------------------------------------- * TOOLTEST txtin32.txt -c $srcdir/testfiles/textin32.conf -o textin32.h5 *------------------------------------------------------------------------- */ - sp = fopen("txtin32.txt", "w"); + sp = HDfopen("txtin32.txt", "w"); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) @@ -192,51 +198,43 @@ main(void) (void) fprintf(sp, "\n"); } } - (void) fclose(sp); + (void) HDfclose(sp); /*------------------------------------------------------------------------- * TOOLTEST binin32.bin -c $srcdir/testfiles/binin32.conf -o binin32.h5 *------------------------------------------------------------------------- */ -#ifdef WIN32 - sp = fopen("binin32.bin", "wb"); -#else - sp = fopen("binin32.bin", "w"); -#endif + sp = HDfopen("binin32.bin", OPEN_FLAGS); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) { - (void) fwrite((char *) &b32i3[k][i][j], sizeof(int), 1, sp); + (void) HDfwrite((char *) &b32i3[k][i][j], sizeof(int), 1, sp); } } } - (void) fclose(sp); + (void) HDfclose(sp); /*------------------------------------------------------------------------- * TOOLTEST binuin32.bin -c $srcdir/testfiles/binuin32.conf -o binuin32.h5 *------------------------------------------------------------------------- */ -#ifdef WIN32 - sp = fopen("binuin32.bin", "wb"); -#else - sp = fopen("binuin32.bin", "w"); -#endif + sp = HDfopen("binuin32.bin", OPEN_FLAGS); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) { - (void) fwrite((char *) &b32i3[k][i][j], sizeof(unsigned int), 1, sp); + (void) HDfwrite((char *) &b32i3[k][i][j], sizeof(unsigned int), 1, sp); } } } - (void) fclose(sp); + (void) HDfclose(sp); @@ -246,43 +244,35 @@ main(void) *------------------------------------------------------------------------- */ -#ifdef WIN32 - sp = fopen("binin16.bin", "wb"); -#else - sp = fopen("binin16.bin", "w"); -#endif + sp = HDfopen("binin16.bin", OPEN_FLAGS); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) { - (void) fwrite((char *) &b16i3[k][i][j], sizeof(short), 1, sp); + (void) HDfwrite((char *) &b16i3[k][i][j], sizeof(short), 1, sp); } } } - (void) fclose(sp); + (void) HDfclose(sp); /*------------------------------------------------------------------------- * TOOLTEST binuin16.bin -c $srcdir/testfiles/binuin16.conf -o binuin16.h5 *------------------------------------------------------------------------- */ -#ifdef WIN32 - sp = fopen("binuin16.bin", "wb"); -#else - sp = fopen("binuin16.bin", "w"); -#endif + sp = HDfopen("binuin16.bin", OPEN_FLAGS); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) { - (void) fwrite((char *) &b16i3[k][i][j], sizeof(unsigned short), 1, sp); + (void) HDfwrite((char *) &b16i3[k][i][j], sizeof(unsigned short), 1, sp); } } } - (void) fclose(sp); + (void) HDfclose(sp); @@ -291,22 +281,18 @@ main(void) *------------------------------------------------------------------------- */ -#ifdef WIN32 - sp = fopen("binin8.bin", "wb"); -#else - sp = fopen("binin8.bin", "w"); -#endif + sp = HDfopen("binin8.bin", OPEN_FLAGS); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) { - (void) fwrite((char *) &b8i3[k][i][j], sizeof(char), 1, sp); + (void) HDfwrite((char *) &b8i3[k][i][j], sizeof(char), 1, sp); } } } - (void) fclose(sp); + (void) HDfclose(sp); #endif /* UNICOS */ @@ -322,22 +308,18 @@ main(void) * binary 64-bit file - rank 2 & 3 */ -#ifdef WIN32 - sp = fopen("binfp64.bin", "wb"); -#else - sp = fopen("binfp64.bin", "w"); -#endif + sp = HDfopen("binfp64.bin", OPEN_FLAGS); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) { - (void) fwrite((char *) &b64r3[k][i][j], sizeof(double), 1, sp); + (void) HDfwrite((char *) &b64r3[k][i][j], sizeof(double), 1, sp); } } } - (void) fclose(sp); + (void) HDfclose(sp); @@ -350,18 +332,14 @@ main(void) /* test CR+LF (13,10) and EOF (26) in windows */ char bin8w[4] = {13,10,26,0}; -#ifdef WIN32 - sp = fopen("binin8w.bin", "wb"); -#else - sp = fopen("binin8w.bin", "w"); -#endif + sp = HDfopen("binin8w.bin", OPEN_FLAGS); for (i = 0; i < 4; i++) { char c = bin8w[i]; - if ( fwrite( &c, sizeof(char), 1, sp) != 1 ) + if ( HDfwrite( &c, sizeof(char), 1, sp) != 1 ) printf("error writing file\n"); } - fclose(sp); + HDfclose(sp); } diff --git a/tools/h5import/h5importtestutil.sh b/tools/h5import/h5importtestutil.sh index 8a895f5..943b194 100755 --- a/tools/h5import/h5importtestutil.sh +++ b/tools/h5import/h5importtestutil.sh @@ -57,47 +57,48 @@ test -d $TESTDIR || mkdir $TESTDIR # Comment '#' without space can be used. # -------------------------------------------------------------------- LIST_HDF5_TEST_FILES=" -$SRC_H5IMPORT_TESTFILES/test1.h5 -$SRC_H5IMPORT_TESTFILES/test2.h5 -$SRC_H5IMPORT_TESTFILES/test3.h5 -$SRC_H5IMPORT_TESTFILES/test4.h5 -$SRC_H5IMPORT_TESTFILES/test5.h5 -$SRC_H5IMPORT_TESTFILES/test6.h5 -$SRC_H5IMPORT_TESTFILES/test7.h5 -$SRC_H5IMPORT_TESTFILES/test8.h5 -$SRC_H5IMPORT_TESTFILES/test9.h5 -$SRC_H5IMPORT_TESTFILES/test10.h5 -$SRC_H5IMPORT_TESTFILES/test11.h5 -$SRC_H5IMPORT_TESTFILES/test12.h5 -$SRC_H5IMPORT_TESTFILES/test13.h5 -$SRC_H5IMPORT_TESTFILES/test14.h5 -$SRC_H5IMPORT_TESTFILES/test15.h5 +$SRC_H5IMPORT_TESTFILES/binfp64.h5 +$SRC_H5IMPORT_TESTFILES/binin8.h5 +$SRC_H5IMPORT_TESTFILES/binin8w.h5 +$SRC_H5IMPORT_TESTFILES/binin16.h5 +$SRC_H5IMPORT_TESTFILES/binin32.h5 +$SRC_H5IMPORT_TESTFILES/binuin16.h5 +$SRC_H5IMPORT_TESTFILES/binuin32.h5 +$SRC_H5IMPORT_TESTFILES/txtfp32.h5 +$SRC_H5IMPORT_TESTFILES/txtfp64.h5 +$SRC_H5IMPORT_TESTFILES/txtin8.h5 +$SRC_H5IMPORT_TESTFILES/txtin16.h5 +$SRC_H5IMPORT_TESTFILES/txtin32.h5 +$SRC_H5IMPORT_TESTFILES/txtuin16.h5 +$SRC_H5IMPORT_TESTFILES/txtuin32.h5 +$SRC_H5IMPORT_TESTFILES/txtstr.h5 +$SRC_H5IMPORT_TESTFILES/textpfe.h5 " LIST_OTHER_TEST_FILES=" -$SRC_H5IMPORT_TESTFILES/binfp32.conf $SRC_H5IMPORT_TESTFILES/binfp64.conf $SRC_H5IMPORT_TESTFILES/binin8.conf +$SRC_H5IMPORT_TESTFILES/binin8w.conf $SRC_H5IMPORT_TESTFILES/binin16.conf $SRC_H5IMPORT_TESTFILES/binin32.conf $SRC_H5IMPORT_TESTFILES/binuin16.conf $SRC_H5IMPORT_TESTFILES/binuin32.conf -$SRC_H5IMPORT_TESTFILES/textfp32.conf -$SRC_H5IMPORT_TESTFILES/textfp64.conf -$SRC_H5IMPORT_TESTFILES/textin8.conf -$SRC_H5IMPORT_TESTFILES/textin16.conf -$SRC_H5IMPORT_TESTFILES/textin32.conf -$SRC_H5IMPORT_TESTFILES/textuin16.conf -$SRC_H5IMPORT_TESTFILES/textuin32.conf +$SRC_H5IMPORT_TESTFILES/txtfp32.conf +$SRC_H5IMPORT_TESTFILES/txtfp64.conf +$SRC_H5IMPORT_TESTFILES/txtin8.conf +$SRC_H5IMPORT_TESTFILES/txtin16.conf +$SRC_H5IMPORT_TESTFILES/txtin32.conf +$SRC_H5IMPORT_TESTFILES/txtuin16.conf +$SRC_H5IMPORT_TESTFILES/txtuin32.conf $SRC_H5IMPORT_TESTFILES/textpfe.conf -$SRC_H5IMPORT_TESTFILES/textstr.conf -$SRC_H5IMPORT_TESTFILES/fp1.txt -$SRC_H5IMPORT_TESTFILES/fp2.txt -$SRC_H5IMPORT_TESTFILES/in1.txt -$SRC_H5IMPORT_TESTFILES/in16.txt -$SRC_H5IMPORT_TESTFILES/in32.txt -$SRC_H5IMPORT_TESTFILES/in64.txt -$SRC_H5IMPORT_TESTFILES/str.txt +$SRC_H5IMPORT_TESTFILES/txtstr.conf +$SRC_H5IMPORT_TESTFILES/txtfp32.txt +$SRC_H5IMPORT_TESTFILES/txtfp64.txt +$SRC_H5IMPORT_TESTFILES/txtuin32.txt +$SRC_H5IMPORT_TESTFILES/txtin16.txt +$SRC_H5IMPORT_TESTFILES/txtin32.txt +$SRC_H5IMPORT_TESTFILES/textpfe64.txt +$SRC_H5IMPORT_TESTFILES/txtstr.txt " # @@ -164,64 +165,76 @@ rm -f output.h5 log1 tx* b* *.dat COPY_TESTFILES_TO_TESTDIR mkdir tmp_testfiles -cp $TESTDIR/*.h5 tmp_testfiles/ +$CP $TESTDIR/*.h5 ./tmp_testfiles/ $RUNSERIAL ./h5importtest ################################################ -### T H E T E S T S +### T H E T E S T S ################################################ TESTING "ASCII I32 rank 3 - Output BE " ; -TOOLTEST $TESTDIR/in32.txt -c $TESTDIR/textin32.conf -o test1.h5 +TOOLTEST $TESTDIR/txtin16.txt -c $TESTDIR/txtin32.conf -o txtin32.h5 TESTING "ASCII I16 rank 3 - Output LE - CHUNKED - extended" -TOOLTEST $TESTDIR/in16.txt -c $TESTDIR/textin16.conf -o test2.h5 +TOOLTEST $TESTDIR/txtin16.txt -c $TESTDIR/txtin16.conf -o txtin16.h5 + TESTING "ASCII I8 - rank 3 - Output I8 LE-Chunked+Extended+Compressed " -TOOLTEST $TESTDIR/in16.txt -c $TESTDIR/textin8.conf -o test3.h5 +TOOLTEST $TESTDIR/txtin16.txt -c $TESTDIR/txtin8.conf -o txtin8.h5 TESTING "ASCII UI32 - rank 3 - Output BE" -TOOLTEST $TESTDIR/in1.txt -c $TESTDIR/textuin32.conf -o test4.h5 +TOOLTEST $TESTDIR/txtuin32.txt -c $TESTDIR/txtuin32.conf -o txtuin32.h5 TESTING "ASCII UI16 - rank 2 - Output LE+Chunked+Compressed " -TOOLTEST $TESTDIR/in1.txt -c $TESTDIR/textuin16.conf -o test5.h5 +TOOLTEST $TESTDIR/txtuin32.txt -c $TESTDIR/txtuin16.conf -o txtuin16.h5 TESTING "ASCII F32 - rank 3 - Output LE " -TOOLTEST $TESTDIR/fp1.txt -c $TESTDIR/textfp32.conf -o test6.h5 +TOOLTEST $TESTDIR/txtfp32.txt -c $TESTDIR/txtfp32.conf -o txtfp32.h5 + TESTING "ASCII F64 - rank 3 - Output BE + CHUNKED+Extended+Compressed " -TOOLTEST $TESTDIR/fp2.txt -c $TESTDIR/textfp64.conf -o test7.h5 +TOOLTEST $TESTDIR/txtfp64.txt -c $TESTDIR/txtfp64.conf -o txtfp64.h5 TESTING "BINARY F64 - rank 3 - Output LE+CHUNKED+Extended+Compressed " -TOOLTEST binfp64.bin -c $TESTDIR/binfp64.conf -o test8.h5 +TOOLTEST binfp64.bin -c $TESTDIR/binfp64.conf -o binfp64.h5 + TESTING "BINARY I16 - rank 3 - Output order LE + CHUNKED + extended " -TOOLTEST binin16.bin -c $TESTDIR/binin16.conf -o test9.h5 +TOOLTEST binin16.bin -c $TESTDIR/binin16.conf -o binin16.h5 + TESTING "BINARY I8 - rank 3 - Output I16LE + Chunked+Extended+Compressed " -TOOLTEST binin8.bin -c $TESTDIR/binin8.conf -o test10.h5 +TOOLTEST binin8.bin -c $TESTDIR/binin8.conf -o binin8.h5 + TESTING "BINARY I32 - rank 3 - Output BE + CHUNKED " -TOOLTEST binin32.bin -c $TESTDIR/binin32.conf -o test11.h5 +TOOLTEST binin32.bin -c $TESTDIR/binin32.conf -o binin32.h5 + TESTING "BINARY UI16 - rank 3 - Output byte BE + CHUNKED " -TOOLTEST binuin16.bin -c $TESTDIR/binuin16.conf -o test12.h5 +TOOLTEST binuin16.bin -c $TESTDIR/binuin16.conf -o binuin16.h5 TESTING "BINARY UI32 - rank 3 - Output LE + CHUNKED " -TOOLTEST binuin32.bin -c $TESTDIR/binuin32.conf -o test13.h5 +TOOLTEST binuin32.bin -c $TESTDIR/binuin32.conf -o binuin32.h5 + TESTING "STR" -TOOLTEST $TESTDIR/str.txt -c $TESTDIR/textstr.conf -o test14.h5 +TOOLTEST $TESTDIR/txtstr.txt -c $TESTDIR/txtstr.conf -o txtstr.h5 + +TESTING "BINARY I8 CR LF EOF" +TOOLTEST binin8w.bin -c $TESTDIR/binin8w.conf -o binin8w.h5 TESTING "ASCII F64 - rank 1 - INPUT-CLASS TEXTFPE " -TOOLTEST $TESTDIR/in64.txt -c $TESTDIR/textpfe.conf -o test15.h5 +TOOLTEST $TESTDIR/textpfe64.txt -c $TESTDIR/textpfe.conf -o textpfe.h5 + + rm -f txtin32.txt txtin16.txt *.bin *.h5 rm -rf tmp_testfiles else - echo "** h5import or h5importtest not available ***" - nerrors="` expr $nerrors + 1 `"; + echo "** h5import or h5importtest not available ***" + nerrors="` expr $nerrors + 1 `"; fi # diff --git a/tools/h5import/testfiles/binfp32.conf b/tools/h5import/testfiles/binfp32.conf deleted file mode 100755 index 66e6b35..0000000 --- a/tools/h5import/testfiles/binfp32.conf +++ /dev/null @@ -1,12 +0,0 @@ -PATH /fpbin/32-bit -INPUT-CLASS FP -INPUT-SIZE 32 -RANK 3 -DIMENSION-SIZES 5 3 4 -OUTPUT-ARCHITECTURE IEEE -OUTPUT-BYTE-ORDER BE -CHUNKED-DIMENSION-SIZES 2 2 2 -COMPRESSION-PARAM 2 - - - diff --git a/tools/h5import/testfiles/test8.h5 b/tools/h5import/testfiles/binfp64.h5 Binary files differindex 80e3a8a..80e3a8a 100644 --- a/tools/h5import/testfiles/test8.h5 +++ b/tools/h5import/testfiles/binfp64.h5 diff --git a/tools/h5import/testfiles/test9.h5 b/tools/h5import/testfiles/binin16.h5 Binary files differindex 0825bbc..0825bbc 100644 --- a/tools/h5import/testfiles/test9.h5 +++ b/tools/h5import/testfiles/binin16.h5 diff --git a/tools/h5import/testfiles/test11.h5 b/tools/h5import/testfiles/binin32.h5 Binary files differindex fd8faa9..fd8faa9 100644 --- a/tools/h5import/testfiles/test11.h5 +++ b/tools/h5import/testfiles/binin32.h5 diff --git a/tools/h5import/testfiles/test10.h5 b/tools/h5import/testfiles/binin8.h5 Binary files differindex a1d1a37..a1d1a37 100644 --- a/tools/h5import/testfiles/test10.h5 +++ b/tools/h5import/testfiles/binin8.h5 diff --git a/tools/h5import/testfiles/binin8w.conf b/tools/h5import/testfiles/binin8w.conf new file mode 100644 index 0000000..fccb4ac --- /dev/null +++ b/tools/h5import/testfiles/binin8w.conf @@ -0,0 +1,9 @@ + +INPUT-CLASS IN +INPUT-SIZE 8 +RANK 1 +DIMENSION-SIZES 4 +OUTPUT-BYTE-ORDER LE +OUTPUT-CLASS IN +OUTPUT-SIZE 8 +OUTPUT-ARCHITECTURE STD diff --git a/tools/h5import/testfiles/binin8w.h5 b/tools/h5import/testfiles/binin8w.h5 Binary files differnew file mode 100644 index 0000000..64acaed --- /dev/null +++ b/tools/h5import/testfiles/binin8w.h5 diff --git a/tools/h5import/testfiles/test12.h5 b/tools/h5import/testfiles/binuin16.h5 Binary files differindex c486c89..c486c89 100644 --- a/tools/h5import/testfiles/test12.h5 +++ b/tools/h5import/testfiles/binuin16.h5 diff --git a/tools/h5import/testfiles/test13.h5 b/tools/h5import/testfiles/binuin32.h5 Binary files differindex 41699d7..41699d7 100644 --- a/tools/h5import/testfiles/test13.h5 +++ b/tools/h5import/testfiles/binuin32.h5 diff --git a/tools/h5import/testfiles/test15.h5 b/tools/h5import/testfiles/textpfe.h5 Binary files differindex 73a157c..213051d 100644 --- a/tools/h5import/testfiles/test15.h5 +++ b/tools/h5import/testfiles/textpfe.h5 diff --git a/tools/h5import/testfiles/in64.txt b/tools/h5import/testfiles/textpfe64.txt index f6dd7f4..f6dd7f4 100644 --- a/tools/h5import/testfiles/in64.txt +++ b/tools/h5import/testfiles/textpfe64.txt diff --git a/tools/h5import/testfiles/textfp32.conf b/tools/h5import/testfiles/txtfp32.conf index 9696a7f..9696a7f 100755 --- a/tools/h5import/testfiles/textfp32.conf +++ b/tools/h5import/testfiles/txtfp32.conf diff --git a/tools/h5import/testfiles/test6.h5 b/tools/h5import/testfiles/txtfp32.h5 Binary files differindex f74e003..f74e003 100644 --- a/tools/h5import/testfiles/test6.h5 +++ b/tools/h5import/testfiles/txtfp32.h5 diff --git a/tools/h5import/testfiles/fp1.txt b/tools/h5import/testfiles/txtfp32.txt index 142c94f..142c94f 100755 --- a/tools/h5import/testfiles/fp1.txt +++ b/tools/h5import/testfiles/txtfp32.txt diff --git a/tools/h5import/testfiles/textfp64.conf b/tools/h5import/testfiles/txtfp64.conf index fbab6a6..fbab6a6 100755 --- a/tools/h5import/testfiles/textfp64.conf +++ b/tools/h5import/testfiles/txtfp64.conf diff --git a/tools/h5import/testfiles/test7.h5 b/tools/h5import/testfiles/txtfp64.h5 Binary files differindex b6ba4f5..b6ba4f5 100644 --- a/tools/h5import/testfiles/test7.h5 +++ b/tools/h5import/testfiles/txtfp64.h5 diff --git a/tools/h5import/testfiles/fp2.txt b/tools/h5import/testfiles/txtfp64.txt index 6c83dc3..6c83dc3 100755 --- a/tools/h5import/testfiles/fp2.txt +++ b/tools/h5import/testfiles/txtfp64.txt diff --git a/tools/h5import/testfiles/textin16.conf b/tools/h5import/testfiles/txtin16.conf index d2d11c3..d2d11c3 100755 --- a/tools/h5import/testfiles/textin16.conf +++ b/tools/h5import/testfiles/txtin16.conf diff --git a/tools/h5import/testfiles/test2.h5 b/tools/h5import/testfiles/txtin16.h5 Binary files differindex dc6c1ea..dc6c1ea 100644 --- a/tools/h5import/testfiles/test2.h5 +++ b/tools/h5import/testfiles/txtin16.h5 diff --git a/tools/h5import/testfiles/in32.txt b/tools/h5import/testfiles/txtin16.txt index 0688e9b..0688e9b 100644 --- a/tools/h5import/testfiles/in32.txt +++ b/tools/h5import/testfiles/txtin16.txt diff --git a/tools/h5import/testfiles/textin32.conf b/tools/h5import/testfiles/txtin32.conf index ca4802a..ca4802a 100755 --- a/tools/h5import/testfiles/textin32.conf +++ b/tools/h5import/testfiles/txtin32.conf diff --git a/tools/h5import/testfiles/test1.h5 b/tools/h5import/testfiles/txtin32.h5 Binary files differindex 350333c..350333c 100644 --- a/tools/h5import/testfiles/test1.h5 +++ b/tools/h5import/testfiles/txtin32.h5 diff --git a/tools/h5import/testfiles/in16.txt b/tools/h5import/testfiles/txtin32.txt index 0688e9b..0688e9b 100644 --- a/tools/h5import/testfiles/in16.txt +++ b/tools/h5import/testfiles/txtin32.txt diff --git a/tools/h5import/testfiles/textin8.conf b/tools/h5import/testfiles/txtin8.conf index 95fc5d8..9dbfd2b 100755 --- a/tools/h5import/testfiles/textin8.conf +++ b/tools/h5import/testfiles/txtin8.conf @@ -15,3 +15,4 @@ COMPRESSION-TYPE GZIP + diff --git a/tools/h5import/testfiles/test3.h5 b/tools/h5import/testfiles/txtin8.h5 Binary files differindex 42e7727..42e7727 100644 --- a/tools/h5import/testfiles/test3.h5 +++ b/tools/h5import/testfiles/txtin8.h5 diff --git a/tools/h5import/testfiles/textstr.conf b/tools/h5import/testfiles/txtstr.conf index 85079e0..85079e0 100644 --- a/tools/h5import/testfiles/textstr.conf +++ b/tools/h5import/testfiles/txtstr.conf diff --git a/tools/h5import/testfiles/test14.h5 b/tools/h5import/testfiles/txtstr.h5 Binary files differindex ceb0810..ceb0810 100644 --- a/tools/h5import/testfiles/test14.h5 +++ b/tools/h5import/testfiles/txtstr.h5 diff --git a/tools/h5import/testfiles/str.txt b/tools/h5import/testfiles/txtstr.txt index 25be0a6..25be0a6 100644 --- a/tools/h5import/testfiles/str.txt +++ b/tools/h5import/testfiles/txtstr.txt diff --git a/tools/h5import/testfiles/textuin16.conf b/tools/h5import/testfiles/txtuin16.conf index 753e6e8..753e6e8 100755 --- a/tools/h5import/testfiles/textuin16.conf +++ b/tools/h5import/testfiles/txtuin16.conf diff --git a/tools/h5import/testfiles/test5.h5 b/tools/h5import/testfiles/txtuin16.h5 Binary files differindex 9ee166a..9ee166a 100644 --- a/tools/h5import/testfiles/test5.h5 +++ b/tools/h5import/testfiles/txtuin16.h5 diff --git a/tools/h5import/testfiles/textuin32.conf b/tools/h5import/testfiles/txtuin32.conf index d61e1a1..d61e1a1 100755 --- a/tools/h5import/testfiles/textuin32.conf +++ b/tools/h5import/testfiles/txtuin32.conf diff --git a/tools/h5import/testfiles/test4.h5 b/tools/h5import/testfiles/txtuin32.h5 Binary files differindex 1a4dda5..1a4dda5 100644 --- a/tools/h5import/testfiles/test4.h5 +++ b/tools/h5import/testfiles/txtuin32.h5 diff --git a/tools/h5import/testfiles/in1.txt b/tools/h5import/testfiles/txtuin32.txt index 0688e9b..0688e9b 100755 --- a/tools/h5import/testfiles/in1.txt +++ b/tools/h5import/testfiles/txtuin32.txt |