summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am4
-rw-r--r--src/utils/xmlutils_unittest.cc24
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]);
}