aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@bitpay.com>2014-08-20 01:09:21 -0400
committerJeff Garzik <jgarzik@bitpay.com>2014-08-20 01:09:21 -0400
commitdc271fc025d219c18428a4d36dbc372c8e457908 (patch)
treeaecb892909c9844809d371d1fd70ca20e43ef1a3 /src
parente85267be6306a54a0cfe0055c88b0b753f7d68cd (diff)
UniValue tests: use more BOOST_CHECK()
Diffstat (limited to 'src')
-rw-r--r--src/test/univalue_tests.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/test/univalue_tests.cpp b/src/test/univalue_tests.cpp
index 25d1df3431..23bc5f6b12 100644
--- a/src/test/univalue_tests.cpp
+++ b/src/test/univalue_tests.cpp
@@ -28,37 +28,37 @@ BOOST_AUTO_TEST_CASE(univalue_constructor)
UniValue numTest;
BOOST_CHECK(numTest.setNumStr("82"));
- BOOST_CHECK_EQUAL(numTest.isNum(), true);
+ BOOST_CHECK(numTest.isNum());
BOOST_CHECK_EQUAL(numTest.getValStr(), "82");
uint64_t vu64 = 82;
UniValue v4(vu64);
- BOOST_CHECK_EQUAL(v4.isNum(), true);
+ BOOST_CHECK(v4.isNum());
BOOST_CHECK_EQUAL(v4.getValStr(), "82");
int64_t vi64 = -82;
UniValue v5(vi64);
- BOOST_CHECK_EQUAL(v5.isNum(), true);
+ BOOST_CHECK(v5.isNum());
BOOST_CHECK_EQUAL(v5.getValStr(), "-82");
int vi = -688;
UniValue v6(vi);
- BOOST_CHECK_EQUAL(v6.isNum(), true);
+ BOOST_CHECK(v6.isNum());
BOOST_CHECK_EQUAL(v6.getValStr(), "-688");
double vd = -7.21;
UniValue v7(vd);
- BOOST_CHECK_EQUAL(v7.isNum(), true);
+ BOOST_CHECK(v7.isNum());
BOOST_CHECK_EQUAL(v7.getValStr(), "-7.21");
string vs("yawn");
UniValue v8(vs);
- BOOST_CHECK_EQUAL(v8.isStr(), true);
+ BOOST_CHECK(v8.isStr());
BOOST_CHECK_EQUAL(v8.getValStr(), "yawn");
const char *vcs = "zappa";
UniValue v9(vcs);
- BOOST_CHECK_EQUAL(v9.isStr(), true);
+ BOOST_CHECK(v9.isStr());
BOOST_CHECK_EQUAL(v9.getValStr(), "zappa");
}
@@ -66,41 +66,41 @@ BOOST_AUTO_TEST_CASE(univalue_set)
{
UniValue v(UniValue::VSTR, "foo");
v.clear();
- BOOST_CHECK_EQUAL(v.isNull(), true);
+ BOOST_CHECK(v.isNull());
BOOST_CHECK_EQUAL(v.getValStr(), "");
BOOST_CHECK(v.setObject());
- BOOST_CHECK_EQUAL(v.isObject(), true);
+ BOOST_CHECK(v.isObject());
BOOST_CHECK_EQUAL(v.count(), 0);
BOOST_CHECK_EQUAL(v.getType(), UniValue::VOBJ);
- BOOST_CHECK_EQUAL(v.empty(), true);
+ BOOST_CHECK(v.empty());
BOOST_CHECK(v.setArray());
- BOOST_CHECK_EQUAL(v.isArray(), true);
+ BOOST_CHECK(v.isArray());
BOOST_CHECK_EQUAL(v.count(), 0);
BOOST_CHECK(v.setStr("zum"));
- BOOST_CHECK_EQUAL(v.isStr(), true);
+ BOOST_CHECK(v.isStr());
BOOST_CHECK_EQUAL(v.getValStr(), "zum");
BOOST_CHECK(v.setFloat(-1.01));
- BOOST_CHECK_EQUAL(v.isNum(), true);
+ BOOST_CHECK(v.isNum());
BOOST_CHECK_EQUAL(v.getValStr(), "-1.01");
BOOST_CHECK(v.setInt((int)1023));
- BOOST_CHECK_EQUAL(v.isNum(), true);
+ BOOST_CHECK(v.isNum());
BOOST_CHECK_EQUAL(v.getValStr(), "1023");
BOOST_CHECK(v.setInt((int64_t)-1023LL));
- BOOST_CHECK_EQUAL(v.isNum(), true);
+ BOOST_CHECK(v.isNum());
BOOST_CHECK_EQUAL(v.getValStr(), "-1023");
BOOST_CHECK(v.setInt((uint64_t)1023ULL));
- BOOST_CHECK_EQUAL(v.isNum(), true);
+ BOOST_CHECK(v.isNum());
BOOST_CHECK_EQUAL(v.getValStr(), "1023");
BOOST_CHECK(v.setNumStr("-688"));
- BOOST_CHECK_EQUAL(v.isNum(), true);
+ BOOST_CHECK(v.isNum());
BOOST_CHECK_EQUAL(v.getValStr(), "-688");
BOOST_CHECK(v.setBool(false));
@@ -118,7 +118,7 @@ BOOST_AUTO_TEST_CASE(univalue_set)
BOOST_CHECK(!v.setNumStr("zombocom"));
BOOST_CHECK(v.setNull());
- BOOST_CHECK_EQUAL(v.isNull(), true);
+ BOOST_CHECK(v.isNull());
}
BOOST_AUTO_TEST_CASE(univalue_array)
@@ -155,7 +155,7 @@ BOOST_AUTO_TEST_CASE(univalue_array)
BOOST_CHECK_EQUAL(arr[999].getValStr(), "");
arr.clear();
- BOOST_CHECK_EQUAL(arr.empty(), true);
+ BOOST_CHECK(arr.empty());
BOOST_CHECK_EQUAL(arr.count(), 0);
}
@@ -238,7 +238,7 @@ BOOST_AUTO_TEST_CASE(univalue_object)
BOOST_CHECK(!obj.checkObject(objTypes));
obj.clear();
- BOOST_CHECK_EQUAL(obj.empty(), true);
+ BOOST_CHECK(obj.empty());
BOOST_CHECK_EQUAL(obj.count(), 0);
}