aboutsummaryrefslogtreecommitdiff
path: root/src/unittest
diff options
context:
space:
mode:
Diffstat (limited to 'src/unittest')
-rw-r--r--src/unittest/test_gameui.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/unittest/test_gameui.cpp b/src/unittest/test_gameui.cpp
index d52977469..9bc9d8cf5 100644
--- a/src/unittest/test_gameui.cpp
+++ b/src/unittest/test_gameui.cpp
@@ -31,6 +31,8 @@ public:
void testInit();
void testFlagSetters();
+ void testInfoText();
+ void testStatusText();
};
static TestGameUI g_test_instance;
@@ -39,6 +41,8 @@ void TestGameUI::runTests(IGameDef *gamedef)
{
TEST(testInit);
TEST(testFlagSetters);
+ TEST(testInfoText);
+ TEST(testStatusText);
}
void TestGameUI::testInit()
@@ -61,3 +65,20 @@ void TestGameUI::testFlagSetters()
gui.showMinimap(false);
UASSERT(!gui.getFlags().show_minimap);
}
+
+void TestGameUI::testStatusText()
+{
+ GameUI gui{};
+ gui.showStatusText(L"test status");
+
+ UASSERT(gui.m_statustext_time == 0.0f);
+ UASSERT(gui.m_statustext == L"test status");
+}
+
+void TestGameUI::testInfoText()
+{
+ GameUI gui{};
+ gui.setInfoText(L"test info");
+
+ UASSERT(gui.m_infotext == L"test info");
+}