summaryrefslogtreecommitdiffstats
path: root/lib/libnv/tests/nv_tests.cc
diff options
context:
space:
mode:
authoroshogbo <oshogbo@FreeBSD.org>2015-04-29 22:46:18 +0000
committeroshogbo <oshogbo@FreeBSD.org>2015-04-29 22:46:18 +0000
commit3b1c9e8c4d1e3a4e15c6d915a194fbb0745be968 (patch)
treea6acbde266840fe08458b365553657e1d7a6dc51 /lib/libnv/tests/nv_tests.cc
parentcc50a2704d8c9871c97112d02428f73508f6d41d (diff)
downloadFreeBSD-src-3b1c9e8c4d1e3a4e15c6d915a194fbb0745be968.zip
FreeBSD-src-3b1c9e8c4d1e3a4e15c6d915a194fbb0745be968.tar.gz
Remove the use of nvlist_.*[fv] functions from tests.
Approved by: pjd (mentor)
Diffstat (limited to 'lib/libnv/tests/nv_tests.cc')
-rw-r--r--lib/libnv/tests/nv_tests.cc34
1 files changed, 10 insertions, 24 deletions
diff --git a/lib/libnv/tests/nv_tests.cc b/lib/libnv/tests/nv_tests.cc
index bfdc972..2d9fd97 100644
--- a/lib/libnv/tests/nv_tests.cc
+++ b/lib/libnv/tests/nv_tests.cc
@@ -77,9 +77,8 @@ ATF_TEST_CASE_BODY(nvlist_add_null__single_insert)
ATF_REQUIRE(!nvlist_empty(nvl));
ATF_REQUIRE(nvlist_exists(nvl, key));
- ATF_REQUIRE(nvlist_existsf(nvl, "%s", key));
ATF_REQUIRE(nvlist_exists_null(nvl, key));
- ATF_REQUIRE(nvlist_existsf_null(nvl, "key"));
+ ATF_REQUIRE(nvlist_exists_null(nvl, "key"));
/* Iterate over the nvlist; ensure that it has only our one key. */
it = NULL;
@@ -108,11 +107,10 @@ ATF_TEST_CASE_BODY(nvlist_add_bool__single_insert)
ATF_REQUIRE(!nvlist_empty(nvl));
ATF_REQUIRE(nvlist_exists(nvl, key));
- ATF_REQUIRE(nvlist_existsf(nvl, "%s%s", "na", "me"));
+ ATF_REQUIRE(nvlist_exists(nvl, "name"));
ATF_REQUIRE(nvlist_exists_bool(nvl, key));
- ATF_REQUIRE(nvlist_existsf_bool(nvl, "%s%c", "nam", 'e'));
+ ATF_REQUIRE(nvlist_exists_bool(nvl, "name"));
ATF_REQUIRE_EQ(nvlist_get_bool(nvl, key), true);
- ATF_REQUIRE_EQ(nvlist_getf_bool(nvl, "%c%s", 'n', "ame"), true);
/* Iterate over the nvlist; ensure that it has only our one key. */
it = NULL;
@@ -143,11 +141,9 @@ ATF_TEST_CASE_BODY(nvlist_add_number__single_insert)
ATF_REQUIRE(!nvlist_empty(nvl));
ATF_REQUIRE(nvlist_exists(nvl, key));
- ATF_REQUIRE(nvlist_existsf(nvl, "%s%d", "foo", 123));
+ ATF_REQUIRE(nvlist_exists(nvl, "foo123"));
ATF_REQUIRE(nvlist_exists_number(nvl, key));
- ATF_REQUIRE(nvlist_existsf_number(nvl, "%s", key));
ATF_REQUIRE_EQ(nvlist_get_number(nvl, key), value);
- ATF_REQUIRE_EQ(nvlist_getf_number(nvl, "%s", key), value);
/* Iterate over the nvlist; ensure that it has only our one key. */
it = NULL;
@@ -178,11 +174,10 @@ ATF_TEST_CASE_BODY(nvlist_add_string__single_insert)
ATF_REQUIRE(!nvlist_empty(nvl));
ATF_REQUIRE(nvlist_exists(nvl, key));
- ATF_REQUIRE(nvlist_existsf(nvl, "%s", key));
+ ATF_REQUIRE(nvlist_exists(nvl, "test"));
ATF_REQUIRE(nvlist_exists_string(nvl, key));
- ATF_REQUIRE(nvlist_existsf_string(nvl, "%s", key));
+ ATF_REQUIRE(nvlist_exists_string(nvl, "test"));
ATF_REQUIRE_EQ(strcmp(nvlist_get_string(nvl, key), value), 0);
- ATF_REQUIRE_EQ(strcmp(nvlist_getf_string(nvl, "%s", key), value), 0);
/* nvlist_add_* is required to clone the value, so check for that. */
ATF_REQUIRE(nvlist_get_string(nvl, key) != value);
@@ -219,9 +214,9 @@ ATF_TEST_CASE_BODY(nvlist_add_nvlist__single_insert)
ATF_REQUIRE(!nvlist_empty(nvl));
ATF_REQUIRE(nvlist_exists(nvl, key));
- ATF_REQUIRE(nvlist_existsf(nvl, "%s", key));
+ ATF_REQUIRE(nvlist_exists(nvl, "test"));
ATF_REQUIRE(nvlist_exists_nvlist(nvl, key));
- ATF_REQUIRE(nvlist_existsf_nvlist(nvl, "%s", key));
+ ATF_REQUIRE(nvlist_exists_nvlist(nvl, "test"));
value = nvlist_get_nvlist(nvl, key);
ATF_REQUIRE(nvlist_exists_null(value, subkey));
@@ -229,10 +224,6 @@ ATF_TEST_CASE_BODY(nvlist_add_nvlist__single_insert)
/* nvlist_add_* is required to clone the value, so check for that. */
ATF_REQUIRE(sublist != value);
- value = nvlist_getf_nvlist(nvl, "%s", key);
- ATF_REQUIRE(nvlist_exists_null(value, subkey));
- ATF_REQUIRE(sublist != value);
-
/* Iterate over the nvlist; ensure that it has only our one key. */
it = NULL;
ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0);
@@ -283,9 +274,9 @@ ATF_TEST_CASE_BODY(nvlist_add_binary__single_insert)
ATF_REQUIRE(!nvlist_empty(nvl));
ATF_REQUIRE(nvlist_exists(nvl, key));
- ATF_REQUIRE(nvlist_existsf(nvl, "%s", key));
+ ATF_REQUIRE(nvlist_exists(nvl, "binary"));
ATF_REQUIRE(nvlist_exists_binary(nvl, key));
- ATF_REQUIRE(nvlist_existsf_binary(nvl, "%s", key));
+ ATF_REQUIRE(nvlist_exists_binary(nvl, "binary"));
ret_value = nvlist_get_binary(nvl, key, &ret_size);
ATF_REQUIRE_EQ(value_size, ret_size);
@@ -294,11 +285,6 @@ ATF_TEST_CASE_BODY(nvlist_add_binary__single_insert)
/* nvlist_add_* is required to clone the value, so check for that. */
ATF_REQUIRE(value != ret_value);
- ret_value = nvlist_getf_binary(nvl, &ret_size, "%s", key);
- ATF_REQUIRE_EQ(value_size, ret_size);
- ATF_REQUIRE_EQ(memcmp(value, ret_value, ret_size), 0);
- ATF_REQUIRE(value != ret_value);
-
/* Iterate over the nvlist; ensure that it has only our one key. */
it = NULL;
ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0);
OpenPOWER on IntegriCloud