From 2e4933dcd5a07f42d130c3cff4d8ebf13c3953d6 Mon Sep 17 00:00:00 2001 From: Tobia Tesan Date: Fri, 19 Apr 2013 00:56:28 +0200 Subject: TEST: reorganize test/common/util.h Split a few test cases in two. The resulting file is now better organized. --- test/common/util.h | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/common/util.h b/test/common/util.h index c11ab740de..3bd997a38f 100644 --- a/test/common/util.h +++ b/test/common/util.h @@ -4,16 +4,16 @@ class UtilTestSuite : public CxxTest::TestSuite { public: - void test_parsebool_good() { + // Test the parseBool function - // Test the parseBool function + // 'Regular' cases that must work + // (note that the function must be case insensitive): + + void test_parsebool_yesno() { bool valasbool; bool success; - // 'Regular' cases that must work - // (note that the function must be case insensitive): - Common::String string_1 ("Yes"); success = Common::parseBool (string_1, valasbool); TS_ASSERT_EQUALS(success, 1); @@ -23,6 +23,12 @@ public: success = Common::parseBool (string_2, valasbool); TS_ASSERT_EQUALS(success, 1); TS_ASSERT_EQUALS(valasbool, 0); + } + + void test_parsebool_truefalse() { + + bool valasbool; + bool success; Common::String string_3 ("tRuE"); success = Common::parseBool (string_3, valasbool); @@ -33,6 +39,12 @@ public: success = Common::parseBool (string_4, valasbool); TS_ASSERT_EQUALS(success, 1); TS_ASSERT_EQUALS(valasbool, 0); + } + + void test_parsebool_onezero() { + + bool valasbool; + bool success; Common::String string_5 ("1"); success = Common::parseBool (string_5, valasbool); -- cgit v1.2.3