summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-08-25 14:14:21 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-08-25 14:14:21 (GMT)
commitb043ee1241522fc0b87787ead985f5d9f3b7af26 (patch)
treed7f3eeea14b36276fb1c29904dcf092c6d81116b /test
parent6c5e37a5938f3dc614f908d5d955b3103db4f367 (diff)
downloadhdf5-b043ee1241522fc0b87787ead985f5d9f3b7af26.zip
hdf5-b043ee1241522fc0b87787ead985f5d9f3b7af26.tar.gz
hdf5-b043ee1241522fc0b87787ead985f5d9f3b7af26.tar.bz2
[svn-r17417] Description:
Bring r17365:17416 from trunk to revise_chunks branch Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.5.8 (amazon) in debug mode Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'test')
-rw-r--r--test/dt_arith.c5
-rw-r--r--test/freespace.c148
-rw-r--r--test/links.c271
-rw-r--r--test/mf.c1
-rw-r--r--test/ohdr.c28
-rw-r--r--test/tsohm.c20
6 files changed, 385 insertions, 88 deletions
diff --git a/test/dt_arith.c b/test/dt_arith.c
index 6c59555..43855a8 100644
--- a/test/dt_arith.c
+++ b/test/dt_arith.c
@@ -2524,6 +2524,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst)
if (++fails_all_tests>=max_fails) {
HDputs(" maximum failures reached, aborting test...");
+ HDputs(" (dst is library's conversion output. ans is compiler's conversion output.)");
goto done;
}
}
@@ -3359,6 +3360,7 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst)
HDputs(" maximum failures reached, aborting test...");
else if(run_test==TEST_DENORM || run_test==TEST_SPECIAL)
HDputs(" maximum warnings reached, aborting test...");
+ HDputs(" (dst is library's conversion output. ans is compiler's conversion output.)");
goto done;
}
@@ -4488,6 +4490,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst)
HDputs(" maximum failures reached, aborting test...");
else if(run_test==TEST_DENORM || run_test==TEST_SPECIAL)
HDputs(" maximum warnings reached, aborting test...");
+ HDputs(" (dst is library's conversion output. ans is compiler's conversion output.)");
goto done;
}
@@ -4887,7 +4890,9 @@ run_int_fp_conv(const char *name)
nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_LONG, H5T_NATIVE_FLOAT);
nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_LONG, H5T_NATIVE_DOUBLE);
+#if H5_ULONG_TO_FLOAT_ACCURATE
nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_ULONG, H5T_NATIVE_FLOAT);
+#endif
nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_ULONG, H5T_NATIVE_DOUBLE);
#endif
diff --git a/test/freespace.c b/test/freespace.c
index 82395d0..0f6514c 100644
--- a/test/freespace.c
+++ b/test/freespace.c
@@ -638,7 +638,7 @@ test_fs_sect_add(hid_t fapl)
init_sect_node(sect_node, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node,
- H5FS_ADD_RETURNED_SPACE, NULL))
+ H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
HDmemset(&state, 0, sizeof(frspace_state_t));
@@ -701,7 +701,7 @@ test_fs_sect_add(hid_t fapl)
init_sect_node(sect_node, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node,
- 0, NULL))
+ 0, NULL) < 0)
FAIL_STACK_ERROR
HDmemset(&state, 0, sizeof(frspace_state_t));
@@ -775,7 +775,7 @@ test_fs_sect_add(hid_t fapl)
init_sect_node(sect_node, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node,
- H5FS_ADD_RETURNED_SPACE, &can_shrink))
+ H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0)
FAIL_STACK_ERROR
/* nothing in free-space */
@@ -844,7 +844,7 @@ test_fs_sect_add(hid_t fapl)
init_sect_node(sect_node, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node,
- H5FS_ADD_DESERIALIZING, &can_shrink))
+ H5FS_ADD_DESERIALIZING, &can_shrink) < 0)
FAIL_STACK_ERROR
HDmemset(&state, 0, sizeof(frspace_state_t));
@@ -952,7 +952,7 @@ test_fs_sect_find(hid_t fapl)
TEST_ERROR
if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
- (hsize_t)TEST_SECT_SIZE30, (H5FS_section_info_t **)&node)) < 0)
+ (hsize_t)TEST_SECT_SIZE30, (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
if (node_found) TEST_ERROR
@@ -988,7 +988,7 @@ test_fs_sect_find(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node1,
- H5FS_ADD_RETURNED_SPACE, NULL))
+ H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
HDmemset(&state, 0, sizeof(frspace_state_t));
@@ -1009,7 +1009,7 @@ test_fs_sect_find(hid_t fapl)
init_sect_node(sect_node3, (haddr_t)(TEST_SECT_ADDR200), (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node3,
- H5FS_ADD_RETURNED_SPACE, NULL))
+ H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
state.tot_space += sect_node3->sect_info.size;
@@ -1028,7 +1028,7 @@ test_fs_sect_find(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node2,
- H5FS_ADD_RETURNED_SPACE, NULL))
+ H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
state.tot_space += sect_node2->sect_info.size;
@@ -1047,7 +1047,7 @@ test_fs_sect_find(hid_t fapl)
init_sect_node(sect_node4, (haddr_t)TEST_SECT_ADDR300, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node4,
- H5FS_ADD_RETURNED_SPACE, NULL))
+ H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
state.tot_space += sect_node4->sect_info.size;
@@ -1058,7 +1058,7 @@ test_fs_sect_find(hid_t fapl)
TEST_ERROR
if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
- (hsize_t)TEST_SECT_SIZE50, (H5FS_section_info_t **)&node)) < 0)
+ (hsize_t)TEST_SECT_SIZE50, (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
if (!node_found) TEST_ERROR
@@ -1105,7 +1105,7 @@ test_fs_sect_find(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node1,
- H5FS_ADD_RETURNED_SPACE, NULL))
+ H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
HDmemset(&state, 0, sizeof(frspace_state_t));
@@ -1125,7 +1125,7 @@ test_fs_sect_find(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR200, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node2,
- H5FS_ADD_RETURNED_SPACE, NULL))
+ H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
state.tot_space += sect_node2->sect_info.size;
@@ -1136,7 +1136,7 @@ test_fs_sect_find(hid_t fapl)
TEST_ERROR
if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
- (hsize_t)TEST_SECT_SIZE50, (H5FS_section_info_t **)&node)) < 0)
+ (hsize_t)TEST_SECT_SIZE50, (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
if (!node_found) TEST_ERROR
@@ -1178,7 +1178,7 @@ test_fs_sect_find(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node1,
- H5FS_ADD_RETURNED_SPACE, NULL))
+ H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
HDmemset(&state, 0, sizeof(frspace_state_t));
@@ -1190,7 +1190,7 @@ test_fs_sect_find(hid_t fapl)
TEST_ERROR
if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
- (hsize_t)TEST_SECT_SIZE50, (H5FS_section_info_t **)&node)) < 0)
+ (hsize_t)TEST_SECT_SIZE50, (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
if (node_found) TEST_ERROR
@@ -1311,7 +1311,7 @@ test_fs_sect_merge(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node1,
- H5FS_ADD_RETURNED_SPACE, NULL))
+ H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
HDmemset(&state, 0, sizeof(frspace_state_t));
@@ -1331,7 +1331,7 @@ test_fs_sect_merge(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node2,
- H5FS_ADD_RETURNED_SPACE, NULL))
+ H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
/* section B & C are merged */
@@ -1349,7 +1349,7 @@ test_fs_sect_merge(hid_t fapl)
init_sect_node(sect_node3, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE10, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node3,
- H5FS_ADD_RETURNED_SPACE, NULL))
+ H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
/* section A is merged with the merged section of B & C */
@@ -1367,7 +1367,7 @@ test_fs_sect_merge(hid_t fapl)
init_sect_node(sect_node4, (haddr_t)TEST_SECT_ADDR150, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node4,
- H5FS_ADD_RETURNED_SPACE, NULL))
+ H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
/* section D is merged with the merged section of A & B & C */
@@ -1379,7 +1379,7 @@ test_fs_sect_merge(hid_t fapl)
/* should be able to find the merged section of A, B, C & D */
if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
- (hsize_t)(TEST_SECT_SIZE10+TEST_SECT_SIZE30+TEST_SECT_SIZE50+TEST_SECT_SIZE80), (H5FS_section_info_t **)&node)) < 0)
+ (hsize_t)(TEST_SECT_SIZE10+TEST_SECT_SIZE30+TEST_SECT_SIZE50+TEST_SECT_SIZE80), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
if (!node_found) TEST_ERROR
@@ -1439,7 +1439,7 @@ test_fs_sect_merge(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node1,
- H5FS_ADD_RETURNED_SPACE, NULL))
+ H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
HDmemset(&state, 0, sizeof(frspace_state_t));
@@ -1459,7 +1459,7 @@ test_fs_sect_merge(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node2,
- H5FS_ADD_RETURNED_SPACE, NULL))
+ H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
/* section A & B are not merged because H5FS_CLS_SEPAR_OBJ is set */
@@ -1472,7 +1472,7 @@ test_fs_sect_merge(hid_t fapl)
/* should not be able to find the merged section of A & B */
if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
- (hsize_t)(TEST_SECT_SIZE30+TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0)
+ (hsize_t)(TEST_SECT_SIZE30+TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
if (node_found) TEST_ERROR
@@ -1533,7 +1533,7 @@ test_fs_sect_merge(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE10, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node1,
- H5FS_ADD_RETURNED_SPACE, NULL))
+ H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
HDmemset(&state, 0, sizeof(frspace_state_t));
@@ -1553,7 +1553,7 @@ test_fs_sect_merge(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE_NEW, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node2,
- H5FS_ADD_RETURNED_SPACE, NULL))
+ H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
/* sections A & B are not merged because H5FS_CLS_MERGE_SYM is set & section class type is different */
@@ -1573,7 +1573,7 @@ test_fs_sect_merge(hid_t fapl)
init_sect_node(sect_node3, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE_NEW, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node3,
- H5FS_ADD_RETURNED_SPACE, NULL))
+ H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
/* sections B & C are merged because H5FS_CLS_MERGE_SYM is set & section class type is the same */
@@ -1591,7 +1591,7 @@ test_fs_sect_merge(hid_t fapl)
init_sect_node(sect_node4, (haddr_t)TEST_SECT_ADDR150, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node4,
- H5FS_ADD_RETURNED_SPACE, NULL))
+ H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
/*
@@ -1607,14 +1607,14 @@ test_fs_sect_merge(hid_t fapl)
/* should not be able to find a merged section of A, B, C & D */
if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
- (hsize_t)(TEST_SECT_SIZE10+TEST_SECT_SIZE30+TEST_SECT_SIZE50+TEST_SECT_SIZE80), (H5FS_section_info_t **)&node)) < 0)
+ (hsize_t)(TEST_SECT_SIZE10+TEST_SECT_SIZE30+TEST_SECT_SIZE50+TEST_SECT_SIZE80), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
if (node_found) TEST_ERROR
/* should be able to find the merged section of B & C */
if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
- (hsize_t)(TEST_SECT_SIZE30+TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0)
+ (hsize_t)(TEST_SECT_SIZE30+TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
if (!node_found) TEST_ERROR
@@ -1628,7 +1628,7 @@ test_fs_sect_merge(hid_t fapl)
/* should be able to find section A */
if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
- (hsize_t)(TEST_SECT_SIZE10), (H5FS_section_info_t **)&node)) < 0)
+ (hsize_t)(TEST_SECT_SIZE10), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
if (!node_found) TEST_ERROR
@@ -1641,7 +1641,7 @@ test_fs_sect_merge(hid_t fapl)
/* should be able to find section D */
if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
- (hsize_t)(TEST_SECT_SIZE80), (H5FS_section_info_t **)&node)) < 0)
+ (hsize_t)(TEST_SECT_SIZE80), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
if (!node_found) TEST_ERROR
@@ -1766,7 +1766,7 @@ test_fs_sect_shrink(hid_t fapl)
can_shrink = FALSE;
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node1,
- H5FS_ADD_RETURNED_SPACE, &can_shrink))
+ H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0)
FAIL_STACK_ERROR
HDmemset(&state, 0, sizeof(frspace_state_t));
@@ -1779,7 +1779,7 @@ test_fs_sect_shrink(hid_t fapl)
/* section A should still be there in free-space */
if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
- (hsize_t)(TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0)
+ (hsize_t)(TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
if (!node_found) TEST_ERROR
@@ -1800,7 +1800,7 @@ test_fs_sect_shrink(hid_t fapl)
can_shrink = FALSE;
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node1,
- H5FS_ADD_RETURNED_SPACE, &can_shrink))
+ H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0)
FAIL_STACK_ERROR
/* should have nothing in free-space */
@@ -1811,7 +1811,7 @@ test_fs_sect_shrink(hid_t fapl)
/* section A should not be there in free-space */
if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
- (hsize_t)(TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0)
+ (hsize_t)(TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
if (node_found) TEST_ERROR
@@ -1866,7 +1866,7 @@ test_fs_sect_shrink(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node1,
- H5FS_ADD_RETURNED_SPACE, &can_shrink))
+ H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0)
FAIL_STACK_ERROR
HDmemset(&state, 0, sizeof(frspace_state_t));
@@ -1886,7 +1886,7 @@ test_fs_sect_shrink(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node2,
- H5FS_ADD_RETURNED_SPACE, &can_shrink))
+ H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0)
FAIL_STACK_ERROR
/* free-space should be the same since section B is shrunk */
@@ -1895,7 +1895,7 @@ test_fs_sect_shrink(hid_t fapl)
/* section B should not be there in free-space */
if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
- (hsize_t)(TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0)
+ (hsize_t)(TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
if (node_found) TEST_ERROR
@@ -1906,7 +1906,7 @@ test_fs_sect_shrink(hid_t fapl)
/* section A should still be there in free-space */
if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
- (hsize_t)(TEST_SECT_SIZE20), (H5FS_section_info_t **)&node)) < 0)
+ (hsize_t)(TEST_SECT_SIZE20), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
if (!node_found) TEST_ERROR
@@ -1965,7 +1965,7 @@ test_fs_sect_shrink(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node1,
- H5FS_ADD_RETURNED_SPACE, &can_shrink))
+ H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0)
FAIL_STACK_ERROR
HDmemset(&state, 0, sizeof(frspace_state_t));
@@ -1985,7 +1985,7 @@ test_fs_sect_shrink(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node2,
- H5FS_ADD_RETURNED_SPACE, &can_shrink))
+ H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0)
FAIL_STACK_ERROR
/* section A & B are merged and then strunk, so there is nothing in free-space */
@@ -1995,14 +1995,14 @@ test_fs_sect_shrink(hid_t fapl)
/* section B should not be there in free-space */
if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
- (hsize_t)(TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0)
+ (hsize_t)(TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
if (node_found) TEST_ERROR
/* section A should not be there in free-space */
if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
- (hsize_t)(TEST_SECT_SIZE30), (H5FS_section_info_t **)&node)) < 0)
+ (hsize_t)(TEST_SECT_SIZE30), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
if (node_found) TEST_ERROR
@@ -2100,7 +2100,7 @@ test_fs_sect_change_class(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node1,
- H5FS_ADD_RETURNED_SPACE, NULL))
+ H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
HDmemset(&state, 0, sizeof(frspace_state_t));
@@ -2120,7 +2120,7 @@ test_fs_sect_change_class(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE_NONE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node2,
- H5FS_ADD_RETURNED_SPACE, NULL))
+ H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
state.tot_space += TEST_SECT_SIZE50;
@@ -2140,7 +2140,7 @@ test_fs_sect_change_class(hid_t fapl)
TEST_ERROR
if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
- (hsize_t)TEST_SECT_SIZE30, (H5FS_section_info_t **)&node) < 0)
+ (hsize_t)TEST_SECT_SIZE30, (H5FS_section_info_t **)&node) < 0)
FAIL_STACK_ERROR
if (node->sect_info.type != TEST_FSPACE_SECT_TYPE_NONE)
@@ -2201,7 +2201,7 @@ test_fs_sect_change_class(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node1,
- H5FS_ADD_RETURNED_SPACE, NULL))
+ H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
/*
@@ -2213,7 +2213,7 @@ test_fs_sect_change_class(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE_NONE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node2,
- H5FS_ADD_RETURNED_SPACE, NULL))
+ H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
/*
@@ -2225,7 +2225,7 @@ test_fs_sect_change_class(hid_t fapl)
init_sect_node(sect_node3, (haddr_t)TEST_SECT_ADDR200, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE_NONE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node3,
- H5FS_ADD_RETURNED_SPACE, NULL))
+ H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
/* change the class of B to A's class */
@@ -2245,7 +2245,7 @@ test_fs_sect_change_class(hid_t fapl)
/* verify that section B has changed class */
if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
- (hsize_t)TEST_SECT_SIZE50, (H5FS_section_info_t **)&node) < 0)
+ (hsize_t)TEST_SECT_SIZE50, (H5FS_section_info_t **)&node) < 0)
FAIL_STACK_ERROR
if (node->sect_info.type != TEST_FSPACE_SECT_TYPE)
@@ -2256,7 +2256,7 @@ test_fs_sect_change_class(hid_t fapl)
/* verify that section C has changed class */
if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
- (hsize_t)TEST_SECT_SIZE80, (H5FS_section_info_t **)&node) < 0)
+ (hsize_t)TEST_SECT_SIZE80, (H5FS_section_info_t **)&node) < 0)
FAIL_STACK_ERROR
if (node->sect_info.type != TEST_FSPACE_SECT_TYPE)
@@ -2338,9 +2338,9 @@ test_fs_sect_extend(hid_t fapl)
size_t nclasses;
H5FS_create_t cparam; /* creation parameters */
frspace_state_t state; /* State of free space*/
-
- TEST_free_section_t *sect_node1=NULL, *sect_node2=NULL;
- unsigned init_flags=0;
+ TEST_free_section_t *sect_node1=NULL, *sect_node2=NULL;
+ unsigned init_flags=0;
+ htri_t status; /* Status of 'try' calls */
TESTING("a block's extension by requested-size which is = adjoining free section's size: Test 1");
@@ -2376,7 +2376,7 @@ test_fs_sect_extend(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node1,
- H5FS_ADD_RETURNED_SPACE, NULL))
+ H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
HDmemset(&state, 0, sizeof(frspace_state_t));
@@ -2396,7 +2396,7 @@ test_fs_sect_extend(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node2,
- H5FS_ADD_RETURNED_SPACE, NULL))
+ H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
state.tot_space += sect_node2->sect_info.size;
@@ -2407,11 +2407,13 @@ test_fs_sect_extend(hid_t fapl)
TEST_ERROR
/* Extend a block by requested-size */
- if(H5FS_sect_try_extend(f, H5P_DATASET_XFER_DEFAULT, frsp, (haddr_t)TEST_SECT_SIZE80, (hsize_t)TEST_SECT_SIZE20, (hsize_t)TEST_SECT_SIZE40) < 0)
- TEST_ERROR
+ if((status = H5FS_sect_try_extend(f, H5P_DATASET_XFER_DEFAULT, frsp, (haddr_t)TEST_SECT_SIZE80, (hsize_t)TEST_SECT_SIZE20, (hsize_t)TEST_SECT_SIZE40)) < 0)
+ FAIL_STACK_ERROR
+ if(FALSE == status)
+ TEST_ERROR
/* Succeed in extending the block: free space info is decremented accordingly */
- state.tot_space -= sect_node2->sect_info.size;
+ state.tot_space -= (hsize_t)TEST_SECT_SIZE40;
state.tot_sect_count -= 1;
state.serial_sect_count -= 1;
if(check_stats(f, frsp, &state))
@@ -2450,7 +2452,7 @@ test_fs_sect_extend(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node1,
- H5FS_ADD_RETURNED_SPACE, NULL))
+ H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
HDmemset(&state, 0, sizeof(frspace_state_t));
@@ -2470,7 +2472,7 @@ test_fs_sect_extend(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node2,
- H5FS_ADD_RETURNED_SPACE, NULL))
+ H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
state.tot_space += sect_node2->sect_info.size;
@@ -2481,8 +2483,10 @@ test_fs_sect_extend(hid_t fapl)
TEST_ERROR
/* Extend the block by requested-size */
- if(H5FS_sect_try_extend(f, H5P_DATASET_XFER_DEFAULT, frsp, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, (hsize_t)TEST_SECT_SIZE50) < 0)
- TEST_ERROR
+ if((status = H5FS_sect_try_extend(f, H5P_DATASET_XFER_DEFAULT, frsp, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, (hsize_t)TEST_SECT_SIZE50)) < 0)
+ FAIL_STACK_ERROR
+ if(TRUE == status)
+ TEST_ERROR
/* Not able to extend the block: free space info remains the same */
if(check_stats(f, frsp, &state))
@@ -2521,7 +2525,7 @@ test_fs_sect_extend(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node1,
- H5FS_ADD_RETURNED_SPACE, NULL))
+ H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
HDmemset(&state, 0, sizeof(frspace_state_t));
@@ -2541,7 +2545,7 @@ test_fs_sect_extend(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node2,
- H5FS_ADD_RETURNED_SPACE, NULL))
+ H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
state.tot_space += sect_node2->sect_info.size;
@@ -2552,8 +2556,10 @@ test_fs_sect_extend(hid_t fapl)
TEST_ERROR
/* Extend the block by requested-size */
- if(H5FS_sect_try_extend(f, H5P_DATASET_XFER_DEFAULT, frsp, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, (hsize_t)TEST_SECT_SIZE30) < 0)
+ if((status = H5FS_sect_try_extend(f, H5P_DATASET_XFER_DEFAULT, frsp, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, (hsize_t)TEST_SECT_SIZE30)) < 0)
TEST_ERROR
+ if(FALSE == status)
+ TEST_ERROR
/* Succeed in extending the block: total free space is decreased but other info remains the same */
state.tot_space -= 30;
@@ -2593,7 +2599,7 @@ test_fs_sect_extend(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node1,
- H5FS_ADD_RETURNED_SPACE, NULL))
+ H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
HDmemset(&state, 0, sizeof(frspace_state_t));
@@ -2613,7 +2619,7 @@ test_fs_sect_extend(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node2,
- H5FS_ADD_RETURNED_SPACE, NULL))
+ H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
state.tot_space += sect_node2->sect_info.size;
@@ -2624,8 +2630,10 @@ test_fs_sect_extend(hid_t fapl)
TEST_ERROR
/* Extend the block by requested-size */
- if(H5FS_sect_try_extend(f, H5P_DATASET_XFER_DEFAULT, frsp, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE15, (hsize_t)TEST_SECT_SIZE40) < 0)
+ if((status = H5FS_sect_try_extend(f, H5P_DATASET_XFER_DEFAULT, frsp, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE15, (hsize_t)TEST_SECT_SIZE40)) < 0)
TEST_ERROR
+ if(TRUE == status)
+ TEST_ERROR
/* Not able to extend the block: free space manager info remains the same */
if(check_stats(f, frsp, &state))
@@ -2718,7 +2726,7 @@ test_fs_sect_iterate(hid_t fapl)
init_sect_node(sect_node, (haddr_t)i*10, (hsize_t)sect_size, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node,
- H5FS_ADD_RETURNED_SPACE, NULL))
+ H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
}
diff --git a/test/links.c b/test/links.c
index fe9976a..7c32238 100644
--- a/test/links.c
+++ b/test/links.c
@@ -4452,7 +4452,7 @@ external_link_win1(hid_t fapl, hbool_t new_format)
H5Fclose (fid);
} H5E_END_TRY;
return -1;
-} /* end external_link_win2() */
+} /* end external_link_win1() */
/*-------------------------------------------------------------------------
@@ -4919,6 +4919,272 @@ external_link_win6(hid_t fapl, hbool_t new_format)
return -1;
} /* end external_link_win6() */
+
+/*-------------------------------------------------------------------------
+ * Function: external_link_win7
+ *
+ * Purpose:
+ * 1. UNC target link: "\\127.0.01\c$/tmp/extlinks10"
+ * 2. main file: "extlinks0"
+ * 3. target file: "extlinks15"
+ * Should be able to find the target file via main file's local host/main drive/rel path
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *-------------------------------------------------------------------------
+ */
+static int
+external_link_win7(hid_t fapl, hbool_t new_format)
+{
+ hid_t fid = (-1); /* File ID */
+ hid_t gid = (-1); /* Group IDs */
+ char filename1[NAME_BUF_SIZE],
+ filename2[NAME_BUF_SIZE],
+ filename3[NAME_BUF_SIZE],
+ tmpname[NAME_BUF_SIZE],
+ cwdpath[NAME_BUF_SIZE];
+
+ if(new_format)
+ TESTING("external links via main file's UNC local host/main drive/rel path(windows)(w/new group format)")
+ else
+ TESTING("external links via main file's UNC local host/main drive/rel path(windows)")
+
+ /* set up name for main file: "extlinks0" */
+ h5_fixname(FILENAME[12], fapl, filename1, sizeof filename1);
+
+ if (HDgetcwd(cwdpath, NAME_BUF_SIZE)==NULL)
+ TEST_ERROR
+
+ /* set up name for target link: "\\127.0.0.1\c$/tmp/extlinks10" */
+ HDstrcpy(tmpname, "\\\\127.0.0.1\\c$"); /* absolute path */
+ HDstrcat(tmpname, "/");
+ HDstrcat(tmpname, FILENAME[30]);
+ h5_fixname(tmpname, fapl, filename2, sizeof filename2);
+
+ /* set up name for target file: "extlinks15" */
+ h5_fixname(FILENAME[29], fapl, filename3, sizeof filename3);
+
+ /* Create the target file */
+ if((fid=H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ if((gid=H5Gcreate2(fid, "A", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* closing for target file */
+ if(H5Gclose(gid) < 0) TEST_ERROR
+ if(H5Fclose(fid) < 0) TEST_ERROR
+
+
+ /* Create the main file */
+ if((fid=H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+
+ /* Create external link to target file */
+ if(H5Lcreate_external(filename2, "/A", fid, "ext_link", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Open object through external link */
+ H5E_BEGIN_TRY {
+ gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT);
+ } H5E_END_TRY;
+
+ /* should be able to find the target file via main file's local host/main drive*/
+ if (gid < 0) {
+ H5_FAILED();
+ puts(" Should have found the file in local host/main drive.");
+ goto error;
+ }
+
+ /* closing for main file */
+ if(H5Gclose(gid) < 0) TEST_ERROR
+ if(H5Fclose(fid) < 0) TEST_ERROR
+
+ PASSED();
+ return 0;
+
+ error:
+ H5E_BEGIN_TRY {
+ H5Gclose (gid);
+ H5Fclose (fid);
+ } H5E_END_TRY;
+ return -1;
+} /* end external_link_win7() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: external_link_win8
+ *
+ * Purpose:
+ * 1. Long UNC target link: "\\?\<cur drive>:\CWD\extlinks10"
+ * 2. main file: "extlinks0"
+ * 3. target file: "extlinks10"
+ * Should be able to access the target file directly (abs drive/abs path)
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+external_link_win8(hid_t fapl, hbool_t new_format)
+{
+ hid_t fid = (-1); /* File ID */
+ hid_t gid = (-1); /* Group IDs */
+ int drive=0;
+ char filename1[NAME_BUF_SIZE],
+ filename2[NAME_BUF_SIZE],
+ filename3[NAME_BUF_SIZE],
+ tmpname[NAME_BUF_SIZE],
+ cwdpath[NAME_BUF_SIZE];
+
+ if(new_format)
+ TESTING("external links via target's Long UNC abs drive/abs path directly (windows)(w/new group format)")
+ else
+ TESTING("external links via target's Long UNC abs drive/abs path directly (windows)")
+
+ /* set up name for main file: "extlinks0" */
+ h5_fixname(FILENAME[12], fapl, filename1, sizeof filename1);
+
+ if (HDgetcwd(cwdpath, NAME_BUF_SIZE)==NULL)
+ TEST_ERROR
+
+ /* create tmp directory */
+ if (HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST)
+ TEST_ERROR
+
+ /* set up name for target link: "<drive-letter>:\CWD\extlinks10" */
+ drive = HDgetdrive();
+ sprintf(tmpname, "\\\\?\\%c:%s\\%s", (drive+'A'-1), &cwdpath[2], FILENAME[30]);
+ h5_fixname(tmpname, fapl, filename2, sizeof filename2);
+
+ /* set up name for target file: "extlinks10" */
+ h5_fixname(FILENAME[30], fapl, filename3, sizeof filename3);
+
+ /* Create the target file */
+ if((fid=H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ if((gid=H5Gcreate2(fid, "A", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* closing for target file */
+ if(H5Gclose(gid) < 0) TEST_ERROR
+ if(H5Fclose(fid) < 0) TEST_ERROR
+
+
+ /* Create the main file */
+ if((fid=H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+
+ /* Create external link to target file */
+ if(H5Lcreate_external(filename2, "/A", fid, "ext_link", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Open object through external link */
+ H5E_BEGIN_TRY {
+ gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT);
+ } H5E_END_TRY;
+
+ /* should be able to find the target file directly */
+ if (gid < 0) {
+ H5_FAILED();
+ puts(" Should have found the file in tmp.");
+ goto error;
+ }
+
+ /* closing for main file */
+ if(H5Gclose(gid) < 0) TEST_ERROR
+ if(H5Fclose(fid) < 0) TEST_ERROR
+
+ PASSED();
+ return 0;
+
+ error:
+ H5E_BEGIN_TRY {
+ H5Gclose (gid);
+ H5Fclose (fid);
+ } H5E_END_TRY;
+ return -1;
+} /* end external_link_win8() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: external_link_win9
+ *
+ * Purpose:
+ * 1. Long UNC target link: "\\?\UNC\127.0.01\c$/tmp/extlinks10"
+ * 2. main file: "extlinks0"
+ * 3. target file: "extlinks15"
+ * Should be able to find the target file via main file's local host/main drive/rel path
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *-------------------------------------------------------------------------
+ */
+static int
+external_link_win9(hid_t fapl, hbool_t new_format)
+{
+ hid_t fid = (-1); /* File ID */
+ hid_t gid = (-1); /* Group IDs */
+ char filename1[NAME_BUF_SIZE],
+ filename2[NAME_BUF_SIZE],
+ filename3[NAME_BUF_SIZE],
+ tmpname[NAME_BUF_SIZE],
+ cwdpath[NAME_BUF_SIZE];
+
+ if(new_format)
+ TESTING("external links via main file's Long UNC local host/main drive/rel path(windows)(w/new group format)")
+ else
+ TESTING("external links via main file's Long UNC local host/main drive/rel path(windows)")
+
+ /* set up name for main file: "extlinks0" */
+ h5_fixname(FILENAME[12], fapl, filename1, sizeof filename1);
+
+ if (HDgetcwd(cwdpath, NAME_BUF_SIZE)==NULL)
+ TEST_ERROR
+
+ /* set up name for target link: "\\?\UNC\127.0.0.1\c$/tmp/extlinks10" */
+ HDstrcpy(tmpname, "\\\\?\\UNC\127.0.0.1\\c$"); /* absolute path */
+ HDstrcat(tmpname, "/");
+ HDstrcat(tmpname, FILENAME[30]);
+ h5_fixname(tmpname, fapl, filename2, sizeof filename2);
+
+ /* set up name for target file: "extlinks15" */
+ h5_fixname(FILENAME[29], fapl, filename3, sizeof filename3);
+
+ /* Create the target file */
+ if((fid=H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ if((gid=H5Gcreate2(fid, "A", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* closing for target file */
+ if(H5Gclose(gid) < 0) TEST_ERROR
+ if(H5Fclose(fid) < 0) TEST_ERROR
+
+
+ /* Create the main file */
+ if((fid=H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+
+ /* Create external link to target file */
+ if(H5Lcreate_external(filename2, "/A", fid, "ext_link", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Open object through external link */
+ H5E_BEGIN_TRY {
+ gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT);
+ } H5E_END_TRY;
+
+ /* should be able to find the target file via main file's local host/main drive*/
+ if (gid < 0) {
+ H5_FAILED();
+ puts(" Should have found the file in local host/main drive.");
+ goto error;
+ }
+
+ /* closing for main file */
+ if(H5Gclose(gid) < 0) TEST_ERROR
+ if(H5Fclose(fid) < 0) TEST_ERROR
+
+ PASSED();
+ return 0;
+
+ error:
+ H5E_BEGIN_TRY {
+ H5Gclose (gid);
+ H5Fclose (fid);
+ } H5E_END_TRY;
+ return -1;
+} /* end external_link_win9() */
+
#endif /* H5_HAVE_WINDOW_PATH */
@@ -12767,6 +13033,9 @@ main(void)
nerrors += external_link_win4(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_win5(my_fapl, new_format) < 0 ? 1 : 0;
nerrors += external_link_win6(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += external_link_win7(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += external_link_win8(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += external_link_win9(my_fapl, new_format) < 0 ? 1 : 0;
#endif
/* These tests assume that external links are a form of UD links,
* so assume that everything that passed for external links
diff --git a/test/mf.c b/test/mf.c
index c405694..3c88501 100644
--- a/test/mf.c
+++ b/test/mf.c
@@ -146,7 +146,6 @@ error:
return(1);
} /* check_stats() */
-
/*
* To verify that blocks are allocated from file allocation
*
diff --git a/test/ohdr.c b/test/ohdr.c
index 905551d..df5f63b 100644
--- a/test/ohdr.c
+++ b/test/ohdr.c
@@ -60,8 +60,8 @@ test_cont(char *filename, hid_t fapl)
H5O_info_t oinfo;
H5O_loc_t oh_locA, oh_locB;
time_t time_new;
- char *short_name = "T";
- char *long_name = "This is the message";
+ const char *short_name = "T";
+ const char *long_name = "This is the message";
size_t nchunks;
TESTING("object header continuation block");
@@ -100,7 +100,9 @@ test_cont(char *filename, hid_t fapl)
if(H5O_msg_create(&oh_locA, H5O_NAME_ID, 0, 0, &short_name, H5P_DATASET_XFER_DEFAULT) < 0)
FAIL_STACK_ERROR
- if(H5AC_flush(f, H5P_DATASET_XFER_DEFAULT, TRUE) < 0)
+ if(H5AC_flush(f, H5P_DATASET_XFER_DEFAULT) < 0)
+ FAIL_STACK_ERROR
+ if(H5AC_expunge_entry(f, H5P_DATASET_XFER_DEFAULT, H5AC_OHDR, oh_locA.addr, H5AC__NO_FLAGS_SET) < 0)
FAIL_STACK_ERROR
if(H5O_get_info(&oh_locA, H5P_DATASET_XFER_DEFAULT, FALSE, &oinfo) < 0)
@@ -210,7 +212,9 @@ main(void)
time_new = 11111111;
if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT) < 0)
FAIL_STACK_ERROR
- if(H5AC_flush(f, H5P_DATASET_XFER_DEFAULT, TRUE) < 0)
+ if(H5AC_flush(f, H5P_DATASET_XFER_DEFAULT) < 0)
+ FAIL_STACK_ERROR
+ if(H5AC_expunge_entry(f, H5P_DATASET_XFER_DEFAULT, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0)
FAIL_STACK_ERROR
if(NULL == H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro, H5P_DATASET_XFER_DEFAULT))
FAIL_STACK_ERROR
@@ -226,7 +230,9 @@ main(void)
time_new = 33333333;
if(H5O_msg_write(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT) < 0)
FAIL_STACK_ERROR
- if(H5AC_flush(f, H5P_DATASET_XFER_DEFAULT, TRUE) < 0)
+ if(H5AC_flush(f, H5P_DATASET_XFER_DEFAULT) < 0)
+ FAIL_STACK_ERROR
+ if(H5AC_expunge_entry(f, H5P_DATASET_XFER_DEFAULT, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0)
FAIL_STACK_ERROR
if(NULL == H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro, H5P_DATASET_XFER_DEFAULT))
FAIL_STACK_ERROR
@@ -255,7 +261,9 @@ main(void)
if(H5O_msg_create(&oh_loc, H5O_MTIME_ID, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT) < 0)
FAIL_STACK_ERROR
} /* end for */
- if(H5AC_flush(f, H5P_DATASET_XFER_DEFAULT, TRUE) < 0)
+ if(H5AC_flush(f, H5P_DATASET_XFER_DEFAULT) < 0)
+ FAIL_STACK_ERROR
+ if(H5AC_expunge_entry(f, H5P_DATASET_XFER_DEFAULT, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0)
FAIL_STACK_ERROR
/* Make certain that chunk #0 in the object header will be encoded with a 2-byte size */
@@ -294,7 +302,9 @@ main(void)
time_new = (i + 1) * 1000 + 10;
if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT) < 0)
FAIL_STACK_ERROR
- if(H5AC_flush(f, H5P_DATASET_XFER_DEFAULT, TRUE) < 0)
+ if(H5AC_flush(f, H5P_DATASET_XFER_DEFAULT) < 0)
+ FAIL_STACK_ERROR
+ if(H5AC_expunge_entry(f, H5P_DATASET_XFER_DEFAULT, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0)
FAIL_STACK_ERROR
} /* end for */
PASSED();
@@ -322,7 +332,9 @@ main(void)
time_new = 22222222;
if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, H5O_MSG_FLAG_CONSTANT, 0, &time_new, H5P_DATASET_XFER_DEFAULT) < 0)
FAIL_STACK_ERROR
- if(H5AC_flush(f, H5P_DATASET_XFER_DEFAULT, TRUE) < 0)
+ if(H5AC_flush(f, H5P_DATASET_XFER_DEFAULT) < 0)
+ FAIL_STACK_ERROR
+ if(H5AC_expunge_entry(f, H5P_DATASET_XFER_DEFAULT, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0)
FAIL_STACK_ERROR
if(NULL == H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro, H5P_DATASET_XFER_DEFAULT))
FAIL_STACK_ERROR
diff --git a/test/tsohm.c b/test/tsohm.c
index 348677d..b5b489b 100644
--- a/test/tsohm.c
+++ b/test/tsohm.c
@@ -544,8 +544,12 @@ error:
static hid_t
close_reopen_file(hid_t file, const char* filename, hid_t fapl_id)
{
- if(H5Fclose(file) < 0) goto error;
- return H5Fopen(filename, H5F_ACC_RDWR, fapl_id);
+ hid_t fid;
+
+ if(H5Fclose(file) < 0) FAIL_STACK_ERROR
+ if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl_id)) < 0) FAIL_STACK_ERROR
+
+ return(fid);
error:
return -1;
@@ -598,19 +602,19 @@ size1_helper(hid_t file, const char* filename, hid_t fapl_id, int test_file_clos
dim1[0] = 1;
if((space_id=H5Screate_simple(1,dim1,NULL)) < 0) TEST_ERROR
- if((dset_id = H5Dcreate2(file,DSETNAME[0],dtype1_id,space_id,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((dset_id = H5Dcreate2(file,DSETNAME[0],dtype1_id,space_id,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Test writing and reading */
- if(H5Dwrite(dset_id,dtype1_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,&wdata) < 0) TEST_ERROR
+ if(H5Dwrite(dset_id,dtype1_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,&wdata) < 0) FAIL_STACK_ERROR
- if(H5Dread(dset_id,dtype1_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,&rdata) < 0) TEST_ERROR
+ if(H5Dread(dset_id,dtype1_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,&rdata) < 0) FAIL_STACK_ERROR
if(rdata.i1!=wdata.i1 || rdata.i2!=wdata.i2 || HDstrcmp(rdata.str, wdata.str)) {
H5_FAILED(); AT();
printf("incorrect read data\n");
goto error;
} /* end if */
- if(H5Dclose(dset_id) < 0) TEST_ERROR
+ if(H5Dclose(dset_id) < 0) FAIL_STACK_ERROR
/* Close and re-open the file if requested*/
if(test_file_closing) {
@@ -618,8 +622,8 @@ size1_helper(hid_t file, const char* filename, hid_t fapl_id, int test_file_clos
}
/* Create more datasets with the same datatype */
- if((dset_id = H5Dcreate2(file,DSETNAME[1],dtype1_id,space_id,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Dclose(dset_id) < 0) TEST_ERROR
+ if((dset_id = H5Dcreate2(file,DSETNAME[1],dtype1_id,space_id,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if(H5Dclose(dset_id) < 0) FAIL_STACK_ERROR
/* Close and re-open the file if requested*/
if(test_file_closing) {