mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Test priority above upper bounds
This commit is contained in:
parent
ada3c768e5
commit
9d1b05a896
@ -986,7 +986,24 @@ void cmd_account_does_not_set_priority_when_too_low(void **state)
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
// test invalid priority low
|
|
||||||
// test invalid priority high
|
void cmd_account_does_not_set_priority_when_too_high(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 presence updated when connected as account and current presence equals setting
|
// test presence updated when connected as account and current presence equals setting
|
||||||
|
|
||||||
|
@ -52,3 +52,4 @@ 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);
|
void cmd_account_does_not_set_priority_when_too_low(void **state);
|
||||||
|
void cmd_account_does_not_set_priority_when_too_high(void **state);
|
||||||
|
@ -243,6 +243,7 @@ int main(int argc, char* argv[]) {
|
|||||||
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),
|
unit_test(cmd_account_does_not_set_priority_when_too_low),
|
||||||
|
unit_test(cmd_account_does_not_set_priority_when_too_high),
|
||||||
};
|
};
|
||||||
return run_tests(tests);
|
return run_tests(tests);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user