1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-30 14:56:39 +02:00

core: add function hdata_count

This commit is contained in:
Sébastien Helleu
2024-06-11 10:15:03 +02:00
parent 24e023d467
commit 8945b7bf33
3 changed files with 37 additions and 0 deletions
+15
View File
@@ -1728,6 +1728,21 @@ TEST(CoreHdataWithList, Search)
hashtable_free (extra_vars);
}
/*
* Tests functions:
* hdata_count
*/
TEST(CoreHdataWithList, Count)
{
LONGS_EQUAL(0, hdata_count (NULL, NULL));
LONGS_EQUAL(0, hdata_count (ptr_hdata, NULL));
LONGS_EQUAL(0, hdata_count (NULL, items));
LONGS_EQUAL(2, hdata_count (ptr_hdata, items));
LONGS_EQUAL(1, hdata_count (ptr_hdata, ptr_item2));
}
/*
* Tests functions:
* hdata_get_index_and_name