about summary refs log blame commit diff stats
path: root/tests/test_parser.h
blob: 7b178c3d7b9fd698f67c480e791e8b21809463bf (plain) (tree)








































                                                                          
void parse_null_returns_null(void **state);
void parse_empty_returns_null(void **state);
void parse_space_returns_null(void **state);
void parse_cmd_no_args_returns_null(void **state);
void parse_cmd_with_space_returns_null(void **state);
void parse_cmd_with_too_few_returns_null(void **state);
void parse_cmd_with_too_many_returns_null(void **state);
void parse_cmd_one_arg(void **state);
void parse_cmd_two_args(void **state);
void parse_cmd_three_args(void **state);
void parse_cmd_three_args_with_spaces(void **state);
void parse_cmd_with_freetext(void **state);
void parse_cmd_one_arg_with_freetext(void **state);
void parse_cmd_two_args_with_freetext(void **state);
void parse_cmd_min_zero(void **state);
void parse_cmd_min_zero_with_freetext(void **state);
void parse_cmd_with_quoted(void **state);
void parse_cmd_with_quoted_and_space(void **state);
void parse_cmd_with_quoted_and_many_spaces(void **state);
void parse_cmd_with_many_quoted_and_many_spaces(void **state);
void parse_cmd_freetext_with_quoted(void **state);
void parse_cmd_freetext_with_quoted_and_space(void **state);
void parse_cmd_freetext_with_quoted_and_many_spaces(void **state);
void parse_cmd_freetext_with_many_quoted_and_many_spaces(void **state);
void parse_cmd_with_quoted_freetext(void **state);
void parse_cmd_with_third_arg_quoted_0_min_3_max(void **state);
void parse_cmd_with_second_arg_quoted_0_min_3_max(void **state);
void parse_cmd_with_second_and_third_arg_quoted_0_min_3_max(void **state);
void count_one_token(void **state);
void count_one_token_quoted_no_whitespace(void **state);
void count_one_token_quoted_with_whitespace(void **state);
void count_two_tokens(void **state);
void count_two_tokens_first_quoted(void **state);
void count_two_tokens_second_quoted(void **state);
void count_two_tokens_both_quoted(void **state);
void get_first_of_one(void **state);
void get_first_of_two(void **state);
void get_first_two_of_three(void **state);
void get_first_two_of_three_first_quoted(void **state);
void get_first_two_of_three_second_quoted(void **state);
void get_first_two_of_three_first_and_second_quoted(void **state);
span>, FALSE); Resource *resource = resource_new("resource", RESOURCE_ONLINE, NULL, 10); expect_memory(ui_contact_online, barejid, barejid, sizeof(barejid)); expect_memory(ui_contact_online, resource, resource, sizeof(resource)); expect_value(ui_contact_online, last_activity, NULL); sv_ev_contact_online(barejid, resource, NULL); roster_clear(); } void handle_offline_removes_chat_session(void **state) { chat_sessions_init(); char *barejid = "friend@server.chat.com"; char *resource = "home"; roster_init(); roster_add(barejid, "bob", NULL, "both", FALSE); Resource *resourcep = resource_new(resource, RESOURCE_ONLINE, NULL, 10); roster_update_presence(barejid, resourcep, NULL); chat_session_recipient_active(barejid, resource, FALSE); sv_ev_contact_offline(barejid, resource, NULL); ChatSession *session = chat_session_get(barejid); assert_null(session); roster_clear(); chat_sessions_clear(); } void lost_connection_clears_chat_sessions(void **state) { chat_sessions_init(); chat_session_recipient_active("bob@server.org", "laptop", FALSE); chat_session_recipient_active("steve@server.org", "mobile", FALSE); expect_any_cons_show_error(); sv_ev_lost_connection(); ChatSession *session1 = chat_session_get("bob@server.org"); ChatSession *session2 = chat_session_get("steve@server.org"); assert_null(session1); assert_null(session2); }