summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2019-08-19 23:35:55 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2019-08-20 01:02:47 (GMT)
commit8c40dab59eaef1dea92df91a9d877edf3ce565d0 (patch)
tree4c4aa9d824f2229f332aa09dd32eb0b465fadca9 /tools
parent8b6f3bc7e63ad0a44abc434da9f427e8cd84bad8 (diff)
downloadhdf5-8c40dab59eaef1dea92df91a9d877edf3ce565d0.zip
hdf5-8c40dab59eaef1dea92df91a9d877edf3ce565d0.tar.gz
hdf5-8c40dab59eaef1dea92df91a9d877edf3ce565d0.tar.bz2
Untangle #ifdef mess in ROS3 code.
Diffstat (limited to 'tools')
-rw-r--r--tools/lib/h5tools_utils.c18
-rw-r--r--tools/lib/h5tools_utils.h3
-rw-r--r--tools/libtest/h5tools_test_utils.c36
3 files changed, 27 insertions, 30 deletions
diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c
index e140fff..47ce690 100644
--- a/tools/lib/h5tools_utils.c
+++ b/tools/lib/h5tools_utils.c
@@ -1129,17 +1129,13 @@ done:
* Programmer: Jacob Smith
* 2017-11-13
*
- * Changes: None.
- *
*----------------------------------------------------------------------------
*/
+#ifdef H5_HAVE_ROS3_VFD
int
h5tools_populate_ros3_fapl(H5FD_ros3_fapl_t *fa,
const char **values)
{
-#ifndef H5_HAVE_ROS3_VFD
- return 0;
-#else
int show_progress = 0; /* set to 1 for debugging */
int ret_value = 1; /* 1 for success, 0 for failure */
/* e.g.? if (!populate()) { then failed } */
@@ -1159,7 +1155,7 @@ h5tools_populate_ros3_fapl(H5FD_ros3_fapl_t *fa,
if (show_progress) {
HDprintf(" preset fapl with default values\n");
}
- fa->version = H5FD__CURR_ROS3_FAPL_T_VERSION;
+ fa->version = H5FD_CURR_ROS3_FAPL_T_VERSION;
fa->authenticate = FALSE;
*(fa->aws_region) = '\0';
*(fa->secret_id) = '\0';
@@ -1196,7 +1192,7 @@ h5tools_populate_ros3_fapl(H5FD_ros3_fapl_t *fa,
if (*values[0] != '\0' &&
*values[1] != '\0')
{
- if (HDstrlen(values[0]) > H5FD__ROS3_MAX_REGION_LEN) {
+ if (HDstrlen(values[0]) > H5FD_ROS3_MAX_REGION_LEN) {
if (show_progress) {
HDprintf(" ERROR: aws_region value too long\n");
}
@@ -1210,7 +1206,7 @@ h5tools_populate_ros3_fapl(H5FD_ros3_fapl_t *fa,
}
- if (HDstrlen(values[1]) > H5FD__ROS3_MAX_SECRET_ID_LEN) {
+ if (HDstrlen(values[1]) > H5FD_ROS3_MAX_SECRET_ID_LEN) {
if (show_progress) {
HDprintf(" ERROR: secret_id value too long\n");
}
@@ -1224,7 +1220,7 @@ h5tools_populate_ros3_fapl(H5FD_ros3_fapl_t *fa,
HDprintf(" secret_id set\n");
}
- if (HDstrlen(values[2]) > H5FD__ROS3_MAX_SECRET_KEY_LEN) {
+ if (HDstrlen(values[2]) > H5FD_ROS3_MAX_SECRET_KEY_LEN) {
if (show_progress) {
HDprintf(" ERROR: secret_key value too long\n");
}
@@ -1259,9 +1255,9 @@ h5tools_populate_ros3_fapl(H5FD_ros3_fapl_t *fa,
done:
return ret_value;
-#endif /* H5_HAVE_ROS3_VFD */
} /* h5tools_populate_ros3_fapl */
+#endif /* H5_HAVE_ROS3_VFD */
/*-----------------------------------------------------------------------------
@@ -1329,5 +1325,3 @@ done:
} /* h5tools_set_configured_fapl() */
-
-
diff --git a/tools/lib/h5tools_utils.h b/tools/lib/h5tools_utils.h
index 1c6ba2a..0fa5250 100644
--- a/tools/lib/h5tools_utils.h
+++ b/tools/lib/h5tools_utils.h
@@ -182,8 +182,11 @@ H5TOOLS_DLL int h5tools_getenv_update_hyperslab_bufsize(void);
H5TOOLS_DLL int h5tools_set_configured_fapl(hid_t fapl_id,
const char vfd_name[],
void *fapl_t_ptr);
+#ifdef H5_HAVE_ROS3_VFD
H5TOOLS_DLL int h5tools_populate_ros3_fapl(H5FD_ros3_fapl_t *fa,
const char **values);
+#endif /* H5_HAVE_ROS3_VFD */
+
#ifdef __cplusplus
}
#endif
diff --git a/tools/libtest/h5tools_test_utils.c b/tools/libtest/h5tools_test_utils.c
index 8d489e4..b4d66e0 100644
--- a/tools/libtest/h5tools_test_utils.c
+++ b/tools/libtest/h5tools_test_utils.c
@@ -653,7 +653,7 @@ test_populate_ros3_fa(void)
show_progress = TRUE;
#endif /* H5TOOLS_UTILS_TEST_DEBUG */
- HDassert(bad_version != H5FD__CURR_ROS3_FAPL_T_VERSION);
+ HDassert(bad_version != H5FD_CURR_ROS3_FAPL_T_VERSION);
/*********
* TESTS *
@@ -679,7 +679,7 @@ test_populate_ros3_fa(void)
JSVERIFY( 1, h5tools_populate_ros3_fapl(&fa, NULL),
"NULL values pointer yields \"default\" fapl" )
- JSVERIFY( H5FD__CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
+ JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
JSVERIFY( FALSE, fa.authenticate, NULL )
JSVERIFY_STR( "", fa.aws_region, NULL )
JSVERIFY_STR( "", fa.secret_id, NULL )
@@ -697,7 +697,7 @@ test_populate_ros3_fa(void)
JSVERIFY( 1, h5tools_populate_ros3_fapl(&fa, values),
"empty values yields \"default\" fapl" )
- JSVERIFY( H5FD__CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
+ JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
JSVERIFY( FALSE, fa.authenticate, NULL )
JSVERIFY_STR( "", fa.aws_region, NULL )
JSVERIFY_STR( "", fa.secret_id, NULL )
@@ -715,7 +715,7 @@ test_populate_ros3_fa(void)
JSVERIFY( 1, h5tools_populate_ros3_fapl(&fa, values),
"four values" )
- JSVERIFY( H5FD__CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
+ JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
JSVERIFY( TRUE, fa.authenticate, NULL )
JSVERIFY_STR( "x", fa.aws_region, NULL )
JSVERIFY_STR( "y", fa.secret_id, NULL )
@@ -733,7 +733,7 @@ test_populate_ros3_fa(void)
JSVERIFY( 0, h5tools_populate_ros3_fapl(&fa, values),
"could not fill fapl" )
- JSVERIFY( H5FD__CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
+ JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
JSVERIFY( FALSE, fa.authenticate, NULL )
JSVERIFY_STR( "", fa.aws_region, NULL )
JSVERIFY_STR( "", fa.secret_id, NULL )
@@ -751,7 +751,7 @@ test_populate_ros3_fa(void)
JSVERIFY( 0, h5tools_populate_ros3_fapl(&fa, values),
"could not fill fapl" )
- JSVERIFY( H5FD__CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
+ JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
JSVERIFY( FALSE, fa.authenticate, NULL )
JSVERIFY_STR( "", fa.aws_region, NULL )
JSVERIFY_STR( "", fa.secret_id, NULL )
@@ -771,11 +771,11 @@ test_populate_ros3_fa(void)
if (show_progress) { HDprintf("region overflow\n"); }
- HDassert(HDstrlen(values[0]) > H5FD__ROS3_MAX_REGION_LEN);
+ HDassert(HDstrlen(values[0]) > H5FD_ROS3_MAX_REGION_LEN);
JSVERIFY( 0, h5tools_populate_ros3_fapl(&fa, values),
"could not fill fapl" )
- JSVERIFY( H5FD__CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
+ JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
JSVERIFY( FALSE, fa.authenticate, NULL )
JSVERIFY_STR( "", fa.aws_region, NULL )
JSVERIFY_STR( "", fa.secret_id, NULL )
@@ -793,7 +793,7 @@ test_populate_ros3_fa(void)
JSVERIFY( 0, h5tools_populate_ros3_fapl(&fa, values),
"could not fill fapl" )
- JSVERIFY( H5FD__CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
+ JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
JSVERIFY( FALSE, fa.authenticate, NULL )
JSVERIFY_STR( "", fa.aws_region, NULL )
JSVERIFY_STR( "", fa.secret_id, NULL )
@@ -811,7 +811,7 @@ test_populate_ros3_fa(void)
JSVERIFY( 0, h5tools_populate_ros3_fapl(&fa, values),
"could not fill fapl" )
- JSVERIFY( H5FD__CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
+ JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
JSVERIFY( FALSE, fa.authenticate, NULL )
JSVERIFY_STR( "", fa.aws_region, NULL )
JSVERIFY_STR( "", fa.secret_id, NULL )
@@ -839,11 +839,11 @@ test_populate_ros3_fa(void)
if (show_progress) { HDprintf("id overflow\n"); }
- HDassert(HDstrlen(values[1]) > H5FD__ROS3_MAX_SECRET_ID_LEN);
+ HDassert(HDstrlen(values[1]) > H5FD_ROS3_MAX_SECRET_ID_LEN);
JSVERIFY( 0, h5tools_populate_ros3_fapl(&fa, values),
"could not fill fapl" )
- JSVERIFY( H5FD__CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
+ JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
JSVERIFY( FALSE, fa.authenticate, NULL )
JSVERIFY_STR( "x", fa.aws_region, NULL )
JSVERIFY_STR( "", fa.secret_id, NULL )
@@ -861,7 +861,7 @@ test_populate_ros3_fa(void)
JSVERIFY( 0, h5tools_populate_ros3_fapl(&fa, values),
"could not fill fapl" )
- JSVERIFY( H5FD__CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
+ JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
JSVERIFY( FALSE, fa.authenticate, NULL )
JSVERIFY_STR( "", fa.aws_region, NULL )
JSVERIFY_STR( "", fa.secret_id, NULL )
@@ -879,7 +879,7 @@ test_populate_ros3_fa(void)
JSVERIFY( 1, h5tools_populate_ros3_fapl(&fa, values),
"could not fill fapl" )
- JSVERIFY( H5FD__CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
+ JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
JSVERIFY( TRUE, fa.authenticate, NULL )
JSVERIFY_STR( "x", fa.aws_region, NULL )
JSVERIFY_STR( "y", fa.secret_id, NULL )
@@ -897,7 +897,7 @@ test_populate_ros3_fa(void)
JSVERIFY( 0, h5tools_populate_ros3_fapl(&fa, values),
"could not fill fapl" )
- JSVERIFY( H5FD__CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
+ JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
JSVERIFY( FALSE, fa.authenticate, NULL )
JSVERIFY_STR( "", fa.aws_region, NULL )
JSVERIFY_STR( "", fa.secret_id, NULL )
@@ -915,7 +915,7 @@ test_populate_ros3_fa(void)
JSVERIFY( 0, h5tools_populate_ros3_fapl(&fa, values),
"could not fill fapl" )
- JSVERIFY( H5FD__CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
+ JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
JSVERIFY( FALSE, fa.authenticate, NULL )
JSVERIFY_STR( "", fa.aws_region, NULL )
JSVERIFY_STR( "", fa.secret_id, NULL )
@@ -943,11 +943,11 @@ test_populate_ros3_fa(void)
if (show_progress) { HDprintf("key overflow\n"); }
- HDassert(HDstrlen(values[2]) > H5FD__ROS3_MAX_SECRET_KEY_LEN);
+ HDassert(HDstrlen(values[2]) > H5FD_ROS3_MAX_SECRET_KEY_LEN);
JSVERIFY( 0, h5tools_populate_ros3_fapl(&fa, values),
"could not fill fapl" )
- JSVERIFY( H5FD__CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
+ JSVERIFY( H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL )
JSVERIFY( FALSE, fa.authenticate, NULL )
JSVERIFY_STR( "x", fa.aws_region, NULL )
JSVERIFY_STR( "y", fa.secret_id, NULL )