From e54fc3b08b3e8c3be1544a5716bf66e7173f4c21 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 26 May 2015 22:25:54 +0300 Subject: Convert tests for xmlutils into catch format. --- src/utils/xmlutils_unittest.cc | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'src/utils/xmlutils_unittest.cc') 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 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]); } -- cgit v1.2.3-60-g2f50