summaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2022-03-13 13:49:18 +0100
committerSébastien Helleu <flashcode@flashtux.org>2022-03-13 13:49:18 +0100
commit44ec7e8cfa1ee5b5ccea9b9a81e2394af55a1e54 (patch)
treeca1f3cf902e4169768fb14f2844003214333726f /tests/unit
parent4629b17173b104ae1ab125d48ca7e72765ebf228 (diff)
downloadweechat-44ec7e8cfa1ee5b5ccea9b9a81e2394af55a1e54.zip
tests: add tests on functions gui_buffer_search_type and gui_buffer_search_notify
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/gui/test-gui-buffer.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/unit/gui/test-gui-buffer.cpp b/tests/unit/gui/test-gui-buffer.cpp
index 93b1a10b8..1b056ca7b 100644
--- a/tests/unit/gui/test-gui-buffer.cpp
+++ b/tests/unit/gui/test-gui-buffer.cpp
@@ -45,7 +45,12 @@ TEST_GROUP(GuiBuffer)
TEST(GuiBuffer, SearchType)
{
- /* TODO: write tests */
+ LONGS_EQUAL(-1, gui_buffer_search_type (NULL));
+ LONGS_EQUAL(-1, gui_buffer_search_type (""));
+ LONGS_EQUAL(-1, gui_buffer_search_type ("invalid"));
+
+ LONGS_EQUAL(GUI_BUFFER_TYPE_FORMATTED, gui_buffer_search_type ("formatted"));
+ LONGS_EQUAL(GUI_BUFFER_TYPE_FREE, gui_buffer_search_type ("free"));
}
/*
@@ -55,7 +60,14 @@ TEST(GuiBuffer, SearchType)
TEST(GuiBuffer, SearchNotify)
{
- /* TODO: write tests */
+ LONGS_EQUAL(-1, gui_buffer_search_notify (NULL));
+ LONGS_EQUAL(-1, gui_buffer_search_notify (""));
+ LONGS_EQUAL(-1, gui_buffer_search_notify ("invalid"));
+
+ LONGS_EQUAL(GUI_BUFFER_NOTIFY_NONE, gui_buffer_search_notify ("none"));
+ LONGS_EQUAL(GUI_BUFFER_NOTIFY_HIGHLIGHT, gui_buffer_search_notify ("highlight"));
+ LONGS_EQUAL(GUI_BUFFER_NOTIFY_MESSAGE, gui_buffer_search_notify ("message"));
+ LONGS_EQUAL(GUI_BUFFER_NOTIFY_ALL, gui_buffer_search_notify ("all"));
}
/*