summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/family_v16_00000.h5bin5120 -> 5120 bytes
-rwxr-xr-xtest/objcopy.c25
-rw-r--r--test/tfile.c65
3 files changed, 75 insertions, 15 deletions
diff --git a/test/family_v16_00000.h5 b/test/family_v16_00000.h5
index bf1a711..5b69c93 100644
--- a/test/family_v16_00000.h5
+++ b/test/family_v16_00000.h5
Binary files differ
diff --git a/test/objcopy.c b/test/objcopy.c
index c2d71c0..4bd4662 100755
--- a/test/objcopy.c
+++ b/test/objcopy.c
@@ -7451,6 +7451,10 @@ main(void)
hid_t fcpl_src;
hid_t fcpl_dst;
+ /* No need to test dense attributes with old format */
+ if(!(configuration & CONFIG_NEW_FORMAT) && (configuration & CONFIG_DENSE))
+ continue;
+
/* Test with and without shared messages */
if(configuration & CONFIG_SHARE_SRC) {
puts("\nTesting with shared src messages:");
@@ -7473,22 +7477,23 @@ main(void)
if(configuration & CONFIG_NEW_FORMAT) {
puts("Testing with new group format:");
my_fapl = fapl2;
+
+ /* Test with and without dense attributes */
+ if(configuration & CONFIG_DENSE) {
+ puts("Testing with dense attributes:");
+ num_attributes_g = max_compact + 1;
+ }
+ else {
+ puts("Testing without dense attributes:");
+ num_attributes_g = MAX(min_dense, 2) - 1;
+ }
} /* end if */
else {
puts("Testing with old group format:");
my_fapl = fapl;
+ num_attributes_g = 4;
} /* end else */
- /* Test with and without dense attributes */
- if(configuration & CONFIG_DENSE) {
- puts("Testing with dense attributes:");
- num_attributes_g = max_compact + 1;
- }
- else {
- puts("Testing without dense attributes:");
- num_attributes_g = MAX(min_dense, 2) - 1;
- }
-
/* The tests... */
nerrors += test_copy_dataset_simple(fcpl_src, fcpl_dst, my_fapl);
nerrors += test_copy_dataset_simple_samefile(fcpl_src, my_fapl);
diff --git a/test/tfile.c b/test/tfile.c
index 724ad4a..68c7f6b 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -27,6 +27,14 @@
#include "H5Bprivate.h"
#include "H5Pprivate.h"
+/*
+ * This file needs to access private information from the H5F package.
+ * This file also needs to access the file testing code.
+ */
+#define H5F_PACKAGE
+#define H5F_TESTING
+#include "H5Fpkg.h" /* File access */
+
#define F1_USERBLOCK_SIZE (hsize_t)0
#define F1_OFFSET_SIZE sizeof(haddr_t)
#define F1_LENGTH_SIZE sizeof(hsize_t)
@@ -1931,9 +1939,9 @@ test_userblock_file_size(void)
/* Reopen files */
file1_id = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Fopen");
+ CHECK(file1_id, FAIL, "H5Fopen");
file2_id = H5Fopen(FILE2, H5F_ACC_RDWR, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Fopen");
+ CHECK(file2_id, FAIL, "H5Fopen");
/* Check file sizes */
ret = H5Fget_filesize(file1_id, &filesize1);
@@ -1952,9 +1960,9 @@ test_userblock_file_size(void)
/* Reopen files */
file1_id = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Fopen");
+ CHECK(file1_id, FAIL, "H5Fopen");
file2_id = H5Fopen(FILE2, H5F_ACC_RDWR, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Fopen");
+ CHECK(file2_id, FAIL, "H5Fopen");
/* Verify file sizes did not change */
ret = H5Fget_filesize(file1_id, &filesize);
@@ -1973,6 +1981,52 @@ test_userblock_file_size(void)
/****************************************************************
**
+** test_cached_stab_info(): low-level file test routine.
+** This test checks that new files are created with cached
+** symbol table information in the superblock (when using
+** the old format). This is necessary to ensure backwards
+** compatibility with versions from 1.3.0 to 1.6.3.
+**
+*****************************************************************/
+static void
+test_cached_stab_info(void)
+{
+ hid_t file_id;
+ hid_t group_id;
+ herr_t ret; /* Generic return value */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing cached symbol table information\n"));
+
+ /* Create file */
+ file_id = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(file_id, FAIL, "H5Fcreate");
+
+ /* Create group */
+ group_id = H5Gcreate2(file_id, GROUP1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(group_id, FAIL, "H5Gcreate2");
+
+ /* Close file and group */
+ ret = H5Gclose(group_id);
+ CHECK(ret, FAIL, "H5Gclose");
+ ret = H5Fclose(file_id);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Reopen file */
+ file_id = H5Fopen(FILE1, H5F_ACC_RDONLY, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Fopen");
+
+ /* Verify the cached symbol table information */
+ ret = H5F_check_cached_stab_test(file_id);
+ CHECK(ret, FAIL, "H5F_check_cached_stab_test");
+
+ /* Close file */
+ ret = H5Fclose(file_id);
+ CHECK(ret, FAIL, "H5Fclose");
+} /* end test_cached_stab_info() */
+
+/****************************************************************
+**
** test_file(): Main low-level file I/O test routine.
**
****************************************************************/
@@ -2002,7 +2056,8 @@ test_file(void)
test_file_double_dataset_open(); /* Test opening same dataset from two files works properly */
test_file_double_datatype_open(); /* Test opening same named datatype from two files works properly */
#endif /*H5_CANNOT_OPEN_TWICE*/
- test_userblock_file_size(); /* Tests that files created with a userblock have the correct size */
+ test_userblock_file_size(); /* Tests that files created with a userblock have the correct size */
+ test_cached_stab_info(); /* Tests that files are created with cached stab info in the superblock */
} /* test_file() */