summaryrefslogtreecommitdiffstats
path: root/test/mount.c
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-07-28 14:08:44 (GMT)
committerGitHub <noreply@github.com>2023-07-28 14:08:44 (GMT)
commit9ef2f993cfc7173712729fb40b34d1edae8509d9 (patch)
tree937a98f4d50cf0cca08fa105ae37589aedb8975c /test/mount.c
parentf563c2b926445f7a975553bc7742a38f42d3b6f4 (diff)
downloadhdf5-9ef2f993cfc7173712729fb40b34d1edae8509d9.zip
hdf5-9ef2f993cfc7173712729fb40b34d1edae8509d9.tar.gz
hdf5-9ef2f993cfc7173712729fb40b34d1edae8509d9.tar.bz2
Sync test dir w/ develop (#3303)
Diffstat (limited to 'test/mount.c')
-rw-r--r--test/mount.c125
1 files changed, 63 insertions, 62 deletions
diff --git a/test/mount.c b/test/mount.c
index 2e012b5..e418b25 100644
--- a/test/mount.c
+++ b/test/mount.c
@@ -17,14 +17,15 @@
#include "H5Fprivate.h" /* File access */
#include "H5Iprivate.h" /* IDs */
-const char *FILENAME[] = {"mount_1", "mount_2", "mount_3", "mount_4", "mount_5", "mount_6", "mount_7", NULL};
+static const char *FILENAME[] = {"mount_1", "mount_2", "mount_3", "mount_4",
+ "mount_5", "mount_6", "mount_7", NULL};
/* For "mount_after_close" test */
#define RANK 2
#define NX 4
#define NY 5
#define NAME_BUF_SIZE 40
-int bm[NX][NY], bm_out[NX][NY]; /* Data buffers */
+static int bm[NX][NY]; /* Data buffers */
/*-------------------------------------------------------------------------
* Function: setup
@@ -91,7 +92,7 @@ error:
{
H5Fclose(file);
}
- H5E_END_TRY;
+ H5E_END_TRY
return -1;
} /* end setup() */
@@ -142,7 +143,7 @@ error:
H5Fclose(file1);
H5Fclose(file2);
}
- H5E_END_TRY;
+ H5E_END_TRY
return 1;
} /* end test_basic() */
@@ -185,7 +186,7 @@ test_illegal(hid_t fapl)
{
status = H5Fmount(file1, "/mnt1", file1, H5P_DEFAULT);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (status >= 0) {
H5_FAILED();
HDputs(" Mounting a file on itself should have failed.");
@@ -205,7 +206,7 @@ test_illegal(hid_t fapl)
{
status = H5Fmount(mnt, ".", file3, H5P_DEFAULT);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (status >= 0) {
H5_FAILED();
HDputs(" Mounting two files at one mount point should have failed.");
@@ -230,7 +231,7 @@ test_illegal(hid_t fapl)
{
status = H5Fmount(mnt, ".", file3b, H5P_DEFAULT);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (status >= 0) {
H5_FAILED();
HDputs(" Mounting same file opened twice at one mount point should have failed.");
@@ -248,7 +249,7 @@ test_illegal(hid_t fapl)
{
status = H5Fmount(file2, "/mnt1/file2", file1b, H5P_DEFAULT);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (status >= 0) {
H5_FAILED();
HDputs(" Creating a cycle with mount points should have failed.");
@@ -282,7 +283,7 @@ error:
H5Fclose(file3);
H5Fclose(file3b);
}
- H5E_END_TRY;
+ H5E_END_TRY
return 1;
} /* end test_illegal() */
@@ -350,7 +351,7 @@ test_samefile(hid_t fapl)
{
status = H5Fmount(mnt1b, ".", file3, H5P_DEFAULT);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (status >= 0)
FAIL_PUTS_ERROR(" Mounting different files at one mount point should have failed.");
if (H5Funmount(mnt1a, ".") < 0)
@@ -389,7 +390,7 @@ test_samefile(hid_t fapl)
{
status = H5Fmount(mnt1b, ".", file2, H5P_DEFAULT);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (status >= 0)
FAIL_PUTS_ERROR(" Mounting same files at one mount point should have failed.");
if (H5Funmount(mnt1a, ".") < 0)
@@ -422,7 +423,7 @@ error:
H5Fclose(file2);
H5Fclose(file3);
}
- H5E_END_TRY;
+ H5E_END_TRY
return 1;
} /* end test_samefile() */
@@ -468,7 +469,7 @@ test_hide(hid_t fapl)
{
grp = H5Gopen2(file1, "/mnt1/file1", H5P_DEFAULT);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (grp >= 0) {
H5_FAILED();
HDputs(" Name is still accessible under mount point.");
@@ -518,7 +519,7 @@ error:
H5Fclose(file1);
H5Fclose(file2);
}
- H5E_END_TRY;
+ H5E_END_TRY
return 1;
} /* end test_hide() */
@@ -601,7 +602,7 @@ error:
H5Fclose(file2);
H5Fclose(file1);
}
- H5E_END_TRY;
+ H5E_END_TRY
return 1;
} /* end test_assoc() */
@@ -666,7 +667,7 @@ error:
H5Fclose(file1);
H5Fclose(file2);
}
- H5E_END_TRY;
+ H5E_END_TRY
return 1;
} /* end test_mntlnk() */
@@ -708,7 +709,7 @@ test_move(hid_t fapl)
{
status = H5Lmove(file1, "/mnt1/rename_b/y", H5L_SAME_LOC, "/y", H5P_DEFAULT, H5P_DEFAULT);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (status >= 0) {
H5_FAILED();
HDputs(" Moving an object across files shouldn't have been possible");
@@ -732,7 +733,7 @@ error:
H5Fclose(file1);
H5Fclose(file2);
}
- H5E_END_TRY;
+ H5E_END_TRY
return 1;
} /* end test_move() */
@@ -795,7 +796,7 @@ error:
H5Fclose(file2);
H5Fclose(file1);
}
- H5E_END_TRY;
+ H5E_END_TRY
return 1;
} /* end test_preopen() */
@@ -865,7 +866,7 @@ error:
H5Fclose(file2);
H5Fclose(file1);
}
- H5E_END_TRY;
+ H5E_END_TRY
return 1;
} /* end test_postopen() */
@@ -929,7 +930,7 @@ test_unlink(hid_t fapl)
{
status = H5Oget_info_by_name3(mnt, "file2", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (status >= 0) {
H5_FAILED();
HDputs(" Incorrect traversal from mount point!");
@@ -950,7 +951,7 @@ test_unlink(hid_t fapl)
{
status = H5Oget_info_by_name3(mnt, "file2", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (status >= 0) {
H5_FAILED();
HDputs(" Traversal through mount point should not have worked!");
@@ -960,7 +961,7 @@ test_unlink(hid_t fapl)
{
status = H5Oget_info_by_name3(file2, "/mnt_unlink/file2", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (status >= 0) {
H5_FAILED();
HDputs(" Traversal through mount point should not have worked!");
@@ -976,7 +977,7 @@ test_unlink(hid_t fapl)
{
status = H5Funmount(file1, "/mnt_unlink");
}
- H5E_END_TRY;
+ H5E_END_TRY
if (status >= 0) {
H5_FAILED();
printf(" %d: Unmount by name should not have been allowed!\n", __LINE__);
@@ -986,7 +987,7 @@ test_unlink(hid_t fapl)
{
status = H5Funmount(file2, "/");
}
- H5E_END_TRY;
+ H5E_END_TRY
if (status >= 0) {
H5_FAILED();
printf(" %d: Unmount by name should not have been allowed!\n", __LINE__);
@@ -1016,7 +1017,7 @@ error:
H5Fclose(file2);
H5Fclose(file1);
}
- H5E_END_TRY;
+ H5E_END_TRY
return 1;
} /* end test_unlink() */
@@ -1074,7 +1075,7 @@ error:
H5Fclose(file1);
H5Fclose(file2);
}
- H5E_END_TRY;
+ H5E_END_TRY
return 1;
} /* end test_mvmpt() */
@@ -1116,7 +1117,7 @@ test_interlink(hid_t fapl)
{
status = H5Lcreate_hard(file1, "/mnt1/file2", H5L_SAME_LOC, "/file2", H5P_DEFAULT, H5P_DEFAULT);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (status >= 0) {
H5_FAILED();
HDputs(" Interfile hard link should not have been allowed!");
@@ -1128,7 +1129,7 @@ test_interlink(hid_t fapl)
{
status = H5Lmove(file1, "/mnt1/file2", H5L_SAME_LOC, "/file2", H5P_DEFAULT, H5P_DEFAULT);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (status >= 0) {
H5_FAILED();
HDputs(" Interfile renaming should not have been allowed!");
@@ -1151,7 +1152,7 @@ test_interlink(hid_t fapl)
{
dset = H5Dcreate2(file1, "/mnt1/file2/dset", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (dset >= 0) {
H5_FAILED();
HDputs(" Dataset and shared type must be in the same file!");
@@ -1190,7 +1191,7 @@ error:
H5Fclose(file1);
H5Fclose(file2);
}
- H5E_END_TRY;
+ H5E_END_TRY
return 1;
} /* end test_interlink() */
@@ -1265,7 +1266,7 @@ error:
H5Fclose(file1);
H5Fclose(file2);
}
- H5E_END_TRY;
+ H5E_END_TRY
return 1;
} /* end test_uniformity() */
@@ -1349,7 +1350,7 @@ error:
H5Fclose(file1);
H5Fclose(file2);
}
- H5E_END_TRY;
+ H5E_END_TRY
return 1;
} /* end test_close() */
@@ -1579,7 +1580,7 @@ error:
H5Fclose(fid1);
H5Fclose(fid2);
}
- H5E_END_TRY;
+ H5E_END_TRY
return 1;
} /* end test_mount_after_close() */
@@ -1843,7 +1844,7 @@ error:
H5Fclose(fid2);
H5Fclose(fid1);
}
- H5E_END_TRY;
+ H5E_END_TRY
return 1;
}
@@ -1990,7 +1991,7 @@ error:
H5Fclose(fid2);
H5Fclose(fid1);
}
- H5E_END_TRY;
+ H5E_END_TRY
return 1;
} /* end test_missing_unmount() */
@@ -2115,7 +2116,7 @@ error:
H5Fclose(fid2);
H5Fclose(fid1);
}
- H5E_END_TRY;
+ H5E_END_TRY
return 1;
} /* end test_hold_open_file() */
@@ -2266,7 +2267,7 @@ error:
H5Fclose(fid2);
H5Fclose(fid1);
}
- H5E_END_TRY;
+ H5E_END_TRY
return 1;
} /* end test_hold_open_group() */
@@ -2345,7 +2346,7 @@ test_fcdegree_same(hid_t fapl)
{
ret = H5Fmount(gidA, ".", fid2, H5P_DEFAULT);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (ret >= 0)
TEST_ERROR;
@@ -2405,7 +2406,7 @@ error:
H5Fclose(fid2);
H5Fclose(fid1);
}
- H5E_END_TRY;
+ H5E_END_TRY
return 1;
} /* end test_fcdegree_same() */
@@ -2496,7 +2497,7 @@ test_fcdegree_semi(hid_t fapl)
{
ret = H5Fclose(fid2);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (ret >= 0)
TEST_ERROR;
@@ -2509,7 +2510,7 @@ test_fcdegree_semi(hid_t fapl)
{
ret = H5Fclose(fid2);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (ret >= 0)
TEST_ERROR;
@@ -2543,7 +2544,7 @@ error:
H5Fclose(fid2);
H5Fclose(fid1);
}
- H5E_END_TRY;
+ H5E_END_TRY
return 1;
} /* end test_fcdegree_semi() */
@@ -2645,14 +2646,14 @@ test_fcdegree_strong(hid_t fapl)
{
ret = H5Oget_info3(gidA, &oinfo, H5O_INFO_BASIC);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (ret >= 0)
TEST_ERROR;
H5E_BEGIN_TRY
{
ret = H5Oget_info3(gidAM, &oinfo, H5O_INFO_BASIC);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (ret >= 0)
TEST_ERROR;
@@ -2678,7 +2679,7 @@ error:
H5Fclose(fid2);
H5Fclose(fid1);
}
- H5E_END_TRY;
+ H5E_END_TRY
return 1;
} /* end test_fcdegree_strong() */
@@ -2784,14 +2785,14 @@ test_acc_perm(hid_t fapl)
{
bad_id = H5Gcreate2(gidAM, "Z", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (bad_id >= 0)
TEST_ERROR;
H5E_BEGIN_TRY
{
bad_id = H5Gcreate2(fid1, "/A/L", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (bad_id >= 0)
TEST_ERROR;
@@ -2834,7 +2835,7 @@ test_acc_perm(hid_t fapl)
{
bad_id = H5Gcreate2(fid1, "/A/L", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (bad_id >= 0)
TEST_ERROR;
@@ -2879,7 +2880,7 @@ error:
H5Fclose(fid2);
H5Fclose(fid1);
}
- H5E_END_TRY;
+ H5E_END_TRY
return 1;
} /* end test_acc_perm() */
@@ -3097,7 +3098,7 @@ error:
H5Fclose(fid2);
H5Fclose(fid1);
}
- H5E_END_TRY;
+ H5E_END_TRY
return 1;
} /* end test_mult_mount() */
@@ -3226,7 +3227,7 @@ test_nested_survive(hid_t fapl)
{
gidAMS = H5Gopen2(fid1, "A/M/S", H5P_DEFAULT);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (gidAMS >= 0)
TEST_ERROR;
@@ -3305,7 +3306,7 @@ error:
H5Fclose(fid2);
H5Fclose(fid1);
}
- H5E_END_TRY;
+ H5E_END_TRY
return 1;
} /* end test_nested_survive() */
@@ -3436,7 +3437,7 @@ error:
H5Fclose(fid2);
H5Fclose(fid1);
}
- H5E_END_TRY;
+ H5E_END_TRY
return 1;
} /* end test_close_parent() */
@@ -3733,7 +3734,7 @@ test_cut_graph(hid_t fapl)
{
gidK = H5Gopen2(gidQ, "/A/D/K", H5P_DEFAULT);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (gidK >= 0)
TEST_ERROR;
@@ -3756,7 +3757,7 @@ test_cut_graph(hid_t fapl)
{
gidO = H5Gopen2(gidM, "/B/H/O", H5P_DEFAULT);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (gidO >= 0)
TEST_ERROR;
@@ -3858,7 +3859,7 @@ error:
H5Fclose(fid2);
H5Fclose(fid1);
}
- H5E_END_TRY;
+ H5E_END_TRY
return 1;
} /* end test_cut_graph() */
@@ -3965,7 +3966,7 @@ test_symlink(hid_t fapl)
{
gidL = H5Gopen2(fid1, "L", H5P_DEFAULT);
}
- H5E_END_TRY;
+ H5E_END_TRY
if (gidL >= 0)
TEST_ERROR;
@@ -4019,7 +4020,7 @@ error:
H5Fclose(fid2);
H5Fclose(fid1);
}
- H5E_END_TRY;
+ H5E_END_TRY
return 1;
} /* end test_symlink() */
@@ -4119,7 +4120,7 @@ error:
H5Fclose(fid2[i]);
}
}
- H5E_END_TRY;
+ H5E_END_TRY
return 1;
} /* end test_sharedacc() */
@@ -4273,7 +4274,7 @@ error:
H5Fclose(fid2);
H5Fclose(fid3);
}
- H5E_END_TRY;
+ H5E_END_TRY
return 1;
} /* end test_sharedclose() */
@@ -4423,7 +4424,7 @@ error:
H5Fclose(fid2);
H5Fclose(fid2);
}
- H5E_END_TRY;
+ H5E_END_TRY
return 1;
} /* end test_multisharedclose() */