Update tests for new check library & osx
This commit is contained in:
@@ -40,6 +40,7 @@ struct MyString *my_find(struct UHTable *table, const char *str, size_t hash)
|
||||
|
||||
|
||||
START_TEST (test_htable1)
|
||||
{
|
||||
struct MyString str[5] = {
|
||||
{"One", {0,NULL}},
|
||||
{"Two", {0,NULL}},
|
||||
@@ -67,9 +68,11 @@ START_TEST (test_htable1)
|
||||
|
||||
uc_htable_destroy(&table);
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST (test_htable_hash_collision)
|
||||
{
|
||||
//same as test1 but with a bad hash to force equal hash
|
||||
struct MyString str[5] = {
|
||||
{"...", {0,NULL}},
|
||||
@@ -97,9 +100,11 @@ START_TEST (test_htable_hash_collision)
|
||||
|
||||
uc_htable_destroy(&table);
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST (test_htable_resize)
|
||||
{
|
||||
struct MyString str[5] = {
|
||||
{"One", {0,NULL}},
|
||||
{"Two", {0,NULL}},
|
||||
@@ -132,9 +137,11 @@ START_TEST (test_htable_resize)
|
||||
|
||||
uc_htable_destroy(&table);
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST (test_htable_fail_init_resize)
|
||||
{
|
||||
int rc;
|
||||
struct UHTable table;
|
||||
rc = uc_htable_init(&table, 0);
|
||||
@@ -148,9 +155,11 @@ START_TEST (test_htable_fail_init_resize)
|
||||
|
||||
uc_htable_destroy(&table);
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST (test_htable_has_node)
|
||||
{
|
||||
struct MyString str1 = {"One", {0,NULL}};
|
||||
struct MyString str2 = {"Two", {0,NULL}};
|
||||
|
||||
@@ -171,9 +180,11 @@ START_TEST (test_htable_has_node)
|
||||
|
||||
uc_htable_destroy(&table);
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST (test_htable_remove)
|
||||
{
|
||||
struct MyString str1 = {"One", {0,NULL}};
|
||||
struct MyString str2 = {"One", {0,NULL}};
|
||||
struct MyString str3 = {"Other", {0,NULL}};
|
||||
@@ -216,9 +227,11 @@ START_TEST (test_htable_remove)
|
||||
|
||||
uc_htable_destroy(&table);
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST (test_htable_remove_foreach)
|
||||
{
|
||||
struct MyString str1 = {"One", {0,NULL}};
|
||||
struct MyString str2 = {"One", {0,NULL}};
|
||||
struct MyString str3 = {"Other", {0,NULL}};
|
||||
@@ -254,9 +267,11 @@ START_TEST (test_htable_remove_foreach)
|
||||
|
||||
uc_htable_destroy(&table);
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST (test_htable_clear)
|
||||
{
|
||||
struct MyString str1 = {"One", {0,NULL}};
|
||||
|
||||
struct UHTable table;
|
||||
@@ -276,9 +291,11 @@ START_TEST (test_htable_clear)
|
||||
|
||||
uc_htable_destroy(&table);
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST (test_htable_foreach)
|
||||
{
|
||||
struct MyString str1 = {"One", {0,NULL}};
|
||||
struct MyString str2 = {"One", {0,NULL}};
|
||||
struct MyString str3 = {"Other",{0,NULL}};
|
||||
@@ -318,9 +335,11 @@ START_TEST (test_htable_foreach)
|
||||
|
||||
uc_htable_destroy(&table);
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST (test_htable_foreach_safe)
|
||||
{
|
||||
struct MyString str1 = {"One", {0,NULL}};
|
||||
struct MyString str2 = {"One", {0,NULL}};
|
||||
struct MyString str3 = {"Other",{0,NULL}};
|
||||
@@ -353,6 +372,7 @@ START_TEST (test_htable_foreach_safe)
|
||||
|
||||
uc_htable_destroy(&table);
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
Suite *htable_suite(void)
|
||||
|
||||
Reference in New Issue
Block a user