本文整理汇总了C++中cmd_account函数的典型用法代码示例。如果您正苦于以下问题:C++ cmd_account函数的具体用法?C++ cmd_account怎么用?C++ cmd_account使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cmd_account函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: cmd_account_set_priority_updates_presence_when_account_connected_with_presence
void cmd_account_set_priority_updates_presence_when_account_connected_with_presence(void **state)
{
stub_cons_show();
stub_accounts_set_priorities();
mock_accounts_get_last_presence();
mock_presence_update();
CommandHelp *help = malloc(sizeof(CommandHelp));
gchar *args[] = { "set", "a_account", "online", "10", NULL };
accounts_account_exists_return(TRUE);
mock_connection_status(JABBER_CONNECTED);
mock_connection_account_name("a_account");
accounts_get_last_presence_return(RESOURCE_ONLINE);
mock_connection_presence_message("Free to chat");
presence_update_expect(RESOURCE_ONLINE, "Free to chat", 0);
gboolean result = cmd_account(args, *help);
assert_true(result);
free(help);
}
开发者ID:AlexTalker,项目名称:profanity,代码行数:25,代码来源:test_cmd_account.c
示例2: cmd_account_rename_shows_usage_when_no_args
void cmd_account_rename_shows_usage_when_no_args(void **state)
{
gchar *args[] = { "rename", NULL };
expect_string(cons_bad_cmd_usage, cmd, CMD_ACCOUNT);
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
开发者ID:halfur,项目名称:profanity,代码行数:9,代码来源:test_cmd_account.c
示例3: cmd_account_show_message_for_missing_otr_policy
void cmd_account_show_message_for_missing_otr_policy(void **state)
{
gchar *args[] = { "set", "a_account", "otr", NULL };
expect_string(cons_bad_cmd_usage, cmd, CMD_ACCOUNT);
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
开发者ID:halfur,项目名称:profanity,代码行数:9,代码来源:test_cmd_account.c
示例4: cmd_account_clear_shows_usage_when_one_arg
void cmd_account_clear_shows_usage_when_one_arg(void **state)
{
gchar *args[] = { "clear", "a_account", NULL };
expect_string(cons_bad_cmd_usage, cmd, CMD_ACCOUNT);
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
开发者ID:halfur,项目名称:profanity,代码行数:9,代码来源:test_cmd_account.c
示例5: cmd_account_set_shows_usage_when_two_args
void cmd_account_set_shows_usage_when_two_args(void **state)
{
gchar *args[] = { "set", "a_account", "a_property", NULL };
expect_string(cons_bad_cmd_usage, cmd, CMD_ACCOUNT);
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
开发者ID:halfur,项目名称:profanity,代码行数:9,代码来源:test_cmd_account.c
示例6: cmd_account_shows_usage_when_not_connected_and_no_args
void cmd_account_shows_usage_when_not_connected_and_no_args(void **state)
{
gchar *args[] = { NULL };
will_return(connection_get_status, JABBER_DISCONNECTED);
expect_string(cons_bad_cmd_usage, cmd, CMD_ACCOUNT);
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
开发者ID:NiklausHofer,项目名称:profanity,代码行数:11,代码来源:test_cmd_account.c
示例7: cmd_account_set_jid_shows_message_for_malformed_jid
void cmd_account_set_jid_shows_message_for_malformed_jid(void **state)
{
gchar *args[] = { "set", "a_account", "jid", "@malformed", NULL };
expect_any(accounts_account_exists, account_name);
will_return(accounts_account_exists, TRUE);
expect_cons_show("Malformed jid: @malformed");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
开发者ID:halfur,项目名称:profanity,代码行数:12,代码来源:test_cmd_account.c
示例8: cmd_account_show_message_for_invalid_otr_policy
void cmd_account_show_message_for_invalid_otr_policy(void **state)
{
gchar *args[] = { "set", "a_account", "otr", "bad_otr_policy", NULL };
expect_any(accounts_account_exists, account_name);
will_return(accounts_account_exists, TRUE);
expect_cons_show("OTR policy must be one of: manual, opportunistic or always.");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
开发者ID:halfur,项目名称:profanity,代码行数:12,代码来源:test_cmd_account.c
示例9: cmd_account_set_priority_too_high_shows_message
void cmd_account_set_priority_too_high_shows_message(void **state)
{
gchar *args[] = { "set", "a_account", "online", "150", NULL };
expect_any(accounts_account_exists, account_name);
will_return(accounts_account_exists, TRUE);
expect_cons_show("Value 150 out of range. Must be in -128..127.");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
开发者ID:halfur,项目名称:profanity,代码行数:12,代码来源:test_cmd_account.c
示例10: cmd_account_set_priority_when_empty_shows_message
void cmd_account_set_priority_when_empty_shows_message(void **state)
{
gchar *args[] = { "set", "a_account", "online", "", NULL };
expect_any(accounts_account_exists, account_name);
will_return(accounts_account_exists, TRUE);
expect_cons_show("Could not convert \"\" to a number.");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
开发者ID:halfur,项目名称:profanity,代码行数:12,代码来源:test_cmd_account.c
示例11: cmd_account_disable_shows_message_when_account_doesnt_exist
void cmd_account_disable_shows_message_when_account_doesnt_exist(void **state)
{
gchar *args[] = { "disable", "account_name", NULL };
expect_any(accounts_disable, name);
will_return(accounts_disable, FALSE);
expect_cons_show("No such account: account_name");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
开发者ID:halfur,项目名称:profanity,代码行数:13,代码来源:test_cmd_account.c
示例12: cmd_account_disable_disables_account
void cmd_account_disable_disables_account(void **state)
{
gchar *args[] = { "disable", "account_name", NULL };
expect_string(accounts_disable, name, "account_name");
will_return(accounts_disable, TRUE);
expect_cons_show("Account disabled.");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
开发者ID:halfur,项目名称:profanity,代码行数:13,代码来源:test_cmd_account.c
示例13: cmd_account_add_adds_account
void cmd_account_add_adds_account(void **state)
{
gchar *args[] = { "add", "new_account", NULL };
expect_string(accounts_add, jid, "new_account");
expect_value(accounts_add, altdomain, NULL);
expect_value(accounts_add, port, 0);
expect_cons_show("Account created.");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
开发者ID:halfur,项目名称:profanity,代码行数:13,代码来源:test_cmd_account.c
示例14: cmd_identify_finish
gboolean cmd_identify_finish(gpointer data, gint fd, b_input_condition cond)
{
char *account_on[] = { "account", "on", NULL };
irc_t *irc = data;
if (set_getbool(&irc->b->set, "auto_connect")) {
cmd_account(irc, account_on);
}
b_event_remove(irc->login_source_id);
irc->login_source_id = -1;
return FALSE;
}
开发者ID:EionRobb,项目名称:bitlbee,代码行数:13,代码来源:root_commands.c
示例15: cmd_account_clear_shows_message_when_invalid_property
void cmd_account_clear_shows_message_when_invalid_property(void **state)
{
gchar *args[] = { "clear", "a_account", "badproperty", NULL };
expect_any(accounts_account_exists, account_name);
will_return(accounts_account_exists, TRUE);
expect_cons_show("Invalid property: badproperty");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
开发者ID:halfur,项目名称:profanity,代码行数:13,代码来源:test_cmd_account.c
示例16: cmd_account_show_shows_message_when_account_does_not_exist
void cmd_account_show_shows_message_when_account_does_not_exist(void **state)
{
gchar *args[] = { "show", "account_name", NULL };
expect_any(accounts_get_account, name);
will_return(accounts_get_account, NULL);
expect_cons_show("No such account.");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
开发者ID:halfur,项目名称:profanity,代码行数:13,代码来源:test_cmd_account.c
示例17: cmd_account_clear_shows_message_when_account_doesnt_exist
void cmd_account_clear_shows_message_when_account_doesnt_exist(void **state)
{
gchar *args[] = { "clear", "a_account", "a_property", NULL };
expect_string(accounts_account_exists, account_name, "a_account");
will_return(accounts_account_exists, FALSE);
expect_cons_show("Account a_account doesn't exist");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
开发者ID:halfur,项目名称:profanity,代码行数:13,代码来源:test_cmd_account.c
示例18: cmd_account_set_last_priority_shows_message
void cmd_account_set_last_priority_shows_message(void **state)
{
gchar *args[] = { "set", "a_account", "last", "10", NULL };
expect_any(accounts_account_exists, account_name);
will_return(accounts_account_exists, TRUE);
expect_cons_show("Invalid property: last");
expect_cons_show("");
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
开发者ID:halfur,项目名称:profanity,代码行数:13,代码来源:test_cmd_account.c
示例19: cmd_account_add_adds_account
void cmd_account_add_adds_account(void **state)
{
stub_cons_show();
mock_accounts_add();
CommandHelp *help = malloc(sizeof(CommandHelp));
gchar *args[] = { "add", "new_account", NULL };
accounts_add_expect_account_name("new_account");
gboolean result = cmd_account(args, *help);
assert_true(result);
free(help);
}
开发者ID:AlexTalker,项目名称:profanity,代码行数:14,代码来源:test_cmd_account.c
示例20: cmd_account_show_shows_account_when_exists
void cmd_account_show_shows_account_when_exists(void **state)
{
gchar *args[] = { "show", "account_name", NULL };
ProfAccount *account = account_new("jabber_org", "[email protected]", NULL, NULL,
TRUE, NULL, 0, NULL, NULL, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
expect_any(accounts_get_account, name);
will_return(accounts_get_account, account);
expect_memory(cons_show_account, account, account, sizeof(account));
gboolean result = cmd_account(NULL, CMD_ACCOUNT, args);
assert_true(result);
}
开发者ID:halfur,项目名称:profanity,代码行数:14,代码来源:test_cmd_account.c
注:本文中的cmd_account函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论