From 328eeee5e1a5e8cb9558e17c9ffd6a1b7307a627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Thu, 14 Aug 2014 19:09:27 +0200 Subject: [PATCH] tests: add partial tests of functions hashtable_set* --- tests/unit/core/test-hashtable.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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); } /*