diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2014-08-14 19:09:27 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2014-08-14 19:09:27 +0200 |
commit | 328eeee5e1a5e8cb9558e17c9ffd6a1b7307a627 (patch) | |
tree | 9e3af773d08b5da3ea282d115d4dbed233f73ab1 | |
parent | 346fb62cf6c22a9b92a4ff470ecd8304a7b8a3f7 (diff) | |
download | weechat-328eeee5e1a5e8cb9558e17c9ffd6a1b7307a627.zip |
tests: add partial tests of functions hashtable_set*
-rw-r--r-- | tests/unit/core/test-hashtable.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/unit/core/test-hashtable.cpp b/tests/unit/core/test-hashtable.cpp index a1b624cb9..fb030f2ba 100644 --- a/tests/unit/core/test-hashtable.cpp +++ b/tests/unit/core/test-hashtable.cpp @@ -123,7 +123,21 @@ TEST(Hashtable, New) TEST(Hashtable, Set) { - /* TODO: write tests */ + struct t_hashtable *hashtable; + struct t_hashtable_item *item; + const char *value = "this is a string"; + + hashtable = hashtable_new (32, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_STRING, + &test_hashtable_hash_key_cb, + &test_hashtable_keycmp_cb); + POINTERS_EQUAL(NULL, hashtable_set_with_size (NULL, NULL, -1, NULL, -1)); + POINTERS_EQUAL(NULL, hashtable_set_with_size (NULL, NULL, -1, NULL, -1)); + + /* TODO: write more tests */ + + hashtable_free (hashtable); } /* |