summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSongyu Lu <songyulu@hdfgroup.org>2019-04-09 21:20:19 (GMT)
committerSongyu Lu <songyulu@hdfgroup.org>2019-04-09 21:20:19 (GMT)
commit477dda3c0daea39cdf409684e7dad0fd9367dd45 (patch)
tree08f8d1653aec4e356fb069ae3a7d8768009901e2 /test
parentd8ff8da46cb49098c41b421427967eb736e15236 (diff)
downloadhdf5-477dda3c0daea39cdf409684e7dad0fd9367dd45.zip
hdf5-477dda3c0daea39cdf409684e7dad0fd9367dd45.tar.gz
hdf5-477dda3c0daea39cdf409684e7dad0fd9367dd45.tar.bz2
HDFFV-10658 - setting and getting properties in API context:
1. switched to use the existing H5F_prefix_open_t for enum type; 2. put the common private function used by external.c and external_env.c into external_common.c
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am4
-rw-r--r--test/external_common.c (renamed from test/external.h)35
-rw-r--r--test/external_common.h45
-rw-r--r--test/external_env.c9
4 files changed, 57 insertions, 36 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index 68b9394..55b5a88 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -63,7 +63,7 @@ TEST_PROG= testhdf5 \
flush1 flush2 app_ref enum set_extent ttsafe enc_dec_plist \
enc_dec_plist_cross_platform getname vfd ntypes dangle dtransform \
reserved cross_read freespace mf vds file_image unregister \
- cache_logging cork swmr vol
+ cache_logging cork swmr vol_tst
# List programs to be built when testing here.
# error_test and err_compat are built at the same time as the other tests, but executed by testerror.sh.
@@ -135,7 +135,7 @@ else
noinst_LTLIBRARIES=libh5test.la
endif
-libh5test_la_SOURCES=h5test.c testframe.c cache_common.c swmr_common.c
+libh5test_la_SOURCES=h5test.c testframe.c cache_common.c swmr_common.c external_common.c
# Use libhd5test.la to compile all of the tests
LDADD=libh5test.la $(LIBHDF5)
diff --git a/test/external.h b/test/external_common.c
index 1c660e1..e43a713 100644
--- a/test/external.h
+++ b/test/external_common.c
@@ -12,34 +12,13 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
- * Wednesday, March 17, 2010
+ * Programmer: Raymond Lu <songyulu@hdfgroup.org>
+ * April, 2019
*
- * Purpose: srcdir querying support.
+ * Purpose: Private function for external.c and external_env.c
*/
-#ifndef _EXTERNAL_H
-#define _EXTERNAL_H
-/* Include test header files */
-#include "h5test.h"
-
-const char *FILENAME[] = {
- "extern_1",
- "extern_2",
- "extern_3",
- "extern_4",
- "extern_dir/file_1",
- "extern_5",
- NULL
-};
-
-/* A similar collection of files is used for the tests that
- * perform file I/O.
- */
-#define N_EXT_FILES 4
-#define PART_SIZE 25
-#define TOTAL_SIZE 100
-#define GARBAGE_PER_FILE 10
+#include "external_common.h"
/*-------------------------------------------------------------------------
@@ -55,7 +34,7 @@ const char *FILENAME[] = {
*
*-------------------------------------------------------------------------
*/
-static herr_t
+herr_t
reset_raw_data_files(void)
{
int fd = 0; /* external file descriptor */
@@ -139,6 +118,4 @@ error:
if(garbage)
HDfree(garbage);
return FAIL;
-} /* end reset_raw_data_files() */
-#endif /* _EXTERNAL_H */
-
+}
diff --git a/test/external_common.h b/test/external_common.h
new file mode 100644
index 0000000..f1a15b5
--- /dev/null
+++ b/test/external_common.h
@@ -0,0 +1,45 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Programmer: Raymond Lu <songyulu@hdfgroup.org>
+ * April, 2019
+ *
+ * Purpose: Private function for external.c and external_env.c
+ */
+#ifndef _EXTERNAL_COMMON_H
+#define _EXTERNAL_COMMON_H
+
+/* Include test header files */
+#include "h5test.h"
+
+static const char *EXT_FNAME[] = {
+ "extern_1",
+ "extern_2",
+ "extern_3",
+ "extern_4",
+ "extern_dir/file_1",
+ "extern_5",
+ NULL
+};
+
+/* A similar collection of files is used for the tests that
+ * perform file I/O.
+ */
+#define N_EXT_FILES 4
+#define PART_SIZE 25
+#define TOTAL_SIZE 100
+#define GARBAGE_PER_FILE 10
+
+herr_t reset_raw_data_files(void);
+#endif /* _EXTERNAL_COMMON_H */
diff --git a/test/external_env.c b/test/external_env.c
index 97daef2..2f5f838 100644
--- a/test/external_env.c
+++ b/test/external_env.c
@@ -17,8 +17,7 @@
*
* Purpose: Tests datasets stored in external raw files.
*/
-#include "h5test.h"
-#include "external.h"
+#include "external_common.h"
/*-------------------------------------------------------------------------
@@ -63,7 +62,7 @@ test_path_env(hid_t fapl)
if(HDmkdir("extern_dir", (mode_t)0755) < 0 && errno != EEXIST)
TEST_ERROR;
- h5_fixname(FILENAME[4], fapl, filename, sizeof(filename));
+ h5_fixname(EXT_FNAME[4], fapl, filename, sizeof(filename));
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
FAIL_STACK_ERROR
@@ -156,7 +155,7 @@ main(void)
/* Get a fapl for the old (default) file format */
fapl_id_old = h5_fileaccess();
- h5_fixname(FILENAME[0], fapl_id_old, filename, sizeof(filename));
+ h5_fixname(EXT_FNAME[0], fapl_id_old, filename, sizeof(filename));
/* Copy and set up a fapl for the latest file format */
if((fapl_id_new = H5Pcopy(fapl_id_old)) < 0)
@@ -189,7 +188,7 @@ main(void)
HDputs("All external storage tests passed.");
/* Clean up files used by file set tests */
- if(h5_cleanup(FILENAME, fapl_id_old)) {
+ if(h5_cleanup(EXT_FNAME, fapl_id_old)) {
HDremove("extern_1r.raw");
HDremove("extern_2r.raw");
HDremove("extern_3r.raw");