1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-26 21:06:38 +02:00

core: add function gui_buffer_search_by_id (issue #2081)

This commit is contained in:
Sébastien Helleu
2024-03-07 07:32:27 +01:00
parent c71e6a50eb
commit 5af0415508
3 changed files with 44 additions and 0 deletions
+23
View File
@@ -1313,6 +1313,29 @@ TEST(GuiBuffer, SearchMain)
gui_buffer_close (buffer);
}
/*
* 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