summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJacob Smith <jake.smith@hdfgroup.org>2020-04-07 15:16:48 (GMT)
committerJacob Smith <jake.smith@hdfgroup.org>2020-04-07 15:20:44 (GMT)
commitd97c00013dd5b13b618d08d9b6d6517176674a4e (patch)
treec972bbe7858f771f2c17b93f93db8f17b528f1ee /test
parentf771958d757e388d9b9cebb21ca03f00505ada5b (diff)
downloadhdf5-d97c00013dd5b13b618d08d9b6d6517176674a4e.zip
hdf5-d97c00013dd5b13b618d08d9b6d6517176674a4e.tar.gz
hdf5-d97c00013dd5b13b618d08d9b6d6517176674a4e.tar.bz2
Tidying of Mirror VFD.
* Rename server-stop utility to mirror_server_stop. * Remove external dependency on bzero(). * Modify test/use_common to use only the public API. * Rename internal bitswap macro to follow convention.
Diffstat (limited to 'test')
-rw-r--r--test/mirror_vfd.c73
-rw-r--r--test/test_mirror.sh.in2
-rw-r--r--test/use_common.c6
3 files changed, 51 insertions, 30 deletions
diff --git a/test/mirror_vfd.c b/test/mirror_vfd.c
index 00902dd..112d67a 100644
--- a/test/mirror_vfd.c
+++ b/test/mirror_vfd.c
@@ -101,6 +101,31 @@ static herr_t _populate_filepath(const char *dirname, const char *_basename,
static hid_t create_mirroring_split_fapl(const char *_basename,
struct mirrortest_filenames *names);
+static void mybzero(void *dest, size_t size);
+
+
+/* ----------------------------------------------------------------------------
+ * Function: mybzero
+ *
+ * Purpose: Have bzero simplicity and abstraction in (possible) absence of
+ * it being available.
+ *
+ * Programmer: Jacob Smith
+ * 2020-03-30
+ * ----------------------------------------------------------------------------
+ */
+static void
+mybzero(void *dest, size_t size)
+{
+ size_t i = 0;
+ char *s = NULL;
+ HDassert(dest != NULL);
+ s = (char *)dest;
+ for (i = 0; i < size; i++) {
+ *(s+i) = 0;
+ }
+} /* end mybzero() */
+
/* ----------------------------------------------------------------------------
* Function: _populate_filepath
@@ -349,8 +374,8 @@ test_xmit_encode_decode(void)
/* Start of buffer uint8_t
*/
- HDbzero(buf, 8);
- HDbzero(expected, 8);
+ mybzero(buf, 8);
+ mybzero(expected, 8);
expected[0] = 200;
out = 0;
if (H5FD__mirror_xmit_encode_uint8(buf, v) != 1) {
@@ -369,8 +394,8 @@ test_xmit_encode_decode(void)
/* Middle of buffer uint8_t
*/
- HDbzero(buf, 8);
- HDbzero(expected, 8);
+ mybzero(buf, 8);
+ mybzero(expected, 8);
expected[3] = v;
out = 0;
if (H5FD__mirror_xmit_encode_uint8((buf+3), v) != 1) {
@@ -389,8 +414,8 @@ test_xmit_encode_decode(void)
/* End of buffer uint8_t
*/
- HDbzero(buf, 8);
- HDbzero(expected, 8);
+ mybzero(buf, 8);
+ mybzero(expected, 8);
expected[7] = v;
out = 0;
if (H5FD__mirror_xmit_encode_uint8((buf+7), v) != 1) {
@@ -419,8 +444,8 @@ test_xmit_encode_decode(void)
/* Start of buffer uint16_t
*/
- HDbzero(buf, 8);
- HDbzero(expected, 8);
+ mybzero(buf, 8);
+ mybzero(expected, 8);
expected[0] = 0x8F;
expected[1] = 0x02;
out = 0;
@@ -440,8 +465,8 @@ test_xmit_encode_decode(void)
/* Middle of buffer uint16_t
*/
- HDbzero(buf, 8);
- HDbzero(expected, 8);
+ mybzero(buf, 8);
+ mybzero(expected, 8);
expected[3] = 0x8F;
expected[4] = 0x02;
out = 0;
@@ -468,8 +493,8 @@ test_xmit_encode_decode(void)
/* End of buffer uint16_t
*/
- HDbzero(buf, 8);
- HDbzero(expected, 8);
+ mybzero(buf, 8);
+ mybzero(expected, 8);
expected[6] = 0x8F;
expected[7] = 0x02;
out = 0;
@@ -499,8 +524,8 @@ test_xmit_encode_decode(void)
/* Start of buffer uint32_t
*/
- HDbzero(buf, 8);
- HDbzero(expected, 8);
+ mybzero(buf, 8);
+ mybzero(expected, 8);
expected[0] = 0x8F;
expected[1] = 0x02;
expected[2] = 0x00;
@@ -522,8 +547,8 @@ test_xmit_encode_decode(void)
/* Middle of buffer uint32_t
*/
- HDbzero(buf, 8);
- HDbzero(expected, 8);
+ mybzero(buf, 8);
+ mybzero(expected, 8);
expected[3] = 0x8F;
expected[4] = 0x02;
expected[5] = 0x00;
@@ -552,8 +577,8 @@ test_xmit_encode_decode(void)
/* End of buffer uint32_t
*/
- HDbzero(buf, 8);
- HDbzero(expected, 8);
+ mybzero(buf, 8);
+ mybzero(expected, 8);
expected[4] = 0x8F;
expected[5] = 0x02;
expected[6] = 0x00;
@@ -585,8 +610,8 @@ test_xmit_encode_decode(void)
/* Start of buffer uint64_t
*/
- HDbzero(buf, 16);
- HDbzero(expected, 16);
+ mybzero(buf, 16);
+ mybzero(expected, 16);
expected[0] = 0x90;
expected[1] = 0xDC;
expected[2] = 0xBE;
@@ -612,8 +637,8 @@ test_xmit_encode_decode(void)
/* Middle of buffer uint64_t
*/
- HDbzero(buf, 16);
- HDbzero(expected, 16);
+ mybzero(buf, 16);
+ mybzero(expected, 16);
expected[3] = 0x90;
expected[4] = 0xDC;
expected[5] = 0xBE;
@@ -646,8 +671,8 @@ test_xmit_encode_decode(void)
/* End of buffer uint64_t
*/
- HDbzero(buf, 16);
- HDbzero(expected, 16);
+ mybzero(buf, 16);
+ mybzero(expected, 16);
expected[8] = 0x90;
expected[9] = 0xDC;
expected[10] = 0xBE;
diff --git a/test/test_mirror.sh.in b/test/test_mirror.sh.in
index 3fdc673..9635c38 100644
--- a/test/test_mirror.sh.in
+++ b/test/test_mirror.sh.in
@@ -81,7 +81,7 @@ SERVER_ARGS="$SERVER_PORT $SERVER_VERBOSITY"
nerrors=$?
echo "Stopping Mirror Server"
-./mirror_server_halten_sie $SERVER_PORT
+./mirror_server_stop $SERVER_PORT
###############################################################################
## Report and exit
diff --git a/test/use_common.c b/test/use_common.c
index a986543..bf29936 100644
--- a/test/use_common.c
+++ b/test/use_common.c
@@ -21,10 +21,6 @@
#include "use.h"
-#define H5D_FRIEND /*suppress error about including H5Dpkg */
-#define H5D_TESTING
-#include "H5Dpkg.h" /* TODO : used to verify chunk index type (yes?) -- is there a way to do this sanity-check using the public API instead? */
-
/* ----------------------------------------------------------------------------
* Print a common/shared usage message.
* Receives program name to show default test file name (<program_name>.h5).
@@ -231,7 +227,7 @@ create_uc_file(options_t * opts)
/* Check that the chunk index type is not version 1 B-tree.
* Version 1 B-trees are not supported under SWMR.
*/
- if (H5D__layout_idx_type_test(dsid, &idx_type) < 0)
+ if (H5Dget_chunk_index_type(dsid, &idx_type) < 0)
return -1;
if (idx_type == H5D_CHUNK_IDX_BTREE) {
HDfprintf(stderr, "ERROR: Chunk index is version 1 B-tree: aborting.\n");