From 68ec8c4f6c637b95914bd8543be4a37f5f1a7d47 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 17 May 2017 10:06:17 -0500 Subject: [PATCH] HDFFV-9055 add test files --- MANIFEST | 3 ++ tools/test/h5diff/CMakeTests.cmake | 16 ++++++++ tools/test/h5diff/h5diffgentest.c | 43 ++++++++++++++++---- tools/test/h5diff/testfiles/h5diff_800.txt | 12 ++++++ tools/test/h5diff/testfiles/h5diff_801.txt | 13 ++++++ tools/test/h5diff/testfiles/h5diff_dset3.h5 | Bin 0 -> 23416 bytes 6 files changed, 80 insertions(+), 7 deletions(-) create mode 100644 tools/test/h5diff/testfiles/h5diff_800.txt create mode 100644 tools/test/h5diff/testfiles/h5diff_801.txt create mode 100644 tools/test/h5diff/testfiles/h5diff_dset3.h5 diff --git a/MANIFEST b/MANIFEST index 35d3c2ee36..434a857bab 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2238,6 +2238,8 @@ ./tools/test/h5diff/testfiles/h5diff_709.txt ./tools/test/h5diff/testfiles/h5diff_710.txt ./tools/test/h5diff/testfiles/h5diff_80.txt +./tools/test/h5diff/testfiles/h5diff_800.txt +./tools/test/h5diff/testfiles/h5diff_801.txt ./tools/test/h5diff/testfiles/h5diff_90.txt ./tools/test/h5diff/testfiles/h5diff_100.txt ./tools/test/h5diff/testfiles/h5diff_101.txt @@ -2348,6 +2350,7 @@ ./tools/test/h5diff/testfiles/h5diff_basic2.h5 ./tools/test/h5diff/testfiles/h5diff_dset1.h5 ./tools/test/h5diff/testfiles/h5diff_dset2.h5 +./tools/test/h5diff/testfiles/h5diff_dset3.h5 ./tools/test/h5diff/testfiles/h5diff_dtypes.h5 ./tools/test/h5diff/testfiles/h5diff_empty.h5 ./tools/test/h5diff/testfiles/h5diff_hyper1.h5 diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index f6cd2dd48d..72dda6b976 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -28,6 +28,7 @@ ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_attr2.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_dset1.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_dset2.h5 + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_dset3.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_hyper1.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_hyper2.h5 ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_empty.h5 @@ -275,6 +276,8 @@ ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_709.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_710.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_80.txt + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_800.txt + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_801.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_90.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_tmp1.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_tmp2.txt @@ -464,6 +467,7 @@ set (FILE6 h5diff_attr2.h5) set (FILE7 h5diff_dset1.h5) set (FILE8 h5diff_dset2.h5) + set (FILE8A h5diff_dset3.h5) set (FILE9 h5diff_hyper1.h5) set (FILE10 h5diff_hyper2.h5) set (FILE11 h5diff_empty.h5) @@ -872,6 +876,10 @@ h5diff_710.out.err h5diff_80.out h5diff_80.out.err + h5diff_800.out + h5diff_800.out.err + h5diff_801.out + h5diff_801.out.err h5diff_90.out h5diff_90.out.err h5diff_v1.out @@ -1477,6 +1485,14 @@ ADD_H5_TEST (h5diff_644 1 -v --use-system-epsilon -d 5 ${FILE1} ${FILE2} /g1/dse ADD_H5_TEST (h5diff_645 1 -v -p 0.05 --use-system-epsilon ${FILE1} ${FILE2} /g1/dset3 /g1/dset4) ADD_H5_TEST (h5diff_646 1 -v --use-system-epsilon -p 0.05 ${FILE1} ${FILE2} /g1/dset3 /g1/dset4) +# ############################################################################## +# # Test array variances +# ############################################################################## +# +# Test with -d , -p and --use-system-epsilon. +ADD_H5_TEST (h5diff_800 1 -v ${FILE7} ${FILE8} /g1/array /g1/array) +ADD_H5_TEST (h5diff_801 1 -v ${FILE7} ${FILE8A} /g1/array /g1/array) + # ############################################################################## # VDS tests # ############################################################################## diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c index cc7b057a68..6a8436577f 100644 --- a/tools/test/h5diff/h5diffgentest.c +++ b/tools/test/h5diff/h5diffgentest.c @@ -48,6 +48,7 @@ size_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024); #define FILE6 "h5diff_attr2.h5" #define FILE7 "h5diff_dset1.h5" #define FILE8 "h5diff_dset2.h5" +#define FILE8A "h5diff_dset3.h5" #define FILE9 "h5diff_hyper1.h5" #define FILE10 "h5diff_hyper2.h5" #define FILE11 "h5diff_empty.h5" @@ -197,6 +198,7 @@ int main(void) /* generate 2 files, the second call creates a similar file with differences */ test_datasets(FILE7,0); test_datasets(FILE8,1); + test_datasets(FILE8A,2); /* generate 2 files, the second call creates a similar file with differences */ test_hyperslab(FILE9,0); @@ -1328,7 +1330,7 @@ int test_datasets(const char *file, herr_t status; int buf[2]={1,2}; - if(make_diffs) + if(make_diffs > 0) memset(buf, 0, sizeof buf); /* Create a file */ @@ -1399,9 +1401,8 @@ int test_special_datasets(const char *file, /* Create a dataset with zero dimension size in one file but the other one * has a dataset with a non-zero dimension size */ - if(make_diffs) { + if(make_diffs) dims[1] = SPACE1_DIM2 + 4; - } sid = H5Screate_simple(SPACE1_RANK, dims, NULL); did = H5Dcreate2(fid, "dset2", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -5466,6 +5467,34 @@ static void test_objs_strings(const char *fname1, const char *fname2) H5Sclose(space); H5Dclose(dataset); + /* string 5 : early term long string */ + string4A[0][10] = 0; + string4A[0][11] = 0; + string4B[0][10] = 0; + + string4A[1][10] = 0; + string4A[1][11] = 'Z'; + string4B[1][10] = 0; + string4B[1][11] = 'x'; + + string4A[2][10] = 0; + string4B[2][10] = 0; + string4B[2][11] = 'a'; + string4B[2][12] = 'B'; + string4B[2][13] = 'c'; + space = H5Screate_simple(1, dims4, NULL); + f_type = mkstr(168, H5T_STR_NULLTERM); + m_type = mkstr(21, H5T_STR_NULLTERM); + dataset = H5Dcreate2(fid1, "/string5", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string4A); + H5Dclose(dataset); + dataset = H5Dcreate2(fid2, "/string5", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string4B); + H5Tclose(m_type); + H5Tclose(f_type); + H5Sclose(space); + H5Dclose(dataset); + out: /*----------------------------------------------------------------------- * Close IDs @@ -6613,6 +6642,9 @@ void write_dset_in(hid_t loc_id, int buf73[4][3][2]; /* integer */ float buf83[4][3][2]; /* float */ + if(make_diffs == 2) { + dimarray[0] = 4; + } /*------------------------------------------------------------------------- * H5S_SCALAR @@ -6621,11 +6653,8 @@ void write_dset_in(hid_t loc_id, - if ( make_diffs ) - { - + if(make_diffs) scalar_data = 1; - } /* create a space */ sid = H5Screate(H5S_SCALAR); diff --git a/tools/test/h5diff/testfiles/h5diff_800.txt b/tools/test/h5diff/testfiles/h5diff_800.txt new file mode 100644 index 0000000000..e43e7b4d68 --- /dev/null +++ b/tools/test/h5diff/testfiles/h5diff_800.txt @@ -0,0 +1,12 @@ +dataset: and +size: [2] [2] +position array array difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 0 ] 2 0 2 +[ 0 ] 3 0 3 +[ 1 ] 4 0 4 +[ 1 ] 5 0 5 +[ 1 ] 6 0 6 +6 differences found +EXIT CODE: 1 diff --git a/tools/test/h5diff/testfiles/h5diff_801.txt b/tools/test/h5diff/testfiles/h5diff_801.txt new file mode 100644 index 0000000000..043e7e3b43 --- /dev/null +++ b/tools/test/h5diff/testfiles/h5diff_801.txt @@ -0,0 +1,13 @@ +dataset: and +Warning: different storage datatype +size: [2] [2] +position array array difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 0 ] 2 0 2 +[ 0 ] 3 0 3 +[ 1 ] 4 0 4 +[ 1 ] 5 0 5 +[ 1 ] 6 0 6 +6 differences found +EXIT CODE: 1 diff --git a/tools/test/h5diff/testfiles/h5diff_dset3.h5 b/tools/test/h5diff/testfiles/h5diff_dset3.h5 new file mode 100644 index 0000000000000000000000000000000000000000..7a1f3ddcc1418b0ed8c18f8d5b29f450fedea981 GIT binary patch literal 23416 zcmeHPO>kVr5uTN7qwp8miETkhc>W0}Mv%o;j6#0AvL#y(`3GYhg%Glmz4{?WR%AJ~ z=7NsO%~UQNT@?;Ka3D91KAPg<{2Vx?bjX3Dt5TKXX8N1%-kmpZXLsNJNUN}I_s(=r zzj-tLdiqVzo6(;q#!f!=@RJW4KwqEPX8LVbe;x=Ff6E-DwLCAGjHGLl-tOT{#^9eZ z1H#`a_4{%c&X129lGOS&mCH_(oMg6W67q|Ff7vhY2>QjfoveVO=wbb5oXHEFe}OZrLf<{b89SIL zyY^G2RsZJKOt0w!V6yxBf35*M?)Toqf9uI)*dp)JC8PNK;NKp+@2JG1)hlQUNnDG% z;4t7BF|c zM5xoTUMG)dl5tRF@SJ)aIXtrvWIa1jIk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