Skip to content

Commit ba3b6ee

Browse files
committed
Sync h5diff nested container type testfiles
1 parent 9f7a756 commit ba3b6ee

File tree

4 files changed

+96
-13
lines changed

4 files changed

+96
-13
lines changed

tools/test/h5diff/expected/h5diff_540.txt

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,54 @@ position attr1 of </> attr1 of </> difference
2222
[ 1 ] 10 15 5
2323
[ 1 ] 10.5 15.5 5
2424
8 differences found
25+
attribute: <attr2 of </>> and <attr2 of </>>
26+
size: [2] [2]
27+
position attr2 of </> attr2 of </> difference
28+
------------------------------------------------------------
29+
[ 0 ] 0 5 5
30+
[ 0 ] 0 5 5
31+
[ 1 ] 10 15 5
32+
[ 1 ] 10.5 15.5 5
33+
[ 1 ] 10 15 5
34+
[ 1 ] 10.5 15.5 5
35+
6 differences found
36+
attribute: <attr3 of </>> and <attr3 of </>>
37+
size: [2] [2]
38+
position attr3 of </> attr3 of </> difference
39+
------------------------------------------------------------
40+
[ 0 ] 0 5 5
41+
[ 0 ] 0 5 5
42+
[ 0 ] 10 15 5
43+
[ 0 ] 10.5 15.5 5
44+
[ 0 ] 10 15 5
45+
[ 0 ] 10.5 15.5 5
46+
[ 1 ] 0 5 5
47+
[ 1 ] 0 5 5
48+
[ 1 ] 10 15 5
49+
[ 1 ] 10.5 15.5 5
50+
[ 1 ] 10 15 5
51+
[ 1 ] 10.5 15.5 5
52+
12 differences found
53+
attribute: <attr4 of </>> and <attr4 of </>>
54+
size: [2] [2]
55+
position attr4 of </> attr4 of </> difference
56+
------------------------------------------------------------
57+
[ 0 ] 0 5 5
58+
[ 0 ] 0 5 5
59+
[ 0 ] 0 5 5
60+
[ 0 ] 10 15 5
61+
[ 0 ] 10.5 15.5 5
62+
[ 1 ] 10 15 5
63+
[ 1 ] 0 5 5
64+
[ 1 ] 0 5 5
65+
[ 1 ] 10 15 5
66+
[ 1 ] 10.5 15.5 5
67+
[ 1 ] 10 15 5
68+
[ 1 ] 0 5 5
69+
[ 1 ] 0 5 5
70+
[ 1 ] 10 15 5
71+
[ 1 ] 10.5 15.5 5
72+
15 differences found
2573
dataset: </dset1> and </dset1>
2674
size: [2] [2]
2775
position dset1 dset1 difference
@@ -83,4 +131,4 @@ position dset4 dset4 difference
83131
[ 1 ] 10 15 5
84132
[ 1 ] 10.5 15.5 5
85133
15 differences found
86-
EXIT CODE: 1
134+
EXIT CODE: 1

tools/test/h5diff/h5diffgentest.c

Lines changed: 47 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,9 @@ static int test_attributes_verbose_level(const char *fname1, const char *fname2
179179
static int test_enums(const char *fname);
180180
static void test_comps_array(const char *fname, const char *dset, const char *attr, int diff,
181181
int is_file_new);
182-
static void test_comps_vlen(const char *fname, const char *dset, int diff, int is_file_new);
183-
static void test_comps_array_vlen(const char *fname, const char *dset, int diff, int is_file_new);
184-
static void test_comps_vlen_arry(const char *fname, const char *dset, int diff, int is_file_new);
182+
static void test_comps_vlen(const char *fname, const char *dset, const char *attr, int diff, int is_file_new);
183+
static void test_comps_array_vlen(const char *fname, const char *dset, const char *attr, int diff, int is_file_new);
184+
static void test_comps_vlen_arry(const char *fname, const char *dset, const char *attr, int diff, int is_file_new);
185185
static void test_data_nocomparables(const char *fname, int diff);
186186
static void test_objs_nocomparables(const char *fname1, const char *fname2);
187187
static void test_objs_strings(const char *fname, const char *fname2);
@@ -287,14 +287,14 @@ main(void)
287287
*/
288288
/* file1 */
289289
test_comps_array(COMPS_COMPLEX1, "dset1", "attr1", 0, 1);
290-
test_comps_vlen(COMPS_COMPLEX1, "dset2", 0, 0);
291-
test_comps_array_vlen(COMPS_COMPLEX1, "dset3", 0, 0);
292-
test_comps_vlen_arry(COMPS_COMPLEX1, "dset4", 0, 0);
290+
test_comps_vlen(COMPS_COMPLEX1, "dset2", "attr2", 0, 0);
291+
test_comps_array_vlen(COMPS_COMPLEX1, "dset3", "attr3", 0, 0);
292+
test_comps_vlen_arry(COMPS_COMPLEX1, "dset4", "attr4", 0, 0);
293293
/* file2 */
294294
test_comps_array(COMPS_COMPLEX2, "dset1", "attr1", 5, 1);
295-
test_comps_vlen(COMPS_COMPLEX2, "dset2", 5, 0);
296-
test_comps_array_vlen(COMPS_COMPLEX2, "dset3", 5, 0);
297-
test_comps_vlen_arry(COMPS_COMPLEX2, "dset4", 5, 0);
295+
test_comps_vlen(COMPS_COMPLEX2, "dset2", "attr2", 5, 0);
296+
test_comps_array_vlen(COMPS_COMPLEX2, "dset3", "attr3", 5, 0);
297+
test_comps_vlen_arry(COMPS_COMPLEX2, "dset4", "attr4", 5, 0);
298298

299299
/*-------------------------------------------------
300300
* Create test files with non-comparable dataset and attributes with
@@ -4966,7 +4966,7 @@ test_comps_array(const char *fname, const char *dset, const char *attr, int diff
49664966
}
49674967

49684968
static void
4969-
test_comps_vlen(const char *fname, const char *dset, int diff, int is_file_new)
4969+
test_comps_vlen(const char *fname, const char *dset, const char *attr, int diff, int is_file_new)
49704970
{
49714971
/* sub compound 2 */
49724972
typedef struct {
@@ -4985,6 +4985,7 @@ test_comps_vlen(const char *fname, const char *dset, int diff, int is_file_new)
49854985
hid_t fid = H5I_INVALID_HID; /* HDF5 File ID */
49864986
hid_t did_dset = H5I_INVALID_HID; /* dataset ID */
49874987
hid_t sid_dset = H5I_INVALID_HID; /* dataset space ID */
4988+
hid_t tid_attr = H5I_INVALID_HID; /* attribute ID */
49884989
hid_t tid_cmpd2 = H5I_INVALID_HID; /* compound2 type ID */
49894990
hid_t tid_cmpd1 = H5I_INVALID_HID; /* compound1 type ID */
49904991
hid_t tid_cmpd1_vlen = H5I_INVALID_HID;
@@ -5047,12 +5048,22 @@ test_comps_vlen(const char *fname, const char *dset, int diff, int is_file_new)
50475048
ret = H5Dwrite(did_dset, tid_cmpd1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
50485049
assert(ret >= 0);
50495050

5051+
/*-----------------------------------
5052+
* Create an attribute in root group
5053+
*/
5054+
tid_attr = H5Acreate2(fid, attr, tid_cmpd1, sid_dset, H5P_DEFAULT, H5P_DEFAULT);
5055+
assert(tid_attr > 0);
5056+
ret = H5Awrite(tid_attr, tid_cmpd1, wdata);
5057+
assert(ret >= 0);
5058+
50505059
/* Reclaim the write VL data */
50515060
ret = H5Treclaim(tid_cmpd1, sid_dset, H5P_DEFAULT, wdata);
50525061
assert(ret >= 0);
50535062

50545063
/* ----------------
50555064
* Close IDs */
5065+
ret = H5Aclose(tid_attr);
5066+
assert(ret >= 0);
50565067
ret = H5Dclose(did_dset);
50575068
assert(ret >= 0);
50585069
ret = H5Tclose(tid_cmpd2);
@@ -5068,7 +5079,7 @@ test_comps_vlen(const char *fname, const char *dset, int diff, int is_file_new)
50685079
}
50695080

50705081
static void
5071-
test_comps_array_vlen(const char *fname, const char *dset, int diff, int is_file_new)
5082+
test_comps_array_vlen(const char *fname, const char *dset, const char *attr, int diff, int is_file_new)
50725083
{
50735084
typedef struct {
50745085
int i3;
@@ -5089,6 +5100,7 @@ test_comps_array_vlen(const char *fname, const char *dset, int diff, int is_file
50895100
hid_t fid = H5I_INVALID_HID; /* HDF5 File IDs */
50905101
hid_t did_dset = H5I_INVALID_HID; /* Dataset ID */
50915102
hid_t sid_dset = H5I_INVALID_HID; /* Dataspace ID */
5103+
hid_t tid_attr = H5I_INVALID_HID; /* Attribute ID */
50925104
hid_t tid_cmpd1 = H5I_INVALID_HID; /* Compound1 Datatype ID */
50935105
hid_t tid_arry1 = H5I_INVALID_HID; /* Array Datatype ID */
50945106
hid_t tid_cmpd2 = H5I_INVALID_HID; /* Compound2 Datatype ID */
@@ -5169,12 +5181,22 @@ test_comps_array_vlen(const char *fname, const char *dset, int diff, int is_file
51695181
ret = H5Dwrite(did_dset, tid_cmpd1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
51705182
assert(ret >= 0);
51715183

5184+
/*-----------------------------------
5185+
* Create an attribute in root group
5186+
*/
5187+
tid_attr = H5Acreate2(fid, attr, tid_cmpd1, sid_dset, H5P_DEFAULT, H5P_DEFAULT);
5188+
assert(tid_attr > 0);
5189+
ret = H5Awrite(tid_attr, tid_cmpd1, wdata);
5190+
assert(ret >= 0);
5191+
51725192
/* Reclaim the write VL data */
51735193
ret = H5Treclaim(tid_cmpd1, sid_dset, H5P_DEFAULT, wdata);
51745194
assert(ret >= 0);
51755195

51765196
/*-------------------
51775197
* Close IDs */
5198+
ret = H5Aclose(tid_attr);
5199+
assert(ret >= 0);
51785200
ret = H5Tclose(tid_arry1);
51795201
assert(ret >= 0);
51805202
ret = H5Dclose(did_dset);
@@ -5194,7 +5216,7 @@ test_comps_array_vlen(const char *fname, const char *dset, int diff, int is_file
51945216
}
51955217

51965218
static void
5197-
test_comps_vlen_arry(const char *fname, const char *dset, int diff, int is_file_new)
5219+
test_comps_vlen_arry(const char *fname, const char *dset, const char *attr, int diff, int is_file_new)
51985220
{
51995221
/* sub compound 3 */
52005222
typedef struct {
@@ -5219,6 +5241,7 @@ test_comps_vlen_arry(const char *fname, const char *dset, int diff, int is_file_
52195241
hid_t fid = H5I_INVALID_HID; /* HDF5 File ID */
52205242
hid_t did_dset = H5I_INVALID_HID; /* dataset ID */
52215243
hid_t sid_dset = H5I_INVALID_HID; /* dataset space ID */
5244+
hid_t tid_attr = H5I_INVALID_HID; /* attribute ID */
52225245
hid_t tid_cmpd3 = H5I_INVALID_HID; /* compound3 type ID */
52235246
hid_t tid_cmpd2 = H5I_INVALID_HID; /* compound2 type ID */
52245247
hid_t tid_cmpd2_arry = H5I_INVALID_HID;
@@ -5301,10 +5324,22 @@ test_comps_vlen_arry(const char *fname, const char *dset, int diff, int is_file_
53015324
ret = H5Dwrite(did_dset, tid_cmpd1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
53025325
assert(ret >= 0);
53035326

5327+
/*-----------------------------------
5328+
* Create an attribute in root group
5329+
*/
5330+
tid_attr = H5Acreate2(fid, attr, tid_cmpd1, sid_dset, H5P_DEFAULT, H5P_DEFAULT);
5331+
assert(tid_attr > 0);
5332+
ret = H5Awrite(tid_attr, tid_cmpd1, wdata);
5333+
assert(ret >= 0);
5334+
53045335
/* Reclaim the write VL data */
53055336
ret = H5Treclaim(tid_cmpd1, sid_dset, H5P_DEFAULT, wdata);
53065337
assert(ret >= 0);
53075338

5339+
/* ----------------
5340+
* Close IDs */
5341+
ret = H5Aclose(tid_attr);
5342+
assert(ret >= 0);
53085343
ret = H5Dclose(did_dset);
53095344
assert(ret >= 0);
53105345
ret = H5Sclose(sid_dset);
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)