about summary refs log tree commit diff stats
path: root/tests/xmpp/mock_xmpp.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-01-18 20:34:46 +0000
committerJames Booth <boothj5@gmail.com>2014-01-18 20:34:46 +0000
commit39e0782da8a45a40df280eda5abf9051a575a9fa (patch)
tree8c3b2dad8cbb56a8f13795bf64010b7d96d8bea5 /tests/xmpp/mock_xmpp.c
parente7013408e5640cd41524a17c6f8f112eef1b54da (diff)
downloadprofani-tty-39e0782da8a45a40df280eda5abf9051a575a9fa.tar.gz
Fixed test compilation
Diffstat (limited to 'tests/xmpp/mock_xmpp.c')
-rw-r--r--tests/xmpp/mock_xmpp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/xmpp/mock_xmpp.c b/tests/xmpp/mock_xmpp.c
index 70bcbc3b..c569d67f 100644
--- a/tests/xmpp/mock_xmpp.c
+++ b/tests/xmpp/mock_xmpp.c
@@ -28,11 +28,12 @@ _mock_iq_room_list_request(gchar *conf_server)
 
 static jabber_conn_status_t
 _mock_jabber_connect_with_details(const char * const jid,
-    const char * const passwd, const char * const altdomain)
+    const char * const passwd, const char * const altdomain, const int port)
 {
     check_expected(jid);
     check_expected(passwd);
     check_expected(altdomain);
+    check_expected(port);
     return (jabber_conn_status_t)mock();
 }
 
02-23 01:30:37 +0000 Add fancy_bar that contains stop, backward and forward buttonn and search' href='/novaburst/xombrero/commit/xxxterm.conf?id=bb7626ed408a8d78ffee249576b0b85aecc6cb68'>bb7626e ^
27f4f8a ^
51ec974 ^

486b84d ^

7c76d9a ^
76d9462 ^
74ec50b ^
e42df56 ^
51ec974 ^
b5dceea ^


51ec974 ^

543a5d5 ^


bb7626e ^




cee19a8 ^

bb7626e ^





facf22a ^
568d018 ^



facf22a ^








58c7ecb ^


d3a5449 ^


51ec974 ^





feae18c ^
51ec974 ^



b5dceea ^

22fdef8 ^
b5dceea ^
bfe757b ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82

           
                                                 
                           
                           
                                    
                           
                           
                           

                           
                            
                           
                           

                              

                                           
                           
                           
                           
                                                   
 


                                   

                                                  


                                                                        




                                                             

                                                                            





                                                                           
 



                                                  








                                                 


                                               


                                                    





                                           
                                        



                                             

                       
                                        
                                       
rg/protocol/caps' ver='*' node='http://profanity-im.github.io'/>"
        "</presence>"
    ));

    assert_true(prof_output_exact("Status set to xa (priority 0), \"Gone to the shops\"."));
}

void
presence_dnd(void **state)
{
    prof_connect();

    prof_input("/dnd");

    assert_true(stbbr_received(
        "<presence id='prof_presence_4'>"
            "<show>dnd</show>"
            "<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://profanity-im.github.io'/>"
        "</presence>"
    ));

    assert_true(prof_output_exact("Status set to dnd (priority 0)"));
}

void
presence_dnd_with_message(void **state)
{
    prof_connect();

    prof_input("/dnd \"Working\"");

    assert_true(stbbr_received(
        "<presence id='prof_presence_4'>"
            "<show>dnd</show>"
            "<status>Working</status>"
            "<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://profanity-im.github.io'/>"
        "</presence>"
    ));

    assert_true(prof_output_exact("Status set to dnd (priority 0), \"Working\"."));
}

void
presence_chat(void **state)
{
    prof_connect();

    prof_input("/chat");

    assert_true(stbbr_received(
        "<presence id='prof_presence_4'>"
            "<show>chat</show>"
            "<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://profanity-im.github.io'/>"
        "</presence>"
    ));

    assert_true(prof_output_exact("Status set to chat (priority 0)"));
}

void
presence_chat_with_message(void **state)
{
    prof_connect();

    prof_input("/chat \"Free to talk\"");

    assert_true(stbbr_received(
        "<presence id='prof_presence_4'>"
            "<show>chat</show>"
            "<status>Free to talk</status>"
            "<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://profanity-im.github.io'/>"
        "</presence>"
    ));

    assert_true(prof_output_exact("Status set to chat (priority 0), \"Free to talk\"."));
}

void
presence_set_priority(void **state)
{
    prof_connect();

    prof_input("/priority 25");

    assert_true(stbbr_received(
        "<presence id='prof_presence_4'>"
            "<priority>25</priority>"
            "<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://profanity-im.github.io'/>"
        "</presence>"
    ));

    assert_true(prof_output_exact("Priority set to 25."));
}

void
presence_includes_priority(void **state)
{
    prof_connect();

    prof_input("/priority 25");
    assert_true(stbbr_received(
        "<presence id='prof_presence_4'>"
            "<priority>25</priority>"
            "<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://profanity-im.github.io'/>"
        "</presence>"
    ));
    assert_true(prof_output_exact("Priority set to 25."));

    prof_input("/chat \"Free to talk\"");
    assert_true(stbbr_received(
        "<presence id='prof_presence_5'>"
            "<priority>25</priority>"
            "<show>chat</show>"
            "<status>Free to talk</status>"
            "<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://profanity-im.github.io'/>"
        "</presence>"
    ));
    assert_true(prof_output_exact("Status set to chat (priority 25), \"Free to talk\"."));
}

void
presence_keeps_status(void **state)
{
    prof_connect();

    prof_input("/chat \"Free to talk\"");
    assert_true(stbbr_received(
        "<presence id='prof_presence_4'>"
            "<show>chat</show>"
            "<status>Free to talk</status>"
            "<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://profanity-im.github.io'/>"
        "</presence>"
    ));
    assert_true(prof_output_exact("Status set to chat (priority 0), \"Free to talk\"."));

    prof_input("/priority 25");
    assert_true(stbbr_received(
        "<presence id='prof_presence_5'>"
            "<show>chat</show>"
            "<status>Free to talk</status>"
            "<priority>25</priority>"
            "<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://profanity-im.github.io'/>"
        "</presence>"
    ));
    assert_true(prof_output_exact("Priority set to 25."));
}

void
presence_received(void **state)
{
    prof_connect();

    stbbr_send(
        "<presence to='stabber@localhost' from='buddy1@localhost/mobile'>"
            "<priority>10</priority>"
            "<status>I'm here</status>"
        "</presence>"
    );

    assert_true(prof_output_exact("Buddy1 (mobile) is online, \"I'm here\""));
}

// Typical use case for gateways that don't support resources
void
presence_missing_resource_defaults(void **state)
{
    prof_connect();

    stbbr_send(
        "<presence to='stabber@localhost' from='buddy1@localhost'>"
            "<priority>15</priority>"
            "<status>My status</status>"
        "</presence>"
    );

    assert_true(prof_output_exact("Buddy1 is online, \"My status\""));

    prof_input("/info Buddy1");

    assert_true(prof_output_exact("__prof_default (15), online"));
}