summaryrefslogtreecommitdiffstats
path: root/test/external.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2008-10-15 01:46:34 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2008-10-15 01:46:34 (GMT)
commit0e51a4244e8de0402fe9d329d6ad3cc1e9d20418 (patch)
tree12fe8ea3e734869c51d57efd98fa7c986a3dcb71 /test/external.c
parentbea2e1790d2a708f9f0c794254f9e869f77f0f88 (diff)
downloadhdf5-0e51a4244e8de0402fe9d329d6ad3cc1e9d20418.zip
hdf5-0e51a4244e8de0402fe9d329d6ad3cc1e9d20418.tar.gz
hdf5-0e51a4244e8de0402fe9d329d6ad3cc1e9d20418.tar.bz2
[svn-r15868] Description:
Correct a minor error in file free space allocation which was affecting the 'multi' VFD and preventing some tests from fully working with it. Wholesale revisitation of all the places where tests were disabled with various VFDs and remove or correct all these so that _only_ the tests which _really_ can't work with particular VFDs are skipped during a 'make check-vfd' test. Tested on: Mac OS X/32 10.5.5 (amazon) in debug mode Mac OS X/32 10.5.5 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (kagiso) 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 production mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Diffstat (limited to 'test/external.c')
-rw-r--r--test/external.c180
1 files changed, 86 insertions, 94 deletions
diff --git a/test/external.c b/test/external.c
index 8524e72..2f3cdf6 100644
--- a/test/external.c
+++ b/test/external.c
@@ -842,65 +842,67 @@ test_4 (hid_t fapl)
char filename[1024]; /*file name */
char pathname[1024];
char *srcdir = getenv("srcdir"); /*where the src code is located*/
- const char *envval = NULL;
TESTING("opening external link twice");
- /* Don't run this test using the multi file driver */
- envval = HDgetenv("HDF5_DRIVER");
- if (envval == NULL)
- envval = "nomatch";
- if (HDstrcmp(envval, "multi") && HDstrcmp(envval, "family")) {
- h5_fixname(FILENAME[3], fapl, filename, sizeof filename);
+ /* Make a copy of the FAPL, in order to switch to the sec2 driver */
+ /* (useful when running test with another VFD) */
+ if((fapl = H5Pcopy(fapl)) < 0) FAIL_STACK_ERROR;
- if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- goto error;
+ /* Switch local copy of the fapl to the sec2 driver */
+ if(H5Pset_fapl_sec2(fapl) < 0) FAIL_STACK_ERROR;
- if((gid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0)
- goto error;
+ h5_fixname(FILENAME[3], fapl, filename, sizeof filename);
- pathname[0] = '\0';
- /* Generate correct name for test file by prepending the source path */
- if(srcdir && ((HDstrlen(srcdir) + HDstrlen(LINKED_FILE) + 1) < sizeof(pathname))) {
- HDstrcpy(pathname, srcdir);
- HDstrcat(pathname, "/");
- }
- HDstrcat(pathname, LINKED_FILE);
+ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ goto error;
- /* Create an external link to an existing file*/
- if(H5Lcreate_external(pathname, "/group", gid, " link", H5P_DEFAULT, H5P_DEFAULT) < 0)
- goto error;
+ if((gid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0)
+ goto error;
- if(H5Gclose(gid) < 0)
- goto error;
+ pathname[0] = '\0';
+ /* Generate correct name for test file by prepending the source path */
+ if(srcdir && ((HDstrlen(srcdir) + HDstrlen(LINKED_FILE) + 1) < sizeof(pathname))) {
+ HDstrcpy(pathname, srcdir);
+ HDstrcat(pathname, "/");
+ }
+ HDstrcat(pathname, LINKED_FILE);
- if(H5Fclose(fid) < 0)
- goto error;
+ /* Create an external link to an existing file*/
+ if(H5Lcreate_external(pathname, "/group", gid, " link", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ goto error;
- /* Reopen the file */
- if((fid = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0)
- goto error;
+ if(H5Gclose(gid) < 0)
+ goto error;
- /* Open the external link */
- if((xid = H5Gopen2(fid, "/ link", H5P_DEFAULT)) < 0)
- goto error;
+ if(H5Fclose(fid) < 0)
+ goto error;
- /* Open the external link twice */
- if((xid2 = H5Gopen2(xid, ".", H5P_DEFAULT)) < 0)
- goto error;
+ /* Reopen the file */
+ if((fid = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0)
+ goto error;
- if(H5Gclose(xid2) < 0)
- goto error;
+ /* Open the external link */
+ if((xid = H5Gopen2(fid, "/ link", H5P_DEFAULT)) < 0)
+ goto error;
- if(H5Gclose(xid) < 0)
- goto error;
+ /* Open the external link twice */
+ if((xid2 = H5Gopen2(xid, ".", H5P_DEFAULT)) < 0)
+ goto error;
- if(H5Fclose(fid) < 0)
- goto error;
+ if(H5Gclose(xid2) < 0)
+ goto error;
+
+ if(H5Gclose(xid) < 0)
+ goto error;
+
+ if(H5Fclose(fid) < 0)
+ goto error;
- PASSED();
- } else
- SKIPPED();
+ if(H5Pclose(fapl) < 0)
+ TEST_ERROR
+
+ PASSED();
return 0;
@@ -939,58 +941,48 @@ main (void)
char filename[1024]; /*file name for test_1* funcs */
hid_t grp=-1; /*group to emit diagnostics */
int nerrors=0; /*number of errors */
- const char *envval = NULL;
-
- /* Don't run this test using the split file driver */
- envval = HDgetenv("HDF5_DRIVER");
- if (envval == NULL)
- envval = "nomatch";
- if (HDstrcmp(envval, "split")) {
- h5_reset();
- fapl = h5_fileaccess();
- h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
- if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
- if((grp = H5Gcreate2(file, "emit-diagnostics", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if(H5Gclose(grp) < 0) goto error;
-
- nerrors += test_1a(file);
- nerrors += test_1b(file);
- nerrors += test_1c(file);
- nerrors += test_1d(file);
- nerrors += test_1e(file);
- nerrors += test_1f(file);
- nerrors += test_1g();
- nerrors += test_1h();
- nerrors += test_2(fapl);
- nerrors += test_3(fapl);
- nerrors += test_4(fapl);
- if (nerrors>0) goto error;
-
- if (H5Fclose(file) < 0) goto error;
- puts("All external storage tests passed.");
- if (h5_cleanup(FILENAME, fapl)) {
- remove("extern_1a.raw");
- remove("extern_1b.raw");
- remove("extern_2a.raw");
- remove("extern_2b.raw");
- remove("extern_3a.raw");
- remove("extern_3b.raw");
- remove("extern_4a.raw");
- remove("extern_4b.raw");
- }
- }
- else
- {
- puts("All external storage tests skipped - Incompatible with current Virtual File Driver");
+
+ h5_reset();
+ fapl = h5_fileaccess();
+ h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
+ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
+ if((grp = H5Gcreate2(file, "emit-diagnostics", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if(H5Gclose(grp) < 0) goto error;
+
+ nerrors += test_1a(file);
+ nerrors += test_1b(file);
+ nerrors += test_1c(file);
+ nerrors += test_1d(file);
+ nerrors += test_1e(file);
+ nerrors += test_1f(file);
+ nerrors += test_1g();
+ nerrors += test_1h();
+ nerrors += test_2(fapl);
+ nerrors += test_3(fapl);
+ nerrors += test_4(fapl);
+ if (nerrors>0) goto error;
+
+ if (H5Fclose(file) < 0) goto error;
+ puts("All external storage tests passed.");
+ if (h5_cleanup(FILENAME, fapl)) {
+ remove("extern_1a.raw");
+ remove("extern_1b.raw");
+ remove("extern_2a.raw");
+ remove("extern_2b.raw");
+ remove("extern_3a.raw");
+ remove("extern_3b.raw");
+ remove("extern_4a.raw");
+ remove("extern_4b.raw");
}
+
return 0;
- error:
- H5E_BEGIN_TRY {
- H5Fclose(file);
- H5Pclose(fapl);
- } H5E_END_TRY;
- nerrors = MAX(1, nerrors);
- printf ("%d TEST%s FAILED.\n", nerrors, 1==nerrors?"":"s");
- return 1;
+error:
+ H5E_BEGIN_TRY {
+ H5Fclose(file);
+ H5Pclose(fapl);
+ } H5E_END_TRY;
+ nerrors = MAX(1, nerrors);
+ printf ("%d TEST%s FAILED.\n", nerrors, 1==nerrors?"":"s");
+ return 1;
}