summaryrefslogtreecommitdiff
path: root/tests/unit/gui
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2023-02-04 10:45:57 +0100
committerSébastien Helleu <flashcode@flashtux.org>2023-02-04 10:45:57 +0100
commit6d4471b6db25ad1921266930a0d2b42abcff7851 (patch)
treecc979a7b32e3af69ec9e74d0a28e1c44447ae366 /tests/unit/gui
parent587e2882ac9cf97b4842721d28d6550aa4bc08ad (diff)
downloadweechat-6d4471b6db25ad1921266930a0d2b42abcff7851.zip
core: optimize search of key bindings in contexts default/search/cursor
Diffstat (limited to 'tests/unit/gui')
-rw-r--r--tests/unit/gui/test-gui-key.cpp48
1 files changed, 0 insertions, 48 deletions
diff --git a/tests/unit/gui/test-gui-key.cpp b/tests/unit/gui/test-gui-key.cpp
index e0ddc9d64..98735ca2e 100644
--- a/tests/unit/gui/test-gui-key.cpp
+++ b/tests/unit/gui/test-gui-key.cpp
@@ -26,8 +26,6 @@
extern "C"
{
#include "src/gui/gui-key.h"
-
-extern int gui_key_cmp (const char *key, const char *search, int context);
}
TEST_GROUP(GuiKey)
@@ -230,52 +228,6 @@ TEST(GuiKey, Search)
/*
* Tests functions:
- * gui_key_cmp
- */
-
-TEST(GuiKey, Cmp)
-{
- LONGS_EQUAL(0, gui_key_cmp ("", "", GUI_KEY_CONTEXT_DEFAULT));
- LONGS_EQUAL(0, gui_key_cmp ("a", "", GUI_KEY_CONTEXT_DEFAULT));
- LONGS_EQUAL(-97, gui_key_cmp ("", "a", GUI_KEY_CONTEXT_DEFAULT));
- LONGS_EQUAL(0, gui_key_cmp ("a", "a", GUI_KEY_CONTEXT_DEFAULT));
- LONGS_EQUAL(32, gui_key_cmp ("meta-a", "meta-A", GUI_KEY_CONTEXT_DEFAULT));
- LONGS_EQUAL(-99, gui_key_cmp ("meta-a", "meta-ac", GUI_KEY_CONTEXT_DEFAULT));
- LONGS_EQUAL(0, gui_key_cmp ("meta-ac", "meta-a", GUI_KEY_CONTEXT_DEFAULT));
-
- LONGS_EQUAL(0, gui_key_cmp ("", "", GUI_KEY_CONTEXT_SEARCH));
- LONGS_EQUAL(0, gui_key_cmp ("a", "", GUI_KEY_CONTEXT_SEARCH));
- LONGS_EQUAL(-97, gui_key_cmp ("", "a", GUI_KEY_CONTEXT_SEARCH));
- LONGS_EQUAL(0, gui_key_cmp ("a", "a", GUI_KEY_CONTEXT_SEARCH));
- LONGS_EQUAL(32, gui_key_cmp ("meta-a", "meta-A", GUI_KEY_CONTEXT_SEARCH));
- LONGS_EQUAL(-99, gui_key_cmp ("meta-a", "meta-ac", GUI_KEY_CONTEXT_SEARCH));
- LONGS_EQUAL(0, gui_key_cmp ("meta-ac", "meta-a", GUI_KEY_CONTEXT_SEARCH));
-
- LONGS_EQUAL(0, gui_key_cmp ("", "", GUI_KEY_CONTEXT_CURSOR));
- LONGS_EQUAL(0, gui_key_cmp ("a", "", GUI_KEY_CONTEXT_CURSOR));
- LONGS_EQUAL(-97, gui_key_cmp ("", "a", GUI_KEY_CONTEXT_CURSOR));
- LONGS_EQUAL(0, gui_key_cmp ("a", "a", GUI_KEY_CONTEXT_CURSOR));
- LONGS_EQUAL(32, gui_key_cmp ("meta-a", "meta-A", GUI_KEY_CONTEXT_CURSOR));
- LONGS_EQUAL(-99, gui_key_cmp ("meta-a", "meta-ac", GUI_KEY_CONTEXT_CURSOR));
- LONGS_EQUAL(0, gui_key_cmp ("meta-ac", "meta-a", GUI_KEY_CONTEXT_CURSOR));
-
- LONGS_EQUAL(1, gui_key_cmp ("", "", GUI_KEY_CONTEXT_MOUSE));
- LONGS_EQUAL(1, gui_key_cmp ("a", "", GUI_KEY_CONTEXT_MOUSE));
- LONGS_EQUAL(1, gui_key_cmp ("", "a", GUI_KEY_CONTEXT_MOUSE));
- LONGS_EQUAL(0, gui_key_cmp ("a", "a", GUI_KEY_CONTEXT_MOUSE));
- LONGS_EQUAL(0, gui_key_cmp ("@chat(fset.fset):button2",
- "@chat(fset.fset):button2",
- GUI_KEY_CONTEXT_MOUSE));
- LONGS_EQUAL(0, gui_key_cmp ("@chat(fset.fset):button2-gesture-right",
- "@chat(fset.fset):button2*",
- GUI_KEY_CONTEXT_MOUSE));
- LONGS_EQUAL(1, gui_key_cmp ("@chat(Fset.fset):button2-gesture-right",
- "@chat(fset.fset):button2*",
- GUI_KEY_CONTEXT_MOUSE));
-}
-
-/*
- * Tests functions:
* gui_key_search_part
*/