about summary refs log tree commit diff stats
path: root/tests/unittests/test_cmd_pgp.h
blob: 0d681a4a9c6dccc09d463eda0f4503ec8a6da903 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "config.h"

#ifdef HAVE_LIBGPGME
void cmd_pgp_shows_usage_when_no_args(void **state);
void cmd_pgp_start_shows_message_when_disconnected(void **state);
void cmd_pgp_start_shows_message_when_disconnecting(void **state);
void cmd_pgp_start_shows_message_when_connecting(void **state);
void cmd_pgp_start_shows_message_when_undefined(void **state);
void cmd_pgp_start_shows_message_when_no_arg_in_console(void **state);
void cmd_pgp_start_shows_message_when_no_arg_in_muc(void **state);
void cmd_pgp_start_shows_message_when_no_arg_in_mucconf(void **state);
void cmd_pgp_start_shows_message_when_no_arg_in_private(void **state);
void cmd_pgp_start_shows_message_when_no_arg_in_xmlconsole(void **state);
#else
void cmd_pgp_shows_message_when_pgp_unsupported(void **state);
#endif
="cpf"><cmocka.h> #include <stdlib.h> #include <string.h> #include <stabber.h> #include <expect.h> #include "proftest.h" void sends_new_item(void **state) { prof_connect(); stbbr_for_query("jabber:iq:roster", "<iq type=\"set\" from=\"stabber@localhost\">" "<query xmlns=\"jabber:iq:roster\">" "<item jid=\"bob@localhost\" subscription=\"none\" name=\"\"/>" "</query>" "</iq>" ); prof_input("/roster add bob@localhost"); assert_true(stbbr_received( "<iq type=\"set\" id=\"*\">" "<query xmlns=\"jabber:iq:roster\">" "<item jid=\"bob@localhost\" name=\"\"/>" "</query>" "</iq>" )); assert_true(prof_output_exact("Roster item added: bob@localhost")); } void sends_new_item_nick(void **state) { prof_connect(); stbbr_for_query("jabber:iq:roster", "<iq type=\"set\" from=\"stabber@localhost\">" "<query xmlns=\"jabber:iq:roster\">" "<item jid=\"bob@localhost\" subscription=\"none\" name=\"Bobby\"/>" "</query>" "</iq>" ); prof_input("/roster add bob@localhost Bobby"); assert_true(stbbr_received( "<iq type=\"set\" id=\"*\">" "<query xmlns=\"jabber:iq:roster\">" "<item jid=\"bob@localhost\" name=\"Bobby\"/>" "</query>" "</iq>" )); assert_true(prof_output_exact("Roster item added: bob@localhost (Bobby)")); } void sends_remove_item(void **state) { prof_connect_with_roster( "<item jid=\"buddy1@localhost\" subscription=\"both\"/>" "<item jid=\"buddy2@localhost\" subscription=\"both\"/>" ); stbbr_for_query("jabber:iq:roster", "<iq id=\"*\" type=\"set\">" "<query xmlns=\"jabber:iq:roster\">" "<item jid=\"buddy1@localhost\" subscription=\"remove\"/>" "</query>" "</iq>" ); prof_input("/roster remove buddy1@localhost"); assert_true(stbbr_received( "<iq type=\"set\" id=\"*\">" "<query xmlns=\"jabber:iq:roster\">" "<item jid=\"buddy1@localhost\" subscription=\"remove\"/>" "</query>" "</iq>" )); assert_true(prof_output_exact("Roster item removed: buddy1@localhost")); } void sends_nick_change(void **state) { prof_connect_with_roster( "<item jid=\"buddy1@localhost\" subscription=\"both\"/>" ); prof_input("/roster nick buddy1@localhost Buddy1"); assert_true(prof_output_exact("Nickname for buddy1@localhost set to: Buddy1.")); assert_true(stbbr_received( "<iq type=\"set\" id=\"*\">" "<query xmlns=\"jabber:iq:roster\">" "<item jid=\"buddy1@localhost\" name=\"Buddy1\"/>" "</query>" "</iq>" )); }