summaryrefslogtreecommitdiffstats
path: root/src/CompositeChat.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-03-15 02:46:18 +0100
committerHowaner <franzi.moos@googlemail.com>2014-03-15 02:46:18 +0100
commit8316ae330ec06b19caf678b9d499afd198fe5a06 (patch)
tree9e120574de49e90f970910ffe743e8169d762ceb /src/CompositeChat.cpp
parentAdd item frame saving. (diff)
parentIgnoring all config and SQLite files in the output folder. (diff)
downloadcuberite-8316ae330ec06b19caf678b9d499afd198fe5a06.tar
cuberite-8316ae330ec06b19caf678b9d499afd198fe5a06.tar.gz
cuberite-8316ae330ec06b19caf678b9d499afd198fe5a06.tar.bz2
cuberite-8316ae330ec06b19caf678b9d499afd198fe5a06.tar.lz
cuberite-8316ae330ec06b19caf678b9d499afd198fe5a06.tar.xz
cuberite-8316ae330ec06b19caf678b9d499afd198fe5a06.tar.zst
cuberite-8316ae330ec06b19caf678b9d499afd198fe5a06.zip
Diffstat (limited to 'src/CompositeChat.cpp')
-rw-r--r--src/CompositeChat.cpp64
1 files changed, 32 insertions, 32 deletions
diff --git a/src/CompositeChat.cpp b/src/CompositeChat.cpp
index 3eec35657..a917ee70f 100644
--- a/src/CompositeChat.cpp
+++ b/src/CompositeChat.cpp
@@ -10,7 +10,7 @@
-#if SELF_TEST
+#ifdef SELF_TEST
/** A simple self-test that verifies that the composite chat parser is working properly. */
class SelfTest_CompositeChat
@@ -32,15 +32,15 @@ public:
cCompositeChat Msg;
Msg.ParseText("Testing @2color codes and http://links parser");
const cCompositeChat::cParts & Parts = Msg.GetParts();
- assert(Parts.size() == 4);
- assert(Parts[0]->m_PartType == cCompositeChat::ptText);
- assert(Parts[1]->m_PartType == cCompositeChat::ptText);
- assert(Parts[2]->m_PartType == cCompositeChat::ptUrl);
- assert(Parts[3]->m_PartType == cCompositeChat::ptText);
- assert(Parts[0]->m_Style == "");
- assert(Parts[1]->m_Style == "@2");
- assert(Parts[2]->m_Style == "@2");
- assert(Parts[3]->m_Style == "@2");
+ assert_test(Parts.size() == 4);
+ assert_test(Parts[0]->m_PartType == cCompositeChat::ptText);
+ assert_test(Parts[1]->m_PartType == cCompositeChat::ptText);
+ assert_test(Parts[2]->m_PartType == cCompositeChat::ptUrl);
+ assert_test(Parts[3]->m_PartType == cCompositeChat::ptText);
+ assert_test(Parts[0]->m_Style == "");
+ assert_test(Parts[1]->m_Style == "@2");
+ assert_test(Parts[2]->m_Style == "@2");
+ assert_test(Parts[3]->m_Style == "@2");
}
void TestParser2(void)
@@ -48,15 +48,15 @@ public:
cCompositeChat Msg;
Msg.ParseText("@3Advanced stuff: @5overriding color codes and http://links.with/@4color-in-them handling");
const cCompositeChat::cParts & Parts = Msg.GetParts();
- assert(Parts.size() == 4);
- assert(Parts[0]->m_PartType == cCompositeChat::ptText);
- assert(Parts[1]->m_PartType == cCompositeChat::ptText);
- assert(Parts[2]->m_PartType == cCompositeChat::ptUrl);
- assert(Parts[3]->m_PartType == cCompositeChat::ptText);
- assert(Parts[0]->m_Style == "@3");
- assert(Parts[1]->m_Style == "@5");
- assert(Parts[2]->m_Style == "@5");
- assert(Parts[3]->m_Style == "@5");
+ assert_test(Parts.size() == 4);
+ assert_test(Parts[0]->m_PartType == cCompositeChat::ptText);
+ assert_test(Parts[1]->m_PartType == cCompositeChat::ptText);
+ assert_test(Parts[2]->m_PartType == cCompositeChat::ptUrl);
+ assert_test(Parts[3]->m_PartType == cCompositeChat::ptText);
+ assert_test(Parts[0]->m_Style == "@3");
+ assert_test(Parts[1]->m_Style == "@5");
+ assert_test(Parts[2]->m_Style == "@5");
+ assert_test(Parts[3]->m_Style == "@5");
}
void TestParser3(void)
@@ -64,11 +64,11 @@ public:
cCompositeChat Msg;
Msg.ParseText("http://links.starting the text");
const cCompositeChat::cParts & Parts = Msg.GetParts();
- assert(Parts.size() == 2);
- assert(Parts[0]->m_PartType == cCompositeChat::ptUrl);
- assert(Parts[1]->m_PartType == cCompositeChat::ptText);
- assert(Parts[0]->m_Style == "");
- assert(Parts[1]->m_Style == "");
+ assert_test(Parts.size() == 2);
+ assert_test(Parts[0]->m_PartType == cCompositeChat::ptUrl);
+ assert_test(Parts[1]->m_PartType == cCompositeChat::ptText);
+ assert_test(Parts[0]->m_Style == "");
+ assert_test(Parts[1]->m_Style == "");
}
void TestParser4(void)
@@ -76,11 +76,11 @@ public:
cCompositeChat Msg;
Msg.ParseText("links finishing the text: http://some.server");
const cCompositeChat::cParts & Parts = Msg.GetParts();
- assert(Parts.size() == 2);
- assert(Parts[0]->m_PartType == cCompositeChat::ptText);
- assert(Parts[1]->m_PartType == cCompositeChat::ptUrl);
- assert(Parts[0]->m_Style == "");
- assert(Parts[1]->m_Style == "");
+ assert_test(Parts.size() == 2);
+ assert_test(Parts[0]->m_PartType == cCompositeChat::ptText);
+ assert_test(Parts[1]->m_PartType == cCompositeChat::ptUrl);
+ assert_test(Parts[0]->m_Style == "");
+ assert_test(Parts[1]->m_Style == "");
}
void TestParser5(void)
@@ -88,9 +88,9 @@ public:
cCompositeChat Msg;
Msg.ParseText("http://only.links");
const cCompositeChat::cParts & Parts = Msg.GetParts();
- assert(Parts.size() == 1);
- assert(Parts[0]->m_PartType == cCompositeChat::ptUrl);
- assert(Parts[0]->m_Style == "");
+ assert_test(Parts.size() == 1);
+ assert_test(Parts[0]->m_PartType == cCompositeChat::ptUrl);
+ assert_test(Parts[0]->m_Style == "");
}
} gTest;