From 44ec7e8cfa1ee5b5ccea9b9a81e2394af55a1e54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 13 Mar 2022 13:49:18 +0100 Subject: [PATCH] tests: add tests on functions gui_buffer_search_type and gui_buffer_search_notify --- tests/unit/gui/test-gui-buffer.cpp | 16 ++++++++++++++-- 1 file 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")); } /*