diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2024-03-07 07:32:27 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2024-03-12 20:37:42 +0100 |
commit | 5af0415508b0ecaca0c07640be10250dff59623a (patch) | |
tree | 0e7df43518b1811f4517e36fb7f1caa5fd3395fd /tests | |
parent | c71e6a50eb87bc1546b85e287fce4758f7957e30 (diff) | |
download | weechat-5af0415508b0ecaca0c07640be10250dff59623a.zip |
core: add function gui_buffer_search_by_id (issue #2081)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/gui/test-gui-buffer.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/unit/gui/test-gui-buffer.cpp b/tests/unit/gui/test-gui-buffer.cpp index 5093a14b3..1c4e1131b 100644 --- a/tests/unit/gui/test-gui-buffer.cpp +++ b/tests/unit/gui/test-gui-buffer.cpp @@ -1315,6 +1315,29 @@ TEST(GuiBuffer, SearchMain) /* * Tests functions: + * gui_buffer_search_by_id + */ + +TEST(GuiBuffer, SearchById) +{ + struct t_gui_buffer *buffer; + + buffer = gui_buffer_new (NULL, TEST_BUFFER_NAME, + NULL, NULL, NULL, + NULL, NULL, NULL); + CHECK(buffer); + + POINTERS_EQUAL(NULL, gui_buffer_search_by_id (-1)); + POINTERS_EQUAL(NULL, gui_buffer_search_by_id (0)); + + POINTERS_EQUAL(gui_buffers, gui_buffer_search_by_id (gui_buffers->id)); + POINTERS_EQUAL(buffer, gui_buffer_search_by_id (buffer->id)); + + gui_buffer_close (buffer); +} + +/* + * Tests functions: * gui_buffer_search_by_full_name */ |