diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-05-26 22:25:54 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-05-26 22:43:52 +0300 |
commit | e54fc3b08b3e8c3be1544a5716bf66e7173f4c21 (patch) | |
tree | 41e15c1e1a6d4696ea3171e5b2a9ff28ddd991d2 /src | |
parent | 836c2f5107388da9b25be0ed43d8a86d43714669 (diff) | |
download | manaverse-e54fc3b08b3e8c3be1544a5716bf66e7173f4c21.tar.gz manaverse-e54fc3b08b3e8c3be1544a5716bf66e7173f4c21.tar.bz2 manaverse-e54fc3b08b3e8c3be1544a5716bf66e7173f4c21.tar.xz manaverse-e54fc3b08b3e8c3be1544a5716bf66e7173f4c21.zip |
Convert tests for xmlutils into catch format.
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 4 | ||||
-rw-r--r-- | src/utils/xmlutils_unittest.cc | 24 |
2 files changed, 11 insertions, 17 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 06d8ff892..d3eda3912 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1519,8 +1519,8 @@ manaplustests_SOURCES = ${manaplus_SOURCES} \ gui/fonts/textchunklist_unittest.cc \ gui/widgets/browserbox_unittest.cc \ utils/files_unittest.cc \ - utils/stringutils_unittest.cc -# utils/xmlutils_unittest.cc \ + utils/stringutils_unittest.cc \ + utils/xmlutils_unittest.cc # resources/dye_unittest.cc \ # resources/mstack_unittest.cc endif diff --git a/src/utils/xmlutils_unittest.cc b/src/utils/xmlutils_unittest.cc index 82d5d6603..5cf2fad96 100644 --- a/src/utils/xmlutils_unittest.cc +++ b/src/utils/xmlutils_unittest.cc @@ -20,11 +20,10 @@ #include "utils/xmlutils.h" +#include "catch.hpp" #include "client.h" #include "logger.h" -#include "gtest/gtest.h" - #include "utils/physfstools.h" #include "utils/xml.h" @@ -32,8 +31,9 @@ #include "debug.h" -static void init() +TEST_CASE("xmlutils readXmlIntVector 1") { + client = new Client; PHYSFS_init("manaplus"); dirSeparator = "/"; XML::initXML(); @@ -41,12 +41,6 @@ static void init() ResourceManager *resman = ResourceManager::getInstance(); resman->addToSearchPath("data", false); resman->addToSearchPath("../data", false); -} - -TEST(xmlutils, readXmlIntVector1) -{ - client = new Client; - init(); std::vector<int> arr; @@ -57,10 +51,10 @@ TEST(xmlutils, readXmlIntVector1) "value", arr); - EXPECT_EQ(5, arr.size()); - EXPECT_EQ(1, arr[0]); - EXPECT_EQ(15, arr[1]); - EXPECT_EQ(0, arr[2]); - EXPECT_EQ(1, arr[3]); - EXPECT_EQ(1, arr[4]); + REQUIRE(5 == arr.size()); + REQUIRE(1 == arr[0]); + REQUIRE(15 == arr[1]); + REQUIRE(0 == arr[2]); + REQUIRE(1 == arr[3]); + REQUIRE(1 == arr[4]); } |