From 03371bdd04e25960149946ff7e8b9d5e921b6dc3 Mon Sep 17 00:00:00 2001 From: Paul LeoNerd Evans Date: Thu, 7 Apr 2011 23:31:43 +0100 Subject: Bugfix to termkey_keycmp - implement sense in correct direction --- t/13cmpkey.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 't') diff --git a/t/13cmpkey.c b/t/13cmpkey.c index 75f5ad7..90ff9e1 100644 --- a/t/13cmpkey.c +++ b/t/13cmpkey.c @@ -24,25 +24,25 @@ int main(int argc, char *argv[]) key2.modifiers = TERMKEY_KEYMOD_CTRL; - ok(termkey_keycmp(tk, &key1, &key2) > 0, "cmpkey orders CTRL after nomod"); - ok(termkey_keycmp(tk, &key2, &key1) < 0, "cmpkey orders nomod before CTRL"); + ok(termkey_keycmp(tk, &key1, &key2) < 0, "cmpkey orders CTRL after nomod"); + ok(termkey_keycmp(tk, &key2, &key1) > 0, "cmpkey orders nomod before CTRL"); key2.code.codepoint = 'B'; key2.modifiers = 0; - ok(termkey_keycmp(tk, &key1, &key2) > 0, "cmpkey orders 'B' after 'A'"); - ok(termkey_keycmp(tk, &key2, &key1) < 0, "cmpkey orders 'A' before 'B'"); + ok(termkey_keycmp(tk, &key1, &key2) < 0, "cmpkey orders 'B' after 'A'"); + ok(termkey_keycmp(tk, &key2, &key1) > 0, "cmpkey orders 'A' before 'B'"); key1.modifiers = TERMKEY_KEYMOD_CTRL; - ok(termkey_keycmp(tk, &key1, &key2) > 0, "cmpkey orders nomod 'B' after CTRL 'A'"); - ok(termkey_keycmp(tk, &key2, &key1) < 0, "cmpkey orders CTRL 'A' before nomod 'B'"); + ok(termkey_keycmp(tk, &key1, &key2) < 0, "cmpkey orders nomod 'B' after CTRL 'A'"); + ok(termkey_keycmp(tk, &key2, &key1) > 0, "cmpkey orders CTRL 'A' before nomod 'B'"); key2.type = TERMKEY_TYPE_KEYSYM; key2.code.sym = TERMKEY_SYM_UP; - ok(termkey_keycmp(tk, &key1, &key2) > 0, "cmpkey orders KEYSYM after UNICODE"); - ok(termkey_keycmp(tk, &key2, &key1) < 0, "cmpkey orders UNICODE before KEYSYM"); + ok(termkey_keycmp(tk, &key1, &key2) < 0, "cmpkey orders KEYSYM after UNICODE"); + ok(termkey_keycmp(tk, &key2, &key1) > 0, "cmpkey orders UNICODE before KEYSYM"); termkey_destroy(tk); -- cgit v1.2.3-70-g09d2