summaryrefslogtreecommitdiffstats
path: root/src/CompositeChat.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-06-11 22:20:04 +0200
committerMattes D <github@xoft.cz>2015-06-11 22:20:04 +0200
commitd390214929f4b280cc66cdbc170694ec9b1fa8c4 (patch)
tree3c49c75771ffd8931f47b895b2bd31014f7885d8 /src/CompositeChat.cpp
parentMerge pull request #2162 from lkolbly/master (diff)
downloadcuberite-d390214929f4b280cc66cdbc170694ec9b1fa8c4.tar
cuberite-d390214929f4b280cc66cdbc170694ec9b1fa8c4.tar.gz
cuberite-d390214929f4b280cc66cdbc170694ec9b1fa8c4.tar.bz2
cuberite-d390214929f4b280cc66cdbc170694ec9b1fa8c4.tar.lz
cuberite-d390214929f4b280cc66cdbc170694ec9b1fa8c4.tar.xz
cuberite-d390214929f4b280cc66cdbc170694ec9b1fa8c4.tar.zst
cuberite-d390214929f4b280cc66cdbc170694ec9b1fa8c4.zip
Diffstat (limited to 'src/CompositeChat.cpp')
-rw-r--r--src/CompositeChat.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/CompositeChat.cpp b/src/CompositeChat.cpp
index 5d6c028ab..353835039 100644
--- a/src/CompositeChat.cpp
+++ b/src/CompositeChat.cpp
@@ -6,6 +6,7 @@
#include "Globals.h"
#include "CompositeChat.h"
#include "ClientHandle.h"
+#include "SelfTests.h"
@@ -19,16 +20,14 @@ class SelfTest_CompositeChat
public:
SelfTest_CompositeChat(void)
{
- fprintf(stderr, "cCompositeChat self test...\n");
- TestParser1();
- TestParser2();
- TestParser3();
- TestParser4();
- TestParser5();
- fprintf(stderr, "cCompositeChat self test finished.\n");
+ cSelfTests::Get().Register(cSelfTests::SelfTestFunction(&TestParser1), "CompositeChat parser test 1");
+ cSelfTests::Get().Register(cSelfTests::SelfTestFunction(&TestParser2), "CompositeChat parser test 2");
+ cSelfTests::Get().Register(cSelfTests::SelfTestFunction(&TestParser3), "CompositeChat parser test 3");
+ cSelfTests::Get().Register(cSelfTests::SelfTestFunction(&TestParser4), "CompositeChat parser test 4");
+ cSelfTests::Get().Register(cSelfTests::SelfTestFunction(&TestParser5), "CompositeChat parser test 5");
}
- void TestParser1(void)
+ static void TestParser1(void)
{
cCompositeChat Msg;
Msg.ParseText("Testing @2color codes and http://links parser");
@@ -44,7 +43,7 @@ public:
assert_test(Parts[3]->m_Style == "@2");
}
- void TestParser2(void)
+ static void TestParser2(void)
{
cCompositeChat Msg;
Msg.ParseText("@3Advanced stuff: @5overriding color codes and http://links.with/@4color-in-them handling");
@@ -60,7 +59,7 @@ public:
assert_test(Parts[3]->m_Style == "@5");
}
- void TestParser3(void)
+ static void TestParser3(void)
{
cCompositeChat Msg;
Msg.ParseText("http://links.starting the text");
@@ -72,7 +71,7 @@ public:
assert_test(Parts[1]->m_Style == "");
}
- void TestParser4(void)
+ static void TestParser4(void)
{
cCompositeChat Msg;
Msg.ParseText("links finishing the text: http://some.server");
@@ -84,7 +83,7 @@ public:
assert_test(Parts[1]->m_Style == "");
}
- void TestParser5(void)
+ static void TestParser5(void)
{
cCompositeChat Msg;
Msg.ParseText("http://only.links");