tests: standardize naming convention
Use a behavior-driven naming convention for unit tests. Functions are now named using the pattern: [unit]__[verb]__[scenario] The __ works as a semantic separator. Examples: * jid_create__returns__null_from_null() * cmd_connect__shows__usage_when_no_server_value Benefits: * Easy to find all tests associated with a specific function using the mandatory prefix. * Test output in CI now explicitly describes the unit, the expected outcome, and the scenario being tested. Also disabled keyhandlers tests due to missing code in src/ui.
This commit is contained in:
@@ -5,14 +5,14 @@
|
||||
#include "xmpp/chat_session.h"
|
||||
|
||||
void
|
||||
returns_false_when_chat_session_does_not_exist(void** state)
|
||||
chat_session_get__returns__null_when_no_session(void** state)
|
||||
{
|
||||
ChatSession* session = chat_session_get("somejid@server.org");
|
||||
assert_null(session);
|
||||
}
|
||||
|
||||
void
|
||||
creates_chat_session_on_recipient_activity(void** state)
|
||||
chat_session_recipient_active__updates__new_session(void** state)
|
||||
{
|
||||
char* barejid = "myjid@server.org";
|
||||
char* resource = "tablet";
|
||||
@@ -25,7 +25,7 @@ creates_chat_session_on_recipient_activity(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
replaces_chat_session_on_recipient_activity_with_different_resource(void** state)
|
||||
chat_session_recipient_active__updates__replace_resource(void** state)
|
||||
{
|
||||
char* barejid = "myjid@server.org";
|
||||
char* resource1 = "tablet";
|
||||
@@ -39,7 +39,7 @@ replaces_chat_session_on_recipient_activity_with_different_resource(void** state
|
||||
}
|
||||
|
||||
void
|
||||
removes_chat_session(void** state)
|
||||
chat_session_remove__updates__session_removed(void** state)
|
||||
{
|
||||
char* barejid = "myjid@server.org";
|
||||
char* resource1 = "laptop";
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
void returns_false_when_chat_session_does_not_exist(void** state);
|
||||
void creates_chat_session_on_recipient_activity(void** state);
|
||||
void replaces_chat_session_on_recipient_activity_with_different_resource(void** state);
|
||||
void removes_chat_session(void** state);
|
||||
#ifndef TESTS_TEST_CHAT_SESSION_H
|
||||
#define TESTS_TEST_CHAT_SESSION_H
|
||||
|
||||
void chat_session_get__returns__null_when_no_session(void** state);
|
||||
void chat_session_recipient_active__updates__new_session(void** state);
|
||||
void chat_session_recipient_active__updates__replace_resource(void** state);
|
||||
void chat_session_remove__updates__session_removed(void** state);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "xmpp/contact.h"
|
||||
|
||||
void
|
||||
contact_in_group(void** state)
|
||||
p_contact_in_group__is__true_when_in_group(void** state)
|
||||
{
|
||||
GSList* groups = NULL;
|
||||
groups = g_slist_append(groups, g_strdup("somegroup"));
|
||||
@@ -22,7 +22,7 @@ contact_in_group(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
contact_not_in_group(void** state)
|
||||
p_contact_in_group__is__false_when_not_in_group(void** state)
|
||||
{
|
||||
GSList* groups = NULL;
|
||||
groups = g_slist_append(groups, g_strdup("somegroup"));
|
||||
@@ -38,7 +38,7 @@ contact_not_in_group(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
contact_name_when_name_exists(void** state)
|
||||
p_contact_name_or_jid__returns__name_when_exists(void** state)
|
||||
{
|
||||
PContact contact = p_contact_new("bob@server.com", "bob", NULL, "both",
|
||||
"is offline", FALSE);
|
||||
@@ -51,7 +51,7 @@ contact_name_when_name_exists(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
contact_jid_when_name_not_exists(void** state)
|
||||
p_contact_name_or_jid__returns__jid_when_name_not_exists(void** state)
|
||||
{
|
||||
PContact contact = p_contact_new("bob@server.com", NULL, NULL, "both",
|
||||
"is offline", FALSE);
|
||||
@@ -64,7 +64,7 @@ contact_jid_when_name_not_exists(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
contact_string_when_name_exists(void** state)
|
||||
p_contact_create_display_string__returns__name_and_resource_when_name_exists(void** state)
|
||||
{
|
||||
PContact contact = p_contact_new("bob@server.com", "bob", NULL, "both",
|
||||
"is offline", FALSE);
|
||||
@@ -78,7 +78,7 @@ contact_string_when_name_exists(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
contact_string_when_name_not_exists(void** state)
|
||||
p_contact_create_display_string__returns__jid_and_resource_when_name_not_exists(void** state)
|
||||
{
|
||||
PContact contact = p_contact_new("bob@server.com", NULL, NULL, "both",
|
||||
"is offline", FALSE);
|
||||
@@ -92,7 +92,7 @@ contact_string_when_name_not_exists(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
contact_string_when_default_resource(void** state)
|
||||
p_contact_create_display_string__returns__name_when_default_resource(void** state)
|
||||
{
|
||||
PContact contact = p_contact_new("bob@server.com", "bob", NULL, "both",
|
||||
"is offline", FALSE);
|
||||
@@ -106,7 +106,7 @@ contact_string_when_default_resource(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
contact_presence_offline(void** state)
|
||||
p_contact_presence__returns__offline_when_no_resources(void** state)
|
||||
{
|
||||
PContact contact = p_contact_new("bob@server.com", "bob", NULL, "both",
|
||||
"is offline", FALSE);
|
||||
@@ -119,7 +119,7 @@ contact_presence_offline(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
contact_presence_uses_highest_priority(void** state)
|
||||
p_contact_presence__returns__highest_priority_presence(void** state)
|
||||
{
|
||||
PContact contact = p_contact_new("bob@server.com", "bob", NULL, "both",
|
||||
"is offline", FALSE);
|
||||
@@ -143,7 +143,7 @@ contact_presence_uses_highest_priority(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
contact_presence_chat_when_same_prioroty(void** state)
|
||||
p_contact_presence__returns__chat_when_same_priority(void** state)
|
||||
{
|
||||
PContact contact = p_contact_new("bob@server.com", "bob", NULL, "both",
|
||||
"is offline", FALSE);
|
||||
@@ -167,7 +167,7 @@ contact_presence_chat_when_same_prioroty(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
contact_presence_online_when_same_prioroty(void** state)
|
||||
p_contact_presence__returns__online_when_same_priority(void** state)
|
||||
{
|
||||
PContact contact = p_contact_new("bob@server.com", "bob", NULL, "both",
|
||||
"is offline", FALSE);
|
||||
@@ -189,7 +189,7 @@ contact_presence_online_when_same_prioroty(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
contact_presence_away_when_same_prioroty(void** state)
|
||||
p_contact_presence__returns__away_when_same_priority(void** state)
|
||||
{
|
||||
PContact contact = p_contact_new("bob@server.com", "bob", NULL, "both",
|
||||
"is offline", FALSE);
|
||||
@@ -209,7 +209,7 @@ contact_presence_away_when_same_prioroty(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
contact_presence_xa_when_same_prioroty(void** state)
|
||||
p_contact_presence__returns__xa_when_same_priority(void** state)
|
||||
{
|
||||
PContact contact = p_contact_new("bob@server.com", "bob", NULL, "both",
|
||||
"is offline", FALSE);
|
||||
@@ -227,7 +227,7 @@ contact_presence_xa_when_same_prioroty(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
contact_presence_dnd(void** state)
|
||||
p_contact_presence__returns__dnd(void** state)
|
||||
{
|
||||
PContact contact = p_contact_new("bob@server.com", "bob", NULL, "both",
|
||||
"is offline", FALSE);
|
||||
@@ -243,7 +243,7 @@ contact_presence_dnd(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
contact_subscribed_when_to(void** state)
|
||||
p_contact_subscribed__is__true_when_to(void** state)
|
||||
{
|
||||
PContact contact = p_contact_new("bob@server.com", "bob", NULL, "to",
|
||||
"is offline", FALSE);
|
||||
@@ -256,7 +256,7 @@ contact_subscribed_when_to(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
contact_subscribed_when_both(void** state)
|
||||
p_contact_subscribed__is__true_when_both(void** state)
|
||||
{
|
||||
PContact contact = p_contact_new("bob@server.com", "bob", NULL, "both",
|
||||
"is offline", FALSE);
|
||||
@@ -269,7 +269,7 @@ contact_subscribed_when_both(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
contact_not_subscribed_when_from(void** state)
|
||||
p_contact_subscribed__is__false_when_from(void** state)
|
||||
{
|
||||
PContact contact = p_contact_new("bob@server.com", "bob", NULL, "from",
|
||||
"is offline", FALSE);
|
||||
@@ -282,7 +282,7 @@ contact_not_subscribed_when_from(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
contact_not_subscribed_when_no_subscription_value(void** state)
|
||||
p_contact_subscribed__is__false_when_no_subscription_value(void** state)
|
||||
{
|
||||
PContact contact = p_contact_new("bob@server.com", "bob", NULL, NULL,
|
||||
"is offline", FALSE);
|
||||
@@ -295,7 +295,7 @@ contact_not_subscribed_when_no_subscription_value(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
contact_not_available(void** state)
|
||||
p_contact_is_available__is__false_when_offline(void** state)
|
||||
{
|
||||
PContact contact = p_contact_new("bob@server.com", "bob", NULL, NULL,
|
||||
"is offline", FALSE);
|
||||
@@ -308,7 +308,7 @@ contact_not_available(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
contact_not_available_when_highest_priority_away(void** state)
|
||||
p_contact_is_available__is__false_when_highest_priority_away(void** state)
|
||||
{
|
||||
PContact contact = p_contact_new("bob@server.com", "bob", NULL, NULL,
|
||||
"is offline", FALSE);
|
||||
@@ -332,7 +332,7 @@ contact_not_available_when_highest_priority_away(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
contact_not_available_when_highest_priority_xa(void** state)
|
||||
p_contact_is_available__is__false_when_highest_priority_xa(void** state)
|
||||
{
|
||||
PContact contact = p_contact_new("bob@server.com", "bob", NULL, NULL,
|
||||
"is offline", FALSE);
|
||||
@@ -356,7 +356,7 @@ contact_not_available_when_highest_priority_xa(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
contact_not_available_when_highest_priority_dnd(void** state)
|
||||
p_contact_is_available__is__false_when_highest_priority_dnd(void** state)
|
||||
{
|
||||
PContact contact = p_contact_new("bob@server.com", "bob", NULL, NULL,
|
||||
"is offline", FALSE);
|
||||
@@ -380,7 +380,7 @@ contact_not_available_when_highest_priority_dnd(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
contact_available_when_highest_priority_online(void** state)
|
||||
p_contact_is_available__is__true_when_highest_priority_online(void** state)
|
||||
{
|
||||
PContact contact = p_contact_new("bob@server.com", "bob", NULL, NULL,
|
||||
"is offline", FALSE);
|
||||
@@ -404,7 +404,7 @@ contact_available_when_highest_priority_online(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
contact_available_when_highest_priority_chat(void** state)
|
||||
p_contact_is_available__is__true_when_highest_priority_chat(void** state)
|
||||
{
|
||||
PContact contact = p_contact_new("bob@server.com", "bob", NULL, NULL,
|
||||
"is offline", FALSE);
|
||||
|
||||
@@ -1,24 +1,29 @@
|
||||
void contact_in_group(void** state);
|
||||
void contact_not_in_group(void** state);
|
||||
void contact_name_when_name_exists(void** state);
|
||||
void contact_jid_when_name_not_exists(void** state);
|
||||
void contact_string_when_name_exists(void** state);
|
||||
void contact_string_when_name_not_exists(void** state);
|
||||
void contact_string_when_default_resource(void** state);
|
||||
void contact_presence_offline(void** state);
|
||||
void contact_presence_uses_highest_priority(void** state);
|
||||
void contact_presence_chat_when_same_prioroty(void** state);
|
||||
void contact_presence_online_when_same_prioroty(void** state);
|
||||
void contact_presence_away_when_same_prioroty(void** state);
|
||||
void contact_presence_xa_when_same_prioroty(void** state);
|
||||
void contact_presence_dnd(void** state);
|
||||
void contact_subscribed_when_to(void** state);
|
||||
void contact_subscribed_when_both(void** state);
|
||||
void contact_not_subscribed_when_from(void** state);
|
||||
void contact_not_subscribed_when_no_subscription_value(void** state);
|
||||
void contact_not_available(void** state);
|
||||
void contact_not_available_when_highest_priority_away(void** state);
|
||||
void contact_not_available_when_highest_priority_xa(void** state);
|
||||
void contact_not_available_when_highest_priority_dnd(void** state);
|
||||
void contact_available_when_highest_priority_online(void** state);
|
||||
void contact_available_when_highest_priority_chat(void** state);
|
||||
#ifndef TESTS_TEST_CONTACT_H
|
||||
#define TESTS_TEST_CONTACT_H
|
||||
|
||||
void p_contact_in_group__is__true_when_in_group(void** state);
|
||||
void p_contact_in_group__is__false_when_not_in_group(void** state);
|
||||
void p_contact_name_or_jid__returns__name_when_exists(void** state);
|
||||
void p_contact_name_or_jid__returns__jid_when_name_not_exists(void** state);
|
||||
void p_contact_create_display_string__returns__name_and_resource_when_name_exists(void** state);
|
||||
void p_contact_create_display_string__returns__jid_and_resource_when_name_not_exists(void** state);
|
||||
void p_contact_create_display_string__returns__name_when_default_resource(void** state);
|
||||
void p_contact_presence__returns__offline_when_no_resources(void** state);
|
||||
void p_contact_presence__returns__highest_priority_presence(void** state);
|
||||
void p_contact_presence__returns__chat_when_same_priority(void** state);
|
||||
void p_contact_presence__returns__online_when_same_priority(void** state);
|
||||
void p_contact_presence__returns__away_when_same_priority(void** state);
|
||||
void p_contact_presence__returns__xa_when_same_priority(void** state);
|
||||
void p_contact_presence__returns__dnd(void** state);
|
||||
void p_contact_subscribed__is__true_when_to(void** state);
|
||||
void p_contact_subscribed__is__true_when_both(void** state);
|
||||
void p_contact_subscribed__is__false_when_from(void** state);
|
||||
void p_contact_subscribed__is__false_when_no_subscription_value(void** state);
|
||||
void p_contact_is_available__is__false_when_offline(void** state);
|
||||
void p_contact_is_available__is__false_when_highest_priority_away(void** state);
|
||||
void p_contact_is_available__is__false_when_highest_priority_xa(void** state);
|
||||
void p_contact_is_available__is__false_when_highest_priority_dnd(void** state);
|
||||
void p_contact_is_available__is__true_when_highest_priority_online(void** state);
|
||||
void p_contact_is_available__is__true_when_highest_priority_chat(void** state);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -42,7 +42,7 @@ _new_field(void)
|
||||
}
|
||||
|
||||
void
|
||||
get_form_type_field_returns_null_no_fields(void** state)
|
||||
form_get_form_type_field__returns__null_no_fields(void** state)
|
||||
{
|
||||
DataForm* form = _new_form();
|
||||
|
||||
@@ -54,7 +54,7 @@ get_form_type_field_returns_null_no_fields(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
get_form_type_field_returns_null_when_not_present(void** state)
|
||||
form_get_form_type_field__returns__null_when_not_present(void** state)
|
||||
{
|
||||
DataForm* form = _new_form();
|
||||
FormField* field = _new_field();
|
||||
@@ -70,7 +70,7 @@ get_form_type_field_returns_null_when_not_present(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
get_form_type_field_returns_value_when_present(void** state)
|
||||
form_get_form_type_field__returns__value_when_present(void** state)
|
||||
{
|
||||
DataForm* form = _new_form();
|
||||
|
||||
@@ -97,7 +97,7 @@ get_form_type_field_returns_value_when_present(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
get_field_type_returns_unknown_when_no_fields(void** state)
|
||||
form_get_field_type__returns__unknown_when_no_fields(void** state)
|
||||
{
|
||||
DataForm* form = _new_form();
|
||||
|
||||
@@ -109,7 +109,7 @@ get_field_type_returns_unknown_when_no_fields(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
get_field_type_returns_correct_type(void** state)
|
||||
form_get_field_type__returns__correct_type(void** state)
|
||||
{
|
||||
DataForm* form = _new_form();
|
||||
g_hash_table_insert(form->tag_to_var, g_strdup("tag1"), g_strdup("var1"));
|
||||
@@ -135,7 +135,7 @@ get_field_type_returns_correct_type(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
set_value_adds_when_none(void** state)
|
||||
form_set_value__updates__adds_when_none(void** state)
|
||||
{
|
||||
DataForm* form = _new_form();
|
||||
g_hash_table_insert(form->tag_to_var, g_strdup("tag1"), g_strdup("var1"));
|
||||
@@ -174,7 +174,7 @@ set_value_adds_when_none(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
set_value_updates_when_one(void** state)
|
||||
form_set_value__updates__updates_when_one(void** state)
|
||||
{
|
||||
DataForm* form = _new_form();
|
||||
g_hash_table_insert(form->tag_to_var, g_strdup("tag1"), g_strdup("var1"));
|
||||
@@ -213,7 +213,7 @@ set_value_updates_when_one(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
add_unique_value_adds_when_none(void** state)
|
||||
form_add_unique_value__updates__adds_when_none(void** state)
|
||||
{
|
||||
DataForm* form = _new_form();
|
||||
g_hash_table_insert(form->tag_to_var, g_strdup("tag1"), g_strdup("var1"));
|
||||
@@ -253,7 +253,7 @@ add_unique_value_adds_when_none(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
add_unique_value_does_nothing_when_exists(void** state)
|
||||
form_add_unique_value__updates__does_nothing_when_exists(void** state)
|
||||
{
|
||||
DataForm* form = _new_form();
|
||||
g_hash_table_insert(form->tag_to_var, g_strdup("tag1"), g_strdup("var1"));
|
||||
@@ -294,7 +294,7 @@ add_unique_value_does_nothing_when_exists(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
add_unique_value_adds_when_doesnt_exist(void** state)
|
||||
form_add_unique_value__updates__adds_when_doesnt_exist(void** state)
|
||||
{
|
||||
DataForm* form = _new_form();
|
||||
g_hash_table_insert(form->tag_to_var, g_strdup("tag1"), g_strdup("var1"));
|
||||
@@ -343,7 +343,7 @@ add_unique_value_adds_when_doesnt_exist(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
add_value_adds_when_none(void** state)
|
||||
form_add_value__updates__adds_when_none(void** state)
|
||||
{
|
||||
DataForm* form = _new_form();
|
||||
g_hash_table_insert(form->tag_to_var, g_strdup("tag1"), g_strdup("var1"));
|
||||
@@ -375,7 +375,7 @@ add_value_adds_when_none(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
add_value_adds_when_some(void** state)
|
||||
form_add_value__updates__adds_when_some(void** state)
|
||||
{
|
||||
DataForm* form = _new_form();
|
||||
g_hash_table_insert(form->tag_to_var, g_strdup("tag1"), g_strdup("var1"));
|
||||
@@ -416,7 +416,7 @@ add_value_adds_when_some(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
add_value_adds_when_exists(void** state)
|
||||
form_add_value__updates__adds_when_exists(void** state)
|
||||
{
|
||||
DataForm* form = _new_form();
|
||||
g_hash_table_insert(form->tag_to_var, g_strdup("tag1"), g_strdup("var1"));
|
||||
@@ -458,7 +458,7 @@ add_value_adds_when_exists(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
remove_value_does_nothing_when_none(void** state)
|
||||
form_remove_value__updates__does_nothing_when_none(void** state)
|
||||
{
|
||||
DataForm* form = _new_form();
|
||||
g_hash_table_insert(form->tag_to_var, g_strdup("tag1"), g_strdup("var1"));
|
||||
@@ -487,7 +487,7 @@ remove_value_does_nothing_when_none(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
remove_value_does_nothing_when_doesnt_exist(void** state)
|
||||
form_remove_value__updates__does_nothing_when_doesnt_exist(void** state)
|
||||
{
|
||||
DataForm* form = _new_form();
|
||||
g_hash_table_insert(form->tag_to_var, g_strdup("tag1"), g_strdup("var1"));
|
||||
@@ -529,7 +529,7 @@ remove_value_does_nothing_when_doesnt_exist(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
remove_value_removes_when_one(void** state)
|
||||
form_remove_value__updates__removes_when_one(void** state)
|
||||
{
|
||||
DataForm* form = _new_form();
|
||||
g_hash_table_insert(form->tag_to_var, g_strdup("tag1"), g_strdup("var1"));
|
||||
@@ -559,7 +559,7 @@ remove_value_removes_when_one(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
remove_value_removes_when_many(void** state)
|
||||
form_remove_value__updates__removes_when_many(void** state)
|
||||
{
|
||||
DataForm* form = _new_form();
|
||||
g_hash_table_insert(form->tag_to_var, g_strdup("tag1"), g_strdup("var1"));
|
||||
@@ -601,7 +601,7 @@ remove_value_removes_when_many(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
remove_text_multi_value_does_nothing_when_none(void** state)
|
||||
form_remove_text_multi_value__updates__does_nothing_when_none(void** state)
|
||||
{
|
||||
DataForm* form = _new_form();
|
||||
g_hash_table_insert(form->tag_to_var, g_strdup("tag1"), g_strdup("var1"));
|
||||
@@ -630,7 +630,7 @@ remove_text_multi_value_does_nothing_when_none(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
remove_text_multi_value_does_nothing_when_doesnt_exist(void** state)
|
||||
form_remove_text_multi_value__updates__does_nothing_when_doesnt_exist(void** state)
|
||||
{
|
||||
DataForm* form = _new_form();
|
||||
g_hash_table_insert(form->tag_to_var, g_strdup("tag1"), g_strdup("var1"));
|
||||
@@ -672,7 +672,7 @@ remove_text_multi_value_does_nothing_when_doesnt_exist(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
remove_text_multi_value_removes_when_one(void** state)
|
||||
form_remove_text_multi_value__updates__removes_when_one(void** state)
|
||||
{
|
||||
DataForm* form = _new_form();
|
||||
g_hash_table_insert(form->tag_to_var, g_strdup("tag1"), g_strdup("var1"));
|
||||
@@ -702,7 +702,7 @@ remove_text_multi_value_removes_when_one(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
remove_text_multi_value_removes_when_many(void** state)
|
||||
form_remove_text_multi_value__updates__removes_when_many(void** state)
|
||||
{
|
||||
DataForm* form = _new_form();
|
||||
g_hash_table_insert(form->tag_to_var, g_strdup("tag1"), g_strdup("var1"));
|
||||
|
||||
@@ -1,21 +1,26 @@
|
||||
void get_form_type_field_returns_null_no_fields(void** state);
|
||||
void get_form_type_field_returns_null_when_not_present(void** state);
|
||||
void get_form_type_field_returns_value_when_present(void** state);
|
||||
void get_field_type_returns_unknown_when_no_fields(void** state);
|
||||
void get_field_type_returns_correct_type(void** state);
|
||||
void set_value_adds_when_none(void** state);
|
||||
void set_value_updates_when_one(void** state);
|
||||
void add_unique_value_adds_when_none(void** state);
|
||||
void add_unique_value_does_nothing_when_exists(void** state);
|
||||
void add_unique_value_adds_when_doesnt_exist(void** state);
|
||||
void add_value_adds_when_none(void** state);
|
||||
void add_value_adds_when_some(void** state);
|
||||
void add_value_adds_when_exists(void** state);
|
||||
void remove_value_does_nothing_when_none(void** state);
|
||||
void remove_value_does_nothing_when_doesnt_exist(void** state);
|
||||
void remove_value_removes_when_one(void** state);
|
||||
void remove_value_removes_when_many(void** state);
|
||||
void remove_text_multi_value_does_nothing_when_none(void** state);
|
||||
void remove_text_multi_value_does_nothing_when_doesnt_exist(void** state);
|
||||
void remove_text_multi_value_removes_when_one(void** state);
|
||||
void remove_text_multi_value_removes_when_many(void** state);
|
||||
#ifndef TESTS_TEST_FORM_H
|
||||
#define TESTS_TEST_FORM_H
|
||||
|
||||
void form_get_form_type_field__returns__null_no_fields(void** state);
|
||||
void form_get_form_type_field__returns__null_when_not_present(void** state);
|
||||
void form_get_form_type_field__returns__value_when_present(void** state);
|
||||
void form_get_field_type__returns__unknown_when_no_fields(void** state);
|
||||
void form_get_field_type__returns__correct_type(void** state);
|
||||
void form_set_value__updates__adds_when_none(void** state);
|
||||
void form_set_value__updates__updates_when_one(void** state);
|
||||
void form_add_unique_value__updates__adds_when_none(void** state);
|
||||
void form_add_unique_value__updates__does_nothing_when_exists(void** state);
|
||||
void form_add_unique_value__updates__adds_when_doesnt_exist(void** state);
|
||||
void form_add_value__updates__adds_when_none(void** state);
|
||||
void form_add_value__updates__adds_when_some(void** state);
|
||||
void form_add_value__updates__adds_when_exists(void** state);
|
||||
void form_remove_value__updates__does_nothing_when_none(void** state);
|
||||
void form_remove_value__updates__does_nothing_when_doesnt_exist(void** state);
|
||||
void form_remove_value__updates__removes_when_one(void** state);
|
||||
void form_remove_value__updates__removes_when_many(void** state);
|
||||
void form_remove_text_multi_value__updates__does_nothing_when_none(void** state);
|
||||
void form_remove_text_multi_value__updates__does_nothing_when_doesnt_exist(void** state);
|
||||
void form_remove_text_multi_value__updates__removes_when_one(void** state);
|
||||
void form_remove_text_multi_value__updates__removes_when_many(void** state);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,21 +4,21 @@
|
||||
#include "xmpp/jid.h"
|
||||
|
||||
void
|
||||
create_jid_from_null_returns_null(void** state)
|
||||
jid_create__returns__null_from_null(void** state)
|
||||
{
|
||||
Jid* result = jid_create(NULL);
|
||||
assert_null(result);
|
||||
}
|
||||
|
||||
void
|
||||
create_jid_from_empty_string_returns_null(void** state)
|
||||
jid_create__returns__null_from_empty_string(void** state)
|
||||
{
|
||||
Jid* result = jid_create("");
|
||||
assert_null(result);
|
||||
}
|
||||
|
||||
void
|
||||
create_jid_from_full_returns_full(void** state)
|
||||
jid_create__returns__full_from_full(void** state)
|
||||
{
|
||||
Jid* result = jid_create("myuser@mydomain/laptop");
|
||||
assert_string_equal("myuser@mydomain/laptop", result->fulljid);
|
||||
@@ -26,7 +26,7 @@ create_jid_from_full_returns_full(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
create_jid_from_full_returns_bare(void** state)
|
||||
jid_create__returns__bare_from_full(void** state)
|
||||
{
|
||||
Jid* result = jid_create("myuser@mydomain/laptop");
|
||||
assert_string_equal("myuser@mydomain", result->barejid);
|
||||
@@ -34,7 +34,7 @@ create_jid_from_full_returns_bare(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
create_jid_from_full_returns_resourcepart(void** state)
|
||||
jid_create__returns__resourcepart_from_full(void** state)
|
||||
{
|
||||
Jid* result = jid_create("myuser@mydomain/laptop");
|
||||
assert_string_equal("laptop", result->resourcepart);
|
||||
@@ -42,7 +42,7 @@ create_jid_from_full_returns_resourcepart(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
create_jid_from_full_returns_localpart(void** state)
|
||||
jid_create__returns__localpart_from_full(void** state)
|
||||
{
|
||||
Jid* result = jid_create("myuser@mydomain/laptop");
|
||||
assert_string_equal("myuser", result->localpart);
|
||||
@@ -50,7 +50,7 @@ create_jid_from_full_returns_localpart(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
create_jid_from_full_returns_domainpart(void** state)
|
||||
jid_create__returns__domainpart_from_full(void** state)
|
||||
{
|
||||
Jid* result = jid_create("myuser@mydomain/laptop");
|
||||
assert_string_equal("mydomain", result->domainpart);
|
||||
@@ -58,7 +58,7 @@ create_jid_from_full_returns_domainpart(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
create_jid_from_full_nolocal_returns_full(void** state)
|
||||
jid_create__returns__full_from_full_nolocal(void** state)
|
||||
{
|
||||
Jid* result = jid_create("mydomain/laptop");
|
||||
assert_string_equal("mydomain/laptop", result->fulljid);
|
||||
@@ -66,7 +66,7 @@ create_jid_from_full_nolocal_returns_full(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
create_jid_from_full_nolocal_returns_bare(void** state)
|
||||
jid_create__returns__bare_from_full_nolocal(void** state)
|
||||
{
|
||||
Jid* result = jid_create("mydomain/laptop");
|
||||
assert_string_equal("mydomain", result->barejid);
|
||||
@@ -74,7 +74,7 @@ create_jid_from_full_nolocal_returns_bare(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
create_jid_from_full_nolocal_returns_resourcepart(void** state)
|
||||
jid_create__returns__resourcepart_from_full_nolocal(void** state)
|
||||
{
|
||||
Jid* result = jid_create("mydomain/laptop");
|
||||
assert_string_equal("laptop", result->resourcepart);
|
||||
@@ -82,7 +82,7 @@ create_jid_from_full_nolocal_returns_resourcepart(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
create_jid_from_full_nolocal_returns_domainpart(void** state)
|
||||
jid_create__returns__domainpart_from_full_nolocal(void** state)
|
||||
{
|
||||
Jid* result = jid_create("mydomain/laptop");
|
||||
assert_string_equal("mydomain", result->domainpart);
|
||||
@@ -90,7 +90,7 @@ create_jid_from_full_nolocal_returns_domainpart(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
create_jid_from_full_nolocal_returns_null_localpart(void** state)
|
||||
jid_create__returns__null_localpart_from_full_nolocal(void** state)
|
||||
{
|
||||
Jid* result = jid_create("mydomain/laptop");
|
||||
assert_null(result->localpart);
|
||||
@@ -98,7 +98,7 @@ create_jid_from_full_nolocal_returns_null_localpart(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
create_jid_from_bare_returns_null_full(void** state)
|
||||
jid_create__returns__null_full_from_bare(void** state)
|
||||
{
|
||||
Jid* result = jid_create("myuser@mydomain");
|
||||
assert_null(result->fulljid);
|
||||
@@ -106,7 +106,7 @@ create_jid_from_bare_returns_null_full(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
create_jid_from_bare_returns_null_resource(void** state)
|
||||
jid_create__returns__null_resource_from_bare(void** state)
|
||||
{
|
||||
Jid* result = jid_create("myuser@mydomain");
|
||||
assert_null(result->resourcepart);
|
||||
@@ -114,7 +114,7 @@ create_jid_from_bare_returns_null_resource(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
create_jid_from_bare_returns_bare(void** state)
|
||||
jid_create__returns__bare_from_bare(void** state)
|
||||
{
|
||||
Jid* result = jid_create("myuser@mydomain");
|
||||
assert_string_equal("myuser@mydomain", result->barejid);
|
||||
@@ -122,7 +122,7 @@ create_jid_from_bare_returns_bare(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
create_jid_from_bare_returns_localpart(void** state)
|
||||
jid_create__returns__localpart_from_bare(void** state)
|
||||
{
|
||||
Jid* result = jid_create("myuser@mydomain");
|
||||
assert_string_equal("myuser", result->localpart);
|
||||
@@ -130,7 +130,7 @@ create_jid_from_bare_returns_localpart(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
create_jid_from_bare_returns_domainpart(void** state)
|
||||
jid_create__returns__domainpart_from_bare(void** state)
|
||||
{
|
||||
Jid* result = jid_create("myuser@mydomain");
|
||||
assert_string_equal("mydomain", result->domainpart);
|
||||
@@ -138,7 +138,7 @@ create_jid_from_bare_returns_domainpart(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
create_room_jid_returns_room(void** state)
|
||||
jid_create_from_bare_and_resource__returns__room(void** state)
|
||||
{
|
||||
Jid* result = jid_create_from_bare_and_resource("room@conference.domain.org", "myname");
|
||||
|
||||
@@ -147,7 +147,7 @@ create_room_jid_returns_room(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
create_room_jid_returns_nick(void** state)
|
||||
jid_create_from_bare_and_resource__returns__nick(void** state)
|
||||
{
|
||||
Jid* result = jid_create_from_bare_and_resource("room@conference.domain.org", "myname");
|
||||
|
||||
@@ -156,7 +156,7 @@ create_room_jid_returns_nick(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
create_with_slash_in_resource(void** state)
|
||||
jid_create__returns__correct_parts_with_slash_in_resource(void** state)
|
||||
{
|
||||
Jid* result = jid_create("room@conference.domain.org/my/nick");
|
||||
|
||||
@@ -170,7 +170,7 @@ create_with_slash_in_resource(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
create_with_at_in_resource(void** state)
|
||||
jid_create__returns__correct_parts_with_at_in_resource(void** state)
|
||||
{
|
||||
Jid* result = jid_create("room@conference.domain.org/my@nick");
|
||||
|
||||
@@ -184,7 +184,7 @@ create_with_at_in_resource(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
create_with_at_and_slash_in_resource(void** state)
|
||||
jid_create__returns__correct_parts_with_at_and_slash_in_resource(void** state)
|
||||
{
|
||||
Jid* result = jid_create("room@conference.domain.org/my@nick/something");
|
||||
|
||||
@@ -198,7 +198,7 @@ create_with_at_and_slash_in_resource(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
create_full_with_trailing_slash(void** state)
|
||||
jid_create__returns__correct_parts_with_trailing_slash(void** state)
|
||||
{
|
||||
Jid* result = jid_create("room@conference.domain.org/nick/");
|
||||
|
||||
@@ -212,7 +212,7 @@ create_full_with_trailing_slash(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
returns_fulljid_when_exists(void** state)
|
||||
jid_fulljid_or_barejid__returns__fulljid_when_exists(void** state)
|
||||
{
|
||||
Jid* jid = jid_create("localpart@domainpart/resourcepart");
|
||||
|
||||
@@ -224,7 +224,7 @@ returns_fulljid_when_exists(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
returns_barejid_when_fulljid_not_exists(void** state)
|
||||
jid_fulljid_or_barejid__returns__barejid_when_fulljid_not_exists(void** state)
|
||||
{
|
||||
Jid* jid = jid_create("localpart@domainpart");
|
||||
|
||||
|
||||
@@ -1,25 +1,30 @@
|
||||
void create_jid_from_null_returns_null(void** state);
|
||||
void create_jid_from_empty_string_returns_null(void** state);
|
||||
void create_jid_from_full_returns_full(void** state);
|
||||
void create_jid_from_full_returns_bare(void** state);
|
||||
void create_jid_from_full_returns_resourcepart(void** state);
|
||||
void create_jid_from_full_returns_localpart(void** state);
|
||||
void create_jid_from_full_returns_domainpart(void** state);
|
||||
void create_jid_from_full_nolocal_returns_full(void** state);
|
||||
void create_jid_from_full_nolocal_returns_bare(void** state);
|
||||
void create_jid_from_full_nolocal_returns_resourcepart(void** state);
|
||||
void create_jid_from_full_nolocal_returns_domainpart(void** state);
|
||||
void create_jid_from_full_nolocal_returns_null_localpart(void** state);
|
||||
void create_jid_from_bare_returns_null_full(void** state);
|
||||
void create_jid_from_bare_returns_null_resource(void** state);
|
||||
void create_jid_from_bare_returns_bare(void** state);
|
||||
void create_jid_from_bare_returns_localpart(void** state);
|
||||
void create_jid_from_bare_returns_domainpart(void** state);
|
||||
void create_room_jid_returns_room(void** state);
|
||||
void create_room_jid_returns_nick(void** state);
|
||||
void create_with_slash_in_resource(void** state);
|
||||
void create_with_at_in_resource(void** state);
|
||||
void create_with_at_and_slash_in_resource(void** state);
|
||||
void create_full_with_trailing_slash(void** state);
|
||||
void returns_fulljid_when_exists(void** state);
|
||||
void returns_barejid_when_fulljid_not_exists(void** state);
|
||||
#ifndef TESTS_TEST_JID_H
|
||||
#define TESTS_TEST_JID_H
|
||||
|
||||
void jid_create__returns__null_from_null(void** state);
|
||||
void jid_create__returns__null_from_empty_string(void** state);
|
||||
void jid_create__returns__full_from_full(void** state);
|
||||
void jid_create__returns__bare_from_full(void** state);
|
||||
void jid_create__returns__resourcepart_from_full(void** state);
|
||||
void jid_create__returns__localpart_from_full(void** state);
|
||||
void jid_create__returns__domainpart_from_full(void** state);
|
||||
void jid_create__returns__full_from_full_nolocal(void** state);
|
||||
void jid_create__returns__bare_from_full_nolocal(void** state);
|
||||
void jid_create__returns__resourcepart_from_full_nolocal(void** state);
|
||||
void jid_create__returns__domainpart_from_full_nolocal(void** state);
|
||||
void jid_create__returns__null_localpart_from_full_nolocal(void** state);
|
||||
void jid_create__returns__null_full_from_bare(void** state);
|
||||
void jid_create__returns__null_resource_from_bare(void** state);
|
||||
void jid_create__returns__bare_from_bare(void** state);
|
||||
void jid_create__returns__localpart_from_bare(void** state);
|
||||
void jid_create__returns__domainpart_from_bare(void** state);
|
||||
void jid_create_from_bare_and_resource__returns__room(void** state);
|
||||
void jid_create_from_bare_and_resource__returns__nick(void** state);
|
||||
void jid_create__returns__correct_parts_with_slash_in_resource(void** state);
|
||||
void jid_create__returns__correct_parts_with_at_in_resource(void** state);
|
||||
void jid_create__returns__correct_parts_with_at_and_slash_in_resource(void** state);
|
||||
void jid_create__returns__correct_parts_with_trailing_slash(void** state);
|
||||
void jid_fulljid_or_barejid__returns__fulljid_when_exists(void** state);
|
||||
void jid_fulljid_or_barejid__returns__barejid_when_fulljid_not_exists(void** state);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -20,7 +20,7 @@ muc_after_test(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
test_muc_invites_add(void** state)
|
||||
muc_invites_add__updates__invites_list(void** state)
|
||||
{
|
||||
char* room = "room@conf.server";
|
||||
muc_invites_add(room, NULL);
|
||||
@@ -31,7 +31,7 @@ test_muc_invites_add(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
test_muc_remove_invite(void** state)
|
||||
muc_invites_remove__updates__invites_list(void** state)
|
||||
{
|
||||
char* room = "room@conf.server";
|
||||
muc_invites_add(room, NULL);
|
||||
@@ -43,7 +43,7 @@ test_muc_remove_invite(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
test_muc_invites_count_0(void** state)
|
||||
muc_invites_count__returns__0_when_no_invites(void** state)
|
||||
{
|
||||
int invite_count = muc_invites_count();
|
||||
|
||||
@@ -51,7 +51,7 @@ test_muc_invites_count_0(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
test_muc_invites_count_5(void** state)
|
||||
muc_invites_count__returns__5_when_five_invites_added(void** state)
|
||||
{
|
||||
muc_invites_add("room1@conf.server", NULL);
|
||||
muc_invites_add("room2@conf.server", NULL);
|
||||
@@ -65,7 +65,7 @@ test_muc_invites_count_5(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
test_muc_room_is_not_active(void** state)
|
||||
muc_active__is__false_when_not_joined(void** state)
|
||||
{
|
||||
char* room = "room@server.org";
|
||||
|
||||
@@ -75,7 +75,7 @@ test_muc_room_is_not_active(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
test_muc_active(void** state)
|
||||
muc_active__is__true_when_joined(void** state)
|
||||
{
|
||||
char* room = "room@server.org";
|
||||
char* nick = "bob";
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
#ifndef TESTS_TEST_MUC_H
|
||||
#define TESTS_TEST_MUC_H
|
||||
|
||||
int muc_before_test(void** state);
|
||||
int muc_after_test(void** state);
|
||||
|
||||
void test_muc_invites_add(void** state);
|
||||
void test_muc_remove_invite(void** state);
|
||||
void test_muc_invites_count_0(void** state);
|
||||
void test_muc_invites_count_5(void** state);
|
||||
void test_muc_room_is_not_active(void** state);
|
||||
void test_muc_active(void** state);
|
||||
void muc_invites_add__updates__invites_list(void** state);
|
||||
void muc_invites_remove__updates__invites_list(void** state);
|
||||
void muc_invites_count__returns__0_when_no_invites(void** state);
|
||||
void muc_invites_count__returns__5_when_five_invites_added(void** state);
|
||||
void muc_active__is__false_when_not_joined(void** state);
|
||||
void muc_active__is__true_when_joined(void** state);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include "xmpp/roster_list.h"
|
||||
|
||||
void
|
||||
empty_list_when_none_added(void** state)
|
||||
roster_get_contacts__returns__empty_list_when_none_added(void** state)
|
||||
{
|
||||
roster_create();
|
||||
GSList* list = roster_get_contacts(ROSTER_ORD_NAME);
|
||||
@@ -18,7 +18,7 @@ empty_list_when_none_added(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
contains_one_element(void** state)
|
||||
roster_get_contacts__returns__one_element(void** state)
|
||||
{
|
||||
roster_create();
|
||||
roster_add("James", NULL, NULL, NULL, FALSE);
|
||||
@@ -30,7 +30,7 @@ contains_one_element(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
first_element_correct(void** state)
|
||||
roster_get_contacts__returns__correct_first_element(void** state)
|
||||
{
|
||||
roster_create();
|
||||
roster_add("James", NULL, NULL, NULL, FALSE);
|
||||
@@ -44,7 +44,7 @@ first_element_correct(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
contains_two_elements(void** state)
|
||||
roster_get_contacts__returns__two_elements(void** state)
|
||||
{
|
||||
roster_create();
|
||||
roster_add("James", NULL, NULL, NULL, FALSE);
|
||||
@@ -58,7 +58,7 @@ contains_two_elements(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
first_and_second_elements_correct(void** state)
|
||||
roster_get_contacts__returns__correct_first_and_second_elements(void** state)
|
||||
{
|
||||
roster_create();
|
||||
roster_add("James", NULL, NULL, NULL, FALSE);
|
||||
@@ -76,7 +76,7 @@ first_and_second_elements_correct(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
contains_three_elements(void** state)
|
||||
roster_get_contacts__returns__three_elements(void** state)
|
||||
{
|
||||
roster_create();
|
||||
roster_add("James", NULL, NULL, NULL, FALSE);
|
||||
@@ -91,7 +91,7 @@ contains_three_elements(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
first_three_elements_correct(void** state)
|
||||
roster_get_contacts__returns__correct_first_three_elements(void** state)
|
||||
{
|
||||
roster_create();
|
||||
roster_add("Bob", NULL, NULL, NULL, FALSE);
|
||||
@@ -111,7 +111,7 @@ first_three_elements_correct(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
add_twice_at_beginning_adds_once(void** state)
|
||||
roster_add__updates__adds_once_when_called_twice_at_beginning(void** state)
|
||||
{
|
||||
roster_create();
|
||||
roster_add("James", NULL, NULL, NULL, FALSE);
|
||||
@@ -133,7 +133,7 @@ add_twice_at_beginning_adds_once(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
add_twice_in_middle_adds_once(void** state)
|
||||
roster_add__updates__adds_once_when_called_twice_in_middle(void** state)
|
||||
{
|
||||
roster_create();
|
||||
roster_add("James", NULL, NULL, NULL, FALSE);
|
||||
@@ -155,7 +155,7 @@ add_twice_in_middle_adds_once(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
add_twice_at_end_adds_once(void** state)
|
||||
roster_add__updates__adds_once_when_called_twice_at_end(void** state)
|
||||
{
|
||||
roster_create();
|
||||
roster_add("James", NULL, NULL, NULL, FALSE);
|
||||
@@ -177,7 +177,7 @@ add_twice_at_end_adds_once(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
find_first_exists(void** state)
|
||||
roster_contact_autocomplete__returns__first_exists(void** state)
|
||||
{
|
||||
roster_create();
|
||||
roster_add("James", NULL, NULL, NULL, FALSE);
|
||||
@@ -194,7 +194,7 @@ find_first_exists(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
find_second_exists(void** state)
|
||||
roster_contact_autocomplete__returns__second_exists(void** state)
|
||||
{
|
||||
roster_create();
|
||||
roster_add("James", NULL, NULL, NULL, FALSE);
|
||||
@@ -208,7 +208,7 @@ find_second_exists(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
find_third_exists(void** state)
|
||||
roster_contact_autocomplete__returns__third_exists(void** state)
|
||||
{
|
||||
roster_create();
|
||||
roster_add("James", NULL, NULL, NULL, FALSE);
|
||||
@@ -222,7 +222,7 @@ find_third_exists(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
find_returns_null(void** state)
|
||||
roster_contact_autocomplete__returns__null_when_no_match(void** state)
|
||||
{
|
||||
roster_create();
|
||||
roster_add("James", NULL, NULL, NULL, FALSE);
|
||||
@@ -235,7 +235,7 @@ find_returns_null(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
find_on_empty_returns_null(void** state)
|
||||
roster_contact_autocomplete__returns__null_on_empty_roster(void** state)
|
||||
{
|
||||
roster_create();
|
||||
char* result = roster_contact_autocomplete("James", FALSE, NULL);
|
||||
@@ -244,7 +244,7 @@ find_on_empty_returns_null(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
find_twice_returns_second_when_two_match(void** state)
|
||||
roster_contact_autocomplete__returns__second_when_two_match(void** state)
|
||||
{
|
||||
roster_create();
|
||||
roster_add("James", NULL, NULL, NULL, FALSE);
|
||||
@@ -260,7 +260,7 @@ find_twice_returns_second_when_two_match(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
find_five_times_finds_fifth(void** state)
|
||||
roster_contact_autocomplete__returns__fifth_when_multiple_match(void** state)
|
||||
{
|
||||
roster_create();
|
||||
roster_add("Jama", NULL, NULL, NULL, FALSE);
|
||||
@@ -289,7 +289,7 @@ find_five_times_finds_fifth(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
find_twice_returns_first_when_two_match_and_reset(void** state)
|
||||
roster_contact_autocomplete__returns__first_when_two_match_and_reset(void** state)
|
||||
{
|
||||
roster_create();
|
||||
roster_add("James", NULL, NULL, NULL, FALSE);
|
||||
@@ -306,7 +306,7 @@ find_twice_returns_first_when_two_match_and_reset(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
add_contact_with_no_group(void** state)
|
||||
roster_get_groups__returns__empty_for_no_group(void** state)
|
||||
{
|
||||
roster_create();
|
||||
roster_add("person@server.org", NULL, NULL, NULL, FALSE);
|
||||
@@ -319,7 +319,7 @@ add_contact_with_no_group(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
add_contact_with_group(void** state)
|
||||
roster_get_groups__returns__one_group(void** state)
|
||||
{
|
||||
roster_create();
|
||||
|
||||
@@ -339,7 +339,7 @@ add_contact_with_group(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
add_contact_with_two_groups(void** state)
|
||||
roster_get_groups__returns__two_groups(void** state)
|
||||
{
|
||||
roster_create();
|
||||
|
||||
@@ -363,7 +363,7 @@ add_contact_with_two_groups(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
add_contact_with_three_groups(void** state)
|
||||
roster_get_groups__returns__three_groups(void** state)
|
||||
{
|
||||
roster_create();
|
||||
|
||||
@@ -391,7 +391,7 @@ add_contact_with_three_groups(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
add_contact_with_three_groups_update_adding_two(void** state)
|
||||
roster_update__updates__adding_two_groups(void** state)
|
||||
{
|
||||
roster_create();
|
||||
|
||||
@@ -433,7 +433,7 @@ add_contact_with_three_groups_update_adding_two(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
add_contact_with_three_groups_update_removing_one(void** state)
|
||||
roster_update__updates__removing_one_group(void** state)
|
||||
{
|
||||
roster_create();
|
||||
|
||||
@@ -463,7 +463,7 @@ add_contact_with_three_groups_update_removing_one(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
add_contact_with_three_groups_update_removing_two(void** state)
|
||||
roster_update__updates__removing_two_groups(void** state)
|
||||
{
|
||||
roster_create();
|
||||
|
||||
@@ -489,7 +489,7 @@ add_contact_with_three_groups_update_removing_two(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
add_contact_with_three_groups_update_removing_three(void** state)
|
||||
roster_update__updates__removing_three_groups(void** state)
|
||||
{
|
||||
roster_create();
|
||||
|
||||
@@ -509,7 +509,7 @@ add_contact_with_three_groups_update_removing_three(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
add_contact_with_three_groups_update_two_new(void** state)
|
||||
roster_update__updates__two_new_groups(void** state)
|
||||
{
|
||||
roster_create();
|
||||
|
||||
@@ -537,7 +537,7 @@ add_contact_with_three_groups_update_two_new(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
add_remove_contact_groups(void** state)
|
||||
roster_remove__updates__contact_groups(void** state)
|
||||
{
|
||||
roster_create();
|
||||
|
||||
@@ -557,7 +557,7 @@ add_remove_contact_groups(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
add_contacts_with_different_groups(void** state)
|
||||
roster_add__updates__different_groups(void** state)
|
||||
{
|
||||
roster_create();
|
||||
|
||||
@@ -591,7 +591,7 @@ add_contacts_with_different_groups(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
add_contacts_with_same_groups(void** state)
|
||||
roster_add__updates__same_groups(void** state)
|
||||
{
|
||||
roster_create();
|
||||
|
||||
@@ -622,7 +622,7 @@ add_contacts_with_same_groups(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
add_contacts_with_overlapping_groups(void** state)
|
||||
roster_add__updates__overlapping_groups(void** state)
|
||||
{
|
||||
roster_create();
|
||||
|
||||
@@ -655,7 +655,7 @@ add_contacts_with_overlapping_groups(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
remove_contact_with_remaining_in_group(void** state)
|
||||
roster_remove__updates__remaining_in_group(void** state)
|
||||
{
|
||||
roster_create();
|
||||
|
||||
@@ -688,7 +688,7 @@ remove_contact_with_remaining_in_group(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
get_contact_display_name(void** state)
|
||||
roster_get_display_name__returns__nickname_when_exists(void** state)
|
||||
{
|
||||
roster_create();
|
||||
roster_add("person@server.org", "nickname", NULL, NULL, FALSE);
|
||||
@@ -699,7 +699,7 @@ get_contact_display_name(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
get_contact_display_name_is_barejid_if_name_is_empty(void** state)
|
||||
roster_get_display_name__returns__barejid_when_nickname_empty(void** state)
|
||||
{
|
||||
roster_create();
|
||||
roster_add("person@server.org", NULL, NULL, NULL, FALSE);
|
||||
@@ -710,7 +710,7 @@ get_contact_display_name_is_barejid_if_name_is_empty(void** state)
|
||||
}
|
||||
|
||||
void
|
||||
get_contact_display_name_is_passed_barejid_if_contact_does_not_exist(void** state)
|
||||
roster_get_display_name__returns__barejid_when_not_exists(void** state)
|
||||
{
|
||||
roster_create();
|
||||
|
||||
|
||||
@@ -1,35 +1,40 @@
|
||||
void empty_list_when_none_added(void** state);
|
||||
void contains_one_element(void** state);
|
||||
void first_element_correct(void** state);
|
||||
void contains_two_elements(void** state);
|
||||
void first_and_second_elements_correct(void** state);
|
||||
void contains_three_elements(void** state);
|
||||
void first_three_elements_correct(void** state);
|
||||
void add_twice_at_beginning_adds_once(void** state);
|
||||
void add_twice_in_middle_adds_once(void** state);
|
||||
void add_twice_at_end_adds_once(void** state);
|
||||
void find_first_exists(void** state);
|
||||
void find_second_exists(void** state);
|
||||
void find_third_exists(void** state);
|
||||
void find_returns_null(void** state);
|
||||
void find_on_empty_returns_null(void** state);
|
||||
void find_twice_returns_second_when_two_match(void** state);
|
||||
void find_five_times_finds_fifth(void** state);
|
||||
void find_twice_returns_first_when_two_match_and_reset(void** state);
|
||||
void add_contact_with_no_group(void** state);
|
||||
void add_contact_with_group(void** state);
|
||||
void add_contact_with_two_groups(void** state);
|
||||
void add_contact_with_three_groups(void** state);
|
||||
void add_contact_with_three_groups_update_adding_two(void** state);
|
||||
void add_contact_with_three_groups_update_removing_one(void** state);
|
||||
void add_contact_with_three_groups_update_removing_two(void** state);
|
||||
void add_contact_with_three_groups_update_removing_three(void** state);
|
||||
void add_contact_with_three_groups_update_two_new(void** state);
|
||||
void add_remove_contact_groups(void** state);
|
||||
void add_contacts_with_different_groups(void** state);
|
||||
void add_contacts_with_same_groups(void** state);
|
||||
void add_contacts_with_overlapping_groups(void** state);
|
||||
void remove_contact_with_remaining_in_group(void** state);
|
||||
void get_contact_display_name(void** state);
|
||||
void get_contact_display_name_is_barejid_if_name_is_empty(void** state);
|
||||
void get_contact_display_name_is_passed_barejid_if_contact_does_not_exist(void** state);
|
||||
#ifndef TESTS_TEST_ROSTER_LIST_H
|
||||
#define TESTS_TEST_ROSTER_LIST_H
|
||||
|
||||
void roster_get_contacts__returns__empty_list_when_none_added(void** state);
|
||||
void roster_get_contacts__returns__one_element(void** state);
|
||||
void roster_get_contacts__returns__correct_first_element(void** state);
|
||||
void roster_get_contacts__returns__two_elements(void** state);
|
||||
void roster_get_contacts__returns__correct_first_and_second_elements(void** state);
|
||||
void roster_get_contacts__returns__three_elements(void** state);
|
||||
void roster_get_contacts__returns__correct_first_three_elements(void** state);
|
||||
void roster_add__updates__adds_once_when_called_twice_at_beginning(void** state);
|
||||
void roster_add__updates__adds_once_when_called_twice_in_middle(void** state);
|
||||
void roster_add__updates__adds_once_when_called_twice_at_end(void** state);
|
||||
void roster_contact_autocomplete__returns__first_exists(void** state);
|
||||
void roster_contact_autocomplete__returns__second_exists(void** state);
|
||||
void roster_contact_autocomplete__returns__third_exists(void** state);
|
||||
void roster_contact_autocomplete__returns__null_when_no_match(void** state);
|
||||
void roster_contact_autocomplete__returns__null_on_empty_roster(void** state);
|
||||
void roster_contact_autocomplete__returns__second_when_two_match(void** state);
|
||||
void roster_contact_autocomplete__returns__fifth_when_multiple_match(void** state);
|
||||
void roster_contact_autocomplete__returns__first_when_two_match_and_reset(void** state);
|
||||
void roster_get_groups__returns__empty_for_no_group(void** state);
|
||||
void roster_get_groups__returns__one_group(void** state);
|
||||
void roster_get_groups__returns__two_groups(void** state);
|
||||
void roster_get_groups__returns__three_groups(void** state);
|
||||
void roster_update__updates__adding_two_groups(void** state);
|
||||
void roster_update__updates__removing_one_group(void** state);
|
||||
void roster_update__updates__removing_two_groups(void** state);
|
||||
void roster_update__updates__removing_three_groups(void** state);
|
||||
void roster_update__updates__two_new_groups(void** state);
|
||||
void roster_remove__updates__contact_groups(void** state);
|
||||
void roster_add__updates__different_groups(void** state);
|
||||
void roster_add__updates__same_groups(void** state);
|
||||
void roster_add__updates__overlapping_groups(void** state);
|
||||
void roster_remove__updates__remaining_in_group(void** state);
|
||||
void roster_get_display_name__returns__nickname_when_exists(void** state);
|
||||
void roster_get_display_name__returns__barejid_when_nickname_empty(void** state);
|
||||
void roster_get_display_name__returns__barejid_when_not_exists(void** state);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user