summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/dtypes.c2
-rw-r--r--test/family_v1.7_00000.h5bin0 -> 5120 bytes
-rw-r--r--test/family_v1.7_00001.h5bin0 -> 5120 bytes
-rw-r--r--test/family_v1.7_00002.h5bin0 -> 5120 bytes
-rw-r--r--test/family_v1.7_00003.h5bin0 -> 4072 bytes
-rw-r--r--test/file_handle.c72
6 files changed, 71 insertions, 3 deletions
diff --git a/test/dtypes.c b/test/dtypes.c
index 1b52cb3..627d6c3 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -6144,7 +6144,7 @@ main(void)
nerrors += test_conv_flt_1("sw", H5T_NATIVE_LDOUBLE, H5T_NATIVE_FLOAT);
nerrors += test_conv_flt_1("sw", H5T_NATIVE_LDOUBLE, H5T_NATIVE_DOUBLE);
#endif
-
+
if (nerrors) {
printf("***** %lu FAILURE%s! *****\n",
nerrors, 1==nerrors?"":"S");
diff --git a/test/family_v1.7_00000.h5 b/test/family_v1.7_00000.h5
new file mode 100644
index 0000000..2d623dd
--- /dev/null
+++ b/test/family_v1.7_00000.h5
Binary files differ
diff --git a/test/family_v1.7_00001.h5 b/test/family_v1.7_00001.h5
new file mode 100644
index 0000000..cc6c426
--- /dev/null
+++ b/test/family_v1.7_00001.h5
Binary files differ
diff --git a/test/family_v1.7_00002.h5 b/test/family_v1.7_00002.h5
new file mode 100644
index 0000000..a606e57
--- /dev/null
+++ b/test/family_v1.7_00002.h5
Binary files differ
diff --git a/test/family_v1.7_00003.h5 b/test/family_v1.7_00003.h5
new file mode 100644
index 0000000..ecb978d
--- /dev/null
+++ b/test/family_v1.7_00003.h5
Binary files differ
diff --git a/test/file_handle.c b/test/file_handle.c
index 1db5e14..b957b15 100644
--- a/test/file_handle.c
+++ b/test/file_handle.c
@@ -23,15 +23,17 @@
#define KB 1024
#define FAMILY_NUMBER 4
-#define FAMILY_SIZE 1024
+#define FAMILY_SIZE (1*KB)
+#define FAMILY_SIZE2 (5*KB)
#define MULTI_SIZE 128
-#define CORE_INCREMENT 4096
+#define CORE_INCREMENT (4*KB)
const char *FILENAME[] = {
"sec2_file",
"core_file",
"family_file",
"multi_file",
+ "family_v1.7_",
NULL
};
@@ -335,6 +337,71 @@ error:
/*-------------------------------------------------------------------------
+ * Function: test_family_compat
+ *
+ * Purpose: Tests the forward compatibility for FAMILY driver.
+ * See if we can open files created with v1.7 library.
+ * The source file was created by the test/file_handle.c
+ * of the v1.7 library. Then tools/misc/h5repart.c was
+ * used to concantenated. The command was "h5repart -m 5k
+ * family_file%05d.h5 family_v1.7_%05d.h5".
+ *
+ * Return: Success: exit(0)
+ *
+ * Failure: exit(1)
+ *
+ * Programmer: Raymond Lu
+ * June 3, 2005
+ *
+ * Modifications:
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_family_compat(void)
+{
+ hid_t file=(-1), fapl;
+ char filename[1024];
+ char pathname[1024];
+ char *srcdir = getenv("srcdir"); /*where the src code is located*/
+
+ TESTING("FAMILY file driver forward compatibility");
+
+ /* Set property list and file name for FAMILY driver */
+ fapl = h5_fileaccess();
+
+ if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE2, H5P_DEFAULT)<0)
+ goto error;
+
+ h5_fixname(FILENAME[4], fapl, filename, sizeof filename);
+
+ /* Generate correct name for test file by prepending the source path */
+ if(srcdir && ((strlen(srcdir) + strlen(filename) + 1) < sizeof(pathname))) {
+ strcpy(pathname, srcdir);
+ strcat(pathname, "/");
+ }
+ strcat(pathname, filename);
+
+ if((file=H5Fopen(pathname, H5F_ACC_RDONLY, fapl))<0)
+ goto error;
+
+ if(H5Fclose(file)<0)
+ goto error;
+
+ if(H5Pclose(fapl)<0)
+ goto error;
+
+ PASSED();
+ return 0;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Fclose(file);
+ } H5E_END_TRY;
+ return -1;
+}
+
+
+/*-------------------------------------------------------------------------
* Function: test_multi
*
* Purpose: Tests the file handle interface for MUTLI driver
@@ -515,6 +582,7 @@ main(void)
nerrors += test_sec2()<0 ?1:0;
nerrors += test_core()<0 ?1:0;
nerrors += test_family()<0 ?1:0;
+ nerrors += test_family_compat()<0 ?1:0;
nerrors += test_multi()<0 ?1:0;
if (nerrors) goto error;