about summary refs log tree commit diff stats
path: root/html/subx/015immediate_addressing.cc.html
diff options
context:
space:
mode:
Diffstat (limited to 'html/subx/015immediate_addressing.cc.html')
-rw-r--r--html/subx/015immediate_addressing.cc.html26
1 files changed, 13 insertions, 13 deletions
diff --git a/html/subx/015immediate_addressing.cc.html b/html/subx/015immediate_addressing.cc.html
index e3d4b190..bb282579 100644
--- a/html/subx/015immediate_addressing.cc.html
+++ b/html/subx/015immediate_addressing.cc.html
@@ -84,7 +84,7 @@ if ('onhashchange' in window) {
 <span id="L20" class="LineNr"> 20 </span>  <a href='003trace.cc.html#L196'>trace</a><span class="Delimiter">(</span><span class="Constant">90</span><span class="Delimiter">,</span> <span class="Constant">&quot;run&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;combine imm32 with r/m32&quot;</span> &lt;&lt; <a href='003trace.cc.html#L222'>end</a><span class="Delimiter">();</span>
 <span id="L21" class="LineNr"> 21 </span>  <span class="Normal">uint8_t</span> modrm = <a href='010---vm.cc.html#L214'>next</a><span class="Delimiter">();</span>
 <span id="L22" class="LineNr"> 22 </span>  <span class="Normal">int32_t</span>* arg1 = <a href='013direct_addressing.cc.html#L31'>effective_address</a><span class="Delimiter">(</span>modrm<span class="Delimiter">);</span>
-<span id="L23" class="LineNr"> 23 </span>  <span class="Normal">int32_t</span> arg2 = <a href='011run.cc.html#L299'>next32</a><span class="Delimiter">();</span>
+<span id="L23" class="LineNr"> 23 </span>  <span class="Normal">int32_t</span> arg2 = <a href='011run.cc.html#L302'>next32</a><span class="Delimiter">();</span>
 <span id="L24" class="LineNr"> 24 </span>  <a href='003trace.cc.html#L196'>trace</a><span class="Delimiter">(</span><span class="Constant">90</span><span class="Delimiter">,</span> <span class="Constant">&quot;run&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;imm32 is 0x&quot;</span> &lt;&lt; <a href='010---vm.cc.html#L260'>HEXWORD</a> &lt;&lt; arg2 &lt;&lt; <a href='003trace.cc.html#L222'>end</a><span class="Delimiter">();</span>
 <span id="L25" class="LineNr"> 25 </span>  <span class="Normal">uint8_t</span> subop = <span class="Delimiter">(</span>modrm&gt;&gt;<span class="Constant">3</span><span class="Delimiter">)</span>&amp;<span class="Constant">0x7</span><span class="Delimiter">;</span>  <span class="Comment">// middle 3 'reg opcode' bits</span>
 <span id="L26" class="LineNr"> 26 </span>  <span class="Normal">switch</span> <span class="Delimiter">(</span>subop<span class="Delimiter">)</span> <span class="Delimiter">{</span>
@@ -131,7 +131,7 @@ if ('onhashchange' in window) {
 <span id="L67" class="LineNr"> 67 </span>
 <span id="L68" class="LineNr"> 68 </span><span class="Delimiter">:(before &quot;End Single-Byte Opcodes&quot;)</span>
 <span id="L69" class="LineNr"> 69 </span><span class="Normal">case</span> <span class="Constant">0x2d</span>: <span class="Delimiter">{</span>  <span class="Comment">// subtract imm32 from EAX</span>
-<span id="L70" class="LineNr"> 70 </span>  <span class="Normal">int32_t</span> arg2 = <a href='011run.cc.html#L299'>next32</a><span class="Delimiter">();</span>
+<span id="L70" class="LineNr"> 70 </span>  <span class="Normal">int32_t</span> arg2 = <a href='011run.cc.html#L302'>next32</a><span class="Delimiter">();</span>
 <span id="L71" class="LineNr"> 71 </span>  <a href='003trace.cc.html#L196'>trace</a><span class="Delimiter">(</span><span class="Constant">90</span><span class="Delimiter">,</span> <span class="Constant">&quot;run&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;subtract imm32 0x&quot;</span> &lt;&lt; <a href='010---vm.cc.html#L260'>HEXWORD</a> &lt;&lt; arg2 &lt;&lt; <span class="Constant">&quot; from EAX&quot;</span> &lt;&lt; <a href='003trace.cc.html#L222'>end</a><span class="Delimiter">();</span>
 <span id="L72" class="LineNr"> 72 </span>  <a href='010---vm.cc.html#L69'>BINARY_ARITHMETIC_OP</a><span class="Delimiter">(</span>-<span class="Delimiter">,</span> Reg[EAX]<span class="Delimiter">.</span>i<span class="Delimiter">,</span> arg2<span class="Delimiter">);</span>
 <span id="L73" class="LineNr"> 73 </span>  <span class="Identifier">break</span><span class="Delimiter">;</span>
@@ -189,7 +189,7 @@ if ('onhashchange' in window) {
 <span id="L125" class="LineNr">125 </span>
 <span id="L126" class="LineNr">126 </span><span class="Delimiter">:(before &quot;End Single-Byte Opcodes&quot;)</span>
 <span id="L127" class="LineNr">127 </span><span class="Normal">case</span> <span class="Constant">0x25</span>: <span class="Delimiter">{</span>  <span class="Comment">// and imm32 with EAX</span>
-<span id="L128" class="LineNr">128 </span>  <span class="Normal">int32_t</span> arg2 = <a href='011run.cc.html#L299'>next32</a><span class="Delimiter">();</span>
+<span id="L128" class="LineNr">128 </span>  <span class="Normal">int32_t</span> arg2 = <a href='011run.cc.html#L302'>next32</a><span class="Delimiter">();</span>
 <span id="L129" class="LineNr">129 </span>  <a href='003trace.cc.html#L196'>trace</a><span class="Delimiter">(</span><span class="Constant">90</span><span class="Delimiter">,</span> <span class="Constant">&quot;run&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;and imm32 0x&quot;</span> &lt;&lt; <a href='010---vm.cc.html#L260'>HEXWORD</a> &lt;&lt; arg2 &lt;&lt; <span class="Constant">&quot; with EAX&quot;</span> &lt;&lt; <a href='003trace.cc.html#L222'>end</a><span class="Delimiter">();</span>
 <span id="L130" class="LineNr">130 </span>  <a href='010---vm.cc.html#L81'>BINARY_BITWISE_OP</a><span class="Delimiter">(</span>&amp;<span class="Delimiter">,</span> Reg[EAX]<span class="Delimiter">.</span>i<span class="Delimiter">,</span> arg2<span class="Delimiter">);</span>
 <span id="L131" class="LineNr">131 </span>  <span class="Identifier">break</span><span class="Delimiter">;</span>
@@ -247,7 +247,7 @@ if ('onhashchange' in window) {
 <span id="L183" class="LineNr">183 </span>
 <span id="L184" class="LineNr">184 </span><span class="Delimiter">:(before &quot;End Single-Byte Opcodes&quot;)</span>
 <span id="L185" class="LineNr">185 </span><span class="Normal">case</span> <span class="Constant">0x0d</span>: <span class="Delimiter">{</span>  <span class="Comment">// or imm32 with EAX</span>
-<span id="L186" class="LineNr">186 </span>  <span class="Normal">int32_t</span> arg2 = <a href='011run.cc.html#L299'>next32</a><span class="Delimiter">();</span>
+<span id="L186" class="LineNr">186 </span>  <span class="Normal">int32_t</span> arg2 = <a href='011run.cc.html#L302'>next32</a><span class="Delimiter">();</span>
 <span id="L187" class="LineNr">187 </span>  <a href='003trace.cc.html#L196'>trace</a><span class="Delimiter">(</span><span class="Constant">90</span><span class="Delimiter">,</span> <span class="Constant">&quot;run&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;or imm32 0x&quot;</span> &lt;&lt; <a href='010---vm.cc.html#L260'>HEXWORD</a> &lt;&lt; arg2 &lt;&lt; <span class="Constant">&quot; with EAX&quot;</span> &lt;&lt; <a href='003trace.cc.html#L222'>end</a><span class="Delimiter">();</span>
 <span id="L188" class="LineNr">188 </span>  <a href='010---vm.cc.html#L81'>BINARY_BITWISE_OP</a><span class="Delimiter">(</span>|<span class="Delimiter">,</span> Reg[EAX]<span class="Delimiter">.</span>i<span class="Delimiter">,</span> arg2<span class="Delimiter">);</span>
 <span id="L189" class="LineNr">189 </span>  <span class="Identifier">break</span><span class="Delimiter">;</span>
@@ -303,7 +303,7 @@ if ('onhashchange' in window) {
 <span id="L239" class="LineNr">239 </span>
 <span id="L240" class="LineNr">240 </span><span class="Delimiter">:(before &quot;End Single-Byte Opcodes&quot;)</span>
 <span id="L241" class="LineNr">241 </span><span class="Normal">case</span> <span class="Constant">0x35</span>: <span class="Delimiter">{</span>  <span class="Comment">// xor imm32 with EAX</span>
-<span id="L242" class="LineNr">242 </span>  <span class="Normal">int32_t</span> arg2 = <a href='011run.cc.html#L299'>next32</a><span class="Delimiter">();</span>
+<span id="L242" class="LineNr">242 </span>  <span class="Normal">int32_t</span> arg2 = <a href='011run.cc.html#L302'>next32</a><span class="Delimiter">();</span>
 <span id="L243" class="LineNr">243 </span>  <a href='003trace.cc.html#L196'>trace</a><span class="Delimiter">(</span><span class="Constant">90</span><span class="Delimiter">,</span> <span class="Constant">&quot;run&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;xor imm32 0x&quot;</span> &lt;&lt; <a href='010---vm.cc.html#L260'>HEXWORD</a> &lt;&lt; arg2 &lt;&lt; <span class="Constant">&quot; with EAX&quot;</span> &lt;&lt; <a href='003trace.cc.html#L222'>end</a><span class="Delimiter">();</span>
 <span id="L244" class="LineNr">244 </span>  <a href='010---vm.cc.html#L81'>BINARY_BITWISE_OP<
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <cmocka.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>

#include "xmpp/xmpp.h"

#include "ui/ui.h"
#include "ui/stub_ui.h"

#include "command/cmd_funcs.h"
#include "config/accounts.h"

#define CMD_CONNECT "/connect"

static void
test_with_connection_status(jabber_conn_status_t status)
{
    will_return(connection_get_status, status);

    expect_cons_show("You are either connected already, or a login is in process.");

    gboolean result = cmd_connect(NULL, CMD_CONNECT, NULL);
    assert_true(result);
}

void
cmd_connect_shows_message_when_disconnecting(void** state)
{
    test_with_connection_status(JABBER_DISCONNECTING);
}

void
cmd_connect_shows_message_when_connecting(void** state)
{
    test_with_connection_status(JABBER_CONNECTING);
}

void
cmd_connect_shows_message_when_connected(void** state)
{
    test_with_connection_status(JABBER_CONNECTED);
}

void
cmd_connect_when_no_account(void** state)
{
    gchar* args[] = { "user@server.org", NULL };

    will_return(connection_get_status, JABBER_DISCONNECTED);

    expect_string(accounts_get_account, name, "user@server.org");
    will_return(accounts_get_account, NULL);

    will_return(ui_ask_password, strdup("password"));

    expect_cons_show("Connecting as user@server.org");

    expect_string(session_connect_with_details, jid, "user@server.org");
    expect_string(session_connect_with_details, passwd, "password");
    expect_value(session_connect_with_details, altdomain, NULL);
    expect_value(session_connect_with_details, port, 0);
    will_return(session_connect_with_details, JABBER_CONNECTING);

    gboolean result = cmd_connect(NULL, CMD_CONNECT, args);
    assert_true(result);
}

void
cmd_connect_fail_message(void** state)
{
    gchar* args[] = { "user@server.org", NULL };

    will_return(connection_get_status, JABBER_DISCONNECTED);

    expect_any(accounts_get_account, name);
    will_return(accounts_get_account, NULL);

    will_return(ui_ask_password, strdup("password"));

    expect_cons_show("Connecting as user@server.org");

    expect_any(session_connect_with_details, jid);
    expect_any(session_connect_with_details, passwd);
    expect_any(session_connect_with_details, altdomain);
    expect_any(session_connect_with_details, port);
    will_return(session_connect_with_details, JABBER_DISCONNECTED);

    expect_cons_show_error("Connection attempt for user@server.org failed.");

    gboolean result = cmd_connect(NULL, CMD_CONNECT, args);
    assert_true(result);
}

void
cmd_connect_lowercases_argument_with_no_account(void** state)
{
    gchar* args[] = { "USER@server.ORG", NULL };

    will_return(connection_get_status, JABBER_DISCONNECTED);

    expect_string(accounts_get_account, name, "USER@server.ORG");
    will_return(accounts_get_account, NULL);

    will_return(ui_ask_password, strdup("password"));

    expect_cons_show("Connecting as user@server.org");

    expect_string(session_connect_with_details, jid, "user@server.org");
    expect_string(session_connect_with_details, passwd, "password");
    expect_value(session_connect_with_details, altdomain, NULL);
    expect_value(session_connect_with_details, port, 0);
    will_return(session_connect_with_details, JABBER_CONNECTING);

    gboolean result = cmd_connect(NULL, CMD_CONNECT, args);
    assert_true(result);
}

void
cmd_connect_lowercases_argument_with_account(void** state)
{
    gchar* args[] = { "Jabber_org", NULL };
    ProfAccount* account = account_new("Jabber_org", "me@jabber.org", "password", NULL,
                                       TRUE, NULL, 0, NULL, NULL, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

    will_return(connection_get_status, JABBER_DISCONNECTED);

    expect_any(accounts_get_account, name);
    will_return(accounts_get_account, account);

    expect_cons_show("Connecting with account Jabber_org as me@jabber.org");

    expect_memory(session_connect_with_account, account, account, sizeof(account));
    will_return(session_connect_with_account, JABBER_CONNECTING);

    gboolean result = cmd_connect(NULL, CMD_CONNECT, args);
    assert_true(result);
}

void
cmd_connect_asks_password_when_not_in_account(void** state)
{
    gchar* args[] = { "jabber_org", NULL };
    ProfAccount* account = account_new("jabber_org", "me@jabber.org", NULL, NULL,
                                       TRUE, NULL, 0, NULL, NULL, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

    will_return(connection_get_status, JABBER_DISCONNECTED);

    expect_any(accounts_get_account, name);
    will_return(accounts_get_account, account);

    will_return(ui_ask_password, strdup("password"));

    expect_cons_show("Connecting with account jabber_org as me@jabber.org");

    expect_any(session_connect_with_account, account);
    will_return(session_connect_with_account, JABBER_CONNECTING);

    gboolean result = cmd_connect(NULL, CMD_CONNECT, args);
    assert_true(result);
}

void
cmd_connect_shows_usage_when_no_server_value(void** state)
{
    gchar* args[] = { "user@server.org", "server", NULL };

    will_return(connection_get_status, JABBER_DISCONNECTED);

    expect_string(cons_bad_cmd_usage, cmd, CMD_CONNECT);
    expect_cons_show("");

    gboolean result = cmd_connect(NULL, CMD_CONNECT, args);
    assert_true(result);
}

void
cmd_connect_shows_usage_when_server_no_port_value(void** state)
{
    gchar* args[] = { "user@server.org", "server", "aserver", "port", NULL };

    will_return(connection_get_status, JABBER_DISCONNECTED);

    expect_string(cons_bad_cmd_usage, cmd, CMD_CONNECT);
    expect_cons_show("");

    gboolean result = cmd_connect(NULL, CMD_CONNECT, args);
    assert_true(result);
}

void
cmd_connect_shows_usage_when_no_port_value(void** state)
{
    gchar* args[] = { "user@server.org", "port", NULL };

    will_return(connection_get_status, JABBER_DISCONNECTED);

    expect_string(cons_bad_cmd_usage, cmd, CMD_CONNECT);
    expect_cons_show("");

    gboolean result = cmd_connect(NULL, CMD_CONNECT, args);
    assert_true(result);
}

void
cmd_connect_shows_usage_when_port_no_server_value(void** state)
{
    gchar* args[] = { "user@server.org", "port", "5678", "server", NULL };

    will_return(connection_get_status, JABBER_DISCONNECTED);

    expect_string(cons_bad_cmd_usage, cmd, CMD_CONNECT);
    expect_cons_show("");

    gboolean result = cmd_connect(NULL, CMD_CONNECT, args);
    assert_true(result);
}

void
cmd_connect_shows_message_when_port_0(void** state)
{
    gchar* args[] = { "user@server.org", "port", "0", NULL };

    will_return(connection_get_status, JABBER_DISCONNECTED);

    expect_cons_show("Value 0 out of range. Must be in 1..65535.");
    expect_cons_show("");

    gboolean result = cmd_connect(NULL, CMD_CONNECT, args);
    assert_true(result);
}

void
cmd_connect_shows_message_when_port_minus1(void** state)
{
    gchar* args[] = { "user@server.org", "port", "-1", NULL };

    will_return(connection_get_status, JABBER_DISCONNECTED);

    expect_cons_show("Value -1 out of range. Must be in 1..65535.");
    expect_cons_show("");

    gboolean result = cmd_connect(NULL, CMD_CONNECT, args);
    assert_true(result);
}

void
cmd_connect_shows_message_when_port_65536(void** state)
{
    gchar* args[] = { "user@server.org", "port", "65536", NULL };

    will_return(connection_get_status, JABBER_DISCONNECTED);

    expect_cons_show("Value 65536 out of range. Must be in 1..65535.");
    expect_cons_show("");

    gboolean result = cmd_connect(NULL, CMD_CONNECT, args);
    assert_true(result);
}

void
cmd_connect_shows_message_when_port_contains_chars(void** state)
{
    gchar* args[] = { "user@server.org", "port", "52f66", NULL };

    will_return(connection_get_status, JABBER_DISCONNECTED);

    expect_cons_show("Could not convert \"52f66\" to a number.");
    expect_cons_show("");

    gboolean result = cmd_connect(NULL, CMD_CONNECT, args);
    assert_true(result);
}

void
cmd_connect_shows_usage_when_server_provided_twice(void** state)
{
    gchar* args[] = { "user@server.org", "server", "server1", "server", "server2", NULL };

    will_return(connection_get_status, JABBER_DISCONNECTED);

    expect_string(cons_bad_cmd_usage, cmd, CMD_CONNECT);
    expect_cons_show("");

    gboolean result = cmd_connect(NULL, CMD_CONNECT, args);
    assert_true(result);
}

void
cmd_connect_shows_usage_when_port_provided_twice(void** state)
{
    gchar* args[] = { "user@server.org", "port", "1111", "port", "1111", NULL };

    will_return(connection_get_status, JABBER_DISCONNECTED);

    expect_string(cons_bad_cmd_usage, cmd, CMD_CONNECT);
    expect_cons_show("");

    gboolean result = cmd_connect(NULL, CMD_CONNECT, args);
    assert_true(result);
}

void
cmd_connect_shows_usage_when_invalid_first_property(void** state)
{
    gchar* args[] = { "user@server.org", "wrong", "server", NULL };

    will_return(connection_get_status, JABBER_DISCONNECTED);

    expect_string(cons_bad_cmd_usage, cmd, CMD_CONNECT);
    expect_cons_show("");

    gboolean result = cmd_connect(NULL, CMD_CONNECT, args);
    assert_true(result);
}

void
cmd_connect_shows_usage_when_invalid_second_property(void** state)
{
    gchar* args[] = { "user@server.org", "server", "aserver", "wrong", "1234", NULL };

    will_return(connection_get_status, JABBER_DISCONNECTED);

    expect_string(cons_bad_cmd_usage, cmd, CMD_CONNECT);
    expect_cons_show("");

    gboolean result = cmd_connect(NULL, CMD_CONNECT, args);
    assert_true(result);
}

void
cmd_connect_with_server_when_provided(void** state)
{
    gchar* args[] = { "user@server.org", "server", "aserver", NULL };

    will_return(connection_get_status, JABBER_DISCONNECTED);

    expect_string(accounts_get_account, name, "user@server.org");
    will_return(accounts_get_account, NULL);

    will_return(ui_ask_password, strdup("password"));

    expect_cons_show("Connecting as user@server.org");

    expect_string(session_connect_with_details, jid, "user@server.org");
    expect_string(session_connect_with_details, passwd, "password");
    expect_string(session_connect_with_details, altdomain, "aserver");
    expect_value(session_connect_with_details, port, 0);
    will_return(session_connect_with_details, JABBER_CONNECTING);

    gboolean result = cmd_connect(NULL, CMD_CONNECT, args);
    assert_true(result);
}

void
cmd_connect_with_port_when_provided(void** state)
{
    gchar* args[] = { "user@server.org", "port", "5432", NULL };

    will_return(connection_get_status, JABBER_DISCONNECTED);

    expect_string(accounts_get_account, name, "user@server.org");
    will_return(accounts_get_account, NULL);

    will_return(ui_ask_password, strdup("password"));

    expect_cons_show("Connecting as user@server.org");

    expect_string(session_connect_with_details, jid, "user@server.org");
    expect_string(session_connect_with_details, passwd, "password");
    expect_value(session_connect_with_details, altdomain, NULL);
    expect_value(session_connect_with_details, port, 5432);
    will_return(session_connect_with_details, JABBER_CONNECTING);

    gboolean result = cmd_connect(NULL, CMD_CONNECT, args);
    assert_true(result);
}

void
cmd_connect_with_server_and_port_when_provided(void** state)
{
    gchar* args[] = { "user@server.org", "port", "5432", "server", "aserver", NULL };

    will_return(connection_get_status, JABBER_DISCONNECTED);

    expect_string(accounts_get_account, name, "user@server.org");
    will_return(accounts_get_account, NULL);

    will_return(ui_ask_password, strdup("password"));

    expect_cons_show("Connecting as user@server.org");

    expect_string(session_connect_with_details, jid, "user@server.org");
    expect_string(session_connect_with_details, passwd, "password");
    expect_string(session_connect_with_details, altdomain, "aserver");
    expect_value(session_connect_with_details, port, 5432);
    will_return(session_connect_with_details, JABBER_CONNECTING);

    gboolean result = cmd_connect(NULL, CMD_CONNECT, args);
    assert_true(result);
}

void
cmd_connect_shows_message_when_connecting_with_account(void** state)
{
    gchar* args[] = { "jabber_org", NULL };
    ProfAccount* account = account_new("jabber_org", "user@jabber.org", "password", NULL,
                                       TRUE, NULL, 0, "laptop", NULL, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

    will_return(connection_get_status, JABBER_DISCONNECTED);

    expect_any(accounts_get_account, name);
    will_return(accounts_get_account, account);

    expect_cons_show("Connecting with account jabber_org as user@jabber.org/laptop");

    expect_any(session_connect_with_account, account);
    will_return(session_connect_with_account, JABBER_CONNECTING);

    gboolean result = cmd_connect(NULL, CMD_CONNECT, args);
    assert_true(result);
}

void
cmd_connect_connects_with_account(void** state)
{
    gchar* args[] = { "jabber_org", NULL };
    ProfAccount* account = account_new("jabber_org", "me@jabber.org", "password", NULL,
                                       TRUE, NULL, 0, NULL, NULL, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

    will_return(connection_get_status, JABBER_DISCONNECTED);

    expect_any(accounts_get_account, name);
    will_return(accounts_get_account, account);

    expect_cons_show("Connecting with account jabber_org as me@jabber.org");

    expect_memory(session_connect_with_account, account, account, sizeof(account));
    will_return(session_connect_with_account, JABBER_CONNECTING);

    gboolean result = cmd_connect(NULL, CMD_CONNECT, args);
    assert_true(result);
}