mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-31 15:36:21 +00:00
Test priority below lower bounds
This commit is contained in:
@@ -967,6 +967,24 @@ void cmd_account_set_online_priority_shows_message(void **state)
|
|||||||
|
|
||||||
free(help);
|
free(help);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void cmd_account_does_not_set_priority_when_too_low(void **state)
|
||||||
|
{
|
||||||
|
mock_cons_show();
|
||||||
|
CommandHelp *help = malloc(sizeof(CommandHelp));
|
||||||
|
gchar *args[] = { "set", "a_account", "online", "-150", NULL };
|
||||||
|
|
||||||
|
accounts_account_exists_return(TRUE);
|
||||||
|
|
||||||
|
expect_cons_show("Value out of range. Must be in -128..127.");
|
||||||
|
|
||||||
|
gboolean result = cmd_account(args, *help);
|
||||||
|
assert_true(result);
|
||||||
|
|
||||||
|
free(help);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
// test invalid priority low
|
// test invalid priority low
|
||||||
// test invalid priority high
|
// test invalid priority high
|
||||||
|
|||||||
@@ -51,3 +51,4 @@ void cmd_account_set_away_priority_sets_preference(void **state);
|
|||||||
void cmd_account_set_xa_priority_sets_preference(void **state);
|
void cmd_account_set_xa_priority_sets_preference(void **state);
|
||||||
void cmd_account_set_dnd_priority_sets_preference(void **state);
|
void cmd_account_set_dnd_priority_sets_preference(void **state);
|
||||||
void cmd_account_set_online_priority_shows_message(void **state);
|
void cmd_account_set_online_priority_shows_message(void **state);
|
||||||
|
void cmd_account_does_not_set_priority_when_too_low(void **state);
|
||||||
|
|||||||
@@ -242,6 +242,7 @@ int main(int argc, char* argv[]) {
|
|||||||
unit_test(cmd_account_set_xa_priority_sets_preference),
|
unit_test(cmd_account_set_xa_priority_sets_preference),
|
||||||
unit_test(cmd_account_set_dnd_priority_sets_preference),
|
unit_test(cmd_account_set_dnd_priority_sets_preference),
|
||||||
unit_test(cmd_account_set_online_priority_shows_message),
|
unit_test(cmd_account_set_online_priority_shows_message),
|
||||||
|
unit_test(cmd_account_does_not_set_priority_when_too_low),
|
||||||
};
|
};
|
||||||
return run_tests(tests);
|
return run_tests(tests);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user