summaryrefslogtreecommitdiffstats
path: root/test/istore.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/istore.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/istore.c')
-rw-r--r--test/istore.c240
1 files changed, 108 insertions, 132 deletions
diff --git a/test/istore.c b/test/istore.c
index e0d2e82..fff6706 100644
--- a/test/istore.c
+++ b/test/istore.c
@@ -250,9 +250,9 @@ test_extend(hid_t f, const char *prefix,
sprintf(s, "istore extend: %s", dims);
TESTING(s);
- buf = HDmalloc(nx * ny * nz);
- check = HDmalloc(nx * ny * nz);
- whole = HDcalloc((size_t)1, nx * ny * nz);
+ buf = (uint8_t *)HDmalloc(nx * ny * nz);
+ check = (uint8_t *)HDmalloc(nx * ny * nz);
+ whole = (uint8_t *)HDcalloc((size_t)1, nx * ny * nz);
whole_size[0] = nx;
whole_size[1] = ny;
@@ -463,7 +463,7 @@ test_sparse(hid_t f, const char *prefix, size_t nblocks,
sprintf(s, "istore sparse: %s", dims);
TESTING(s);
- buf = HDmalloc(nx * ny * nz);
+ buf = (uint8_t *)HDmalloc(nx * ny * nz);
HDmemset(buf, 128, nx * ny * nz);
/* Set dimensions of dataset */
@@ -565,140 +565,116 @@ main(int argc, char *argv[])
unsigned size_of_test;
unsigned u; /* Local index variable */
char filename[1024];
- 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")) {
- /* Parse arguments or assume these tests (`small', `medium' ) */
- if (1 == argc) {
- size_of_test = TEST_SMALL;
- } else {
- int i;
- for (i = 1, size_of_test = 0; i < argc; i++) {
- if (!strcmp(argv[i], "small")) {
- size_of_test |= TEST_SMALL;
- } else if (!strcmp(argv[i], "medium")) {
- size_of_test |= TEST_MEDIUM;
- } else if (!strcmp(argv[i], "large")) {
- size_of_test |= TEST_LARGE;
- } else {
- printf("unrecognized argument: %s\n", argv[i]);
+
+ /* Parse arguments or assume these tests (`small', `medium' ) */
+ if (1 == argc) {
+ size_of_test = TEST_SMALL | TEST_MEDIUM | TEST_LARGE;
+ } else {
+ int i;
+ for (i = 1, size_of_test = 0; i < argc; i++) {
+ if (!strcmp(argv[i], "small")) {
+ size_of_test |= TEST_SMALL;
+ } else if (!strcmp(argv[i], "medium")) {
+ size_of_test |= TEST_MEDIUM;
+ } else if (!strcmp(argv[i], "large")) {
+ size_of_test |= TEST_LARGE;
+ } else {
+ printf("unrecognized argument: %s\n", argv[i]);
#if 0
- exit(1);
+ exit(1);
#endif
- }
- }
- }
- printf("Test sizes: ");
- if (size_of_test & TEST_SMALL)
- printf(" SMALL");
- if (size_of_test & TEST_MEDIUM)
- printf(" MEDIUM");
- if (size_of_test & TEST_LARGE)
- printf(" LARGE");
- printf("\n");
-
- /* Set the random # seed */
- HDsrandom((unsigned long)HDtime(NULL));
-
- /* Reset library */
- h5_reset();
- fapl = h5_fileaccess();
-
- /* Use larger file addresses... */
- fcpl = H5Pcreate(H5P_FILE_CREATE);
- H5Pset_sizes(fcpl, (size_t)8, (size_t)0);
-
- /* Create the test file */
- h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
- if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) {
- printf("Cannot create file %s; test aborted\n", filename);
- exit(1);
- }
+ }
+ }
+ }
+ printf("Test sizes: ");
+ if (size_of_test & TEST_SMALL)
+ printf(" SMALL");
+ if (size_of_test & TEST_MEDIUM)
+ printf(" MEDIUM");
+ if (size_of_test & TEST_LARGE)
+ printf(" LARGE");
+ printf("\n");
+
+ /* Set the random # seed */
+ HDsrandom((unsigned long)HDtime(NULL));
+
+ /* Reset library */
+ h5_reset();
+ fapl = h5_fileaccess();
+
+ /* Use larger file addresses... */
+ fcpl = H5Pcreate(H5P_FILE_CREATE);
+ H5Pset_sizes(fcpl, (size_t)8, (size_t)0);
+
+ /* Create the test file */
+ h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
+ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) {
+ printf("Cannot create file %s; test aborted\n", filename);
+ exit(1);
+ }
- /*
- * For testing file families, fool the library into thinking it already
- * allocated a whole bunch of data.
- */
- if (H5FD_FAMILY==H5Pget_driver(fapl)) {
- haddr_t addr;
- H5F_t *f;
-
- addr = 8 * ((uint64_t)1<<30); /*8 GB */
- f=H5I_object(file);
- if (H5FDset_eoa(f->shared->lf, H5FD_MEM_DEFAULT, addr) < 0) {
- printf("Cannot create large file family\n");
- exit(1);
- }
- }
+ /* Initialize chunk dimensions */
+ for(u = 0; u < H5O_LAYOUT_NDIMS; u++)
+ chunk_dims[u] = TEST_CHUNK_SIZE;
+
+ /*
+ * Creation test: Creates empty objects with various raw data sizes
+ * and alignments.
+ */
+ status = test_create(file, "create");
+ nerrors += status < 0 ? 1 : 0;
+
+ if (size_of_test & TEST_SMALL) {
+ status = test_extend(file, "extend", (size_t)10, (size_t)0, (size_t)0);
+ nerrors += status < 0 ? 1 : 0;
+ status = test_extend(file, "extend", (size_t)10, (size_t)10, (size_t)0);
+ nerrors += status < 0 ? 1 : 0;
+ status = test_extend(file, "extend", (size_t)10, (size_t)10, (size_t)10);
+ nerrors += status < 0 ? 1 : 0;
+ }
+ if (size_of_test & TEST_MEDIUM) {
+ status = test_extend(file, "extend", (size_t)10000, (size_t)0, (size_t)0);
+ nerrors += status < 0 ? 1 : 0;
+ status = test_extend(file, "extend", (size_t)2500, (size_t)10, (size_t)0);
+ nerrors += status < 0 ? 1 : 0;
+ status = test_extend(file, "extend", (size_t)10, (size_t)400, (size_t)10);
+ nerrors += status < 0 ? 1 : 0;
+ }
+ if (size_of_test & TEST_SMALL) {
+ status = test_sparse(file, "sparse", (size_t)100, (size_t)5, (size_t)0, (size_t)0);
+ nerrors += status < 0 ? 1 : 0;
+ status = test_sparse(file, "sparse", (size_t)100, (size_t)3, (size_t)4, (size_t)0);
+ nerrors += status < 0 ? 1 : 0;
+ status = test_sparse(file, "sparse", (size_t)100, (size_t)2, (size_t)3, (size_t)4);
+ nerrors += status < 0 ? 1 : 0;
+ }
+ if (size_of_test & TEST_MEDIUM) {
+ status = test_sparse(file, "sparse", (size_t)1000, (size_t)30, (size_t)0, (size_t)0);
+ nerrors += status < 0 ? 1 : 0;
+ status = test_sparse(file, "sparse", (size_t)2000, (size_t)7, (size_t)3, (size_t)0);
+ nerrors += status < 0 ? 1 : 0;
+ status = test_sparse(file, "sparse", (size_t)2000, (size_t)4, (size_t)2, (size_t)3);
+ nerrors += status < 0 ? 1 : 0;
+ }
+ if (size_of_test & TEST_LARGE) {
+ status = test_sparse(file, "sparse", (size_t)800, (size_t)50, (size_t)50, (size_t)50);
+ nerrors += status < 0 ? 1 : 0;
+ }
- /* Initialize chunk dimensions */
- for (u = 0; u < H5O_LAYOUT_NDIMS; u++)
- chunk_dims[u]=TEST_CHUNK_SIZE;
-
- /*
- * Creation test: Creates empty objects with various raw data sizes
- * and alignments.
- */
- status = test_create(file, "create");
- nerrors += status < 0 ? 1 : 0;
-
- if (size_of_test & TEST_SMALL) {
- status = test_extend(file, "extend", (size_t)10, (size_t)0, (size_t)0);
- nerrors += status < 0 ? 1 : 0;
- status = test_extend(file, "extend", (size_t)10, (size_t)10, (size_t)0);
- nerrors += status < 0 ? 1 : 0;
- status = test_extend(file, "extend", (size_t)10, (size_t)10, (size_t)10);
- nerrors += status < 0 ? 1 : 0;
- }
- if (size_of_test & TEST_MEDIUM) {
- status = test_extend(file, "extend", (size_t)10000, (size_t)0, (size_t)0);
- nerrors += status < 0 ? 1 : 0;
- status = test_extend(file, "extend", (size_t)2500, (size_t)10, (size_t)0);
- nerrors += status < 0 ? 1 : 0;
- status = test_extend(file, "extend", (size_t)10, (size_t)400, (size_t)10);
- nerrors += status < 0 ? 1 : 0;
- }
- if (size_of_test & TEST_SMALL) {
- status = test_sparse(file, "sparse", (size_t)100, (size_t)5, (size_t)0, (size_t)0);
- nerrors += status < 0 ? 1 : 0;
- status = test_sparse(file, "sparse", (size_t)100, (size_t)3, (size_t)4, (size_t)0);
- nerrors += status < 0 ? 1 : 0;
- status = test_sparse(file, "sparse", (size_t)100, (size_t)2, (size_t)3, (size_t)4);
- nerrors += status < 0 ? 1 : 0;
- }
- if (size_of_test & TEST_MEDIUM) {
- status = test_sparse(file, "sparse", (size_t)1000, (size_t)30, (size_t)0, (size_t)0);
- nerrors += status < 0 ? 1 : 0;
- status = test_sparse(file, "sparse", (size_t)2000, (size_t)7, (size_t)3, (size_t)0);
- nerrors += status < 0 ? 1 : 0;
- status = test_sparse(file, "sparse", (size_t)2000, (size_t)4, (size_t)2, (size_t)3);
- nerrors += status < 0 ? 1 : 0;
- }
- if (size_of_test & TEST_LARGE) {
- status = test_sparse(file, "sparse", (size_t)800, (size_t)50, (size_t)50, (size_t)50);
- nerrors += status < 0 ? 1 : 0;
- }
+ /* Close the test file and exit */
+ H5Pclose(fcpl);
+ H5Fclose(file);
- /* Close the test file and exit */
- H5Pclose(fcpl);
- H5Fclose(file);
+ if (nerrors) {
+ printf("***** %d I-STORE TEST%s FAILED! *****\n",
+ nerrors, 1 == nerrors ? "" : "S");
+ exit(1);
+ }
- if (nerrors) {
- printf("***** %d I-STORE TEST%s FAILED! *****\n",
- nerrors, 1 == nerrors ? "" : "S");
- exit(1);
- }
+ printf("All i-store tests passed.\n");
+
+ h5_cleanup(FILENAME, fapl);
- printf("All i-store tests passed.\n");
- h5_cleanup(FILENAME, fapl);
- }
- else
- {
- puts("All i-store tests skipped - Incompatible with current Virtual File Driver");
- }
return 0;
}
+