1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-16 21:35:24 +00:00

Added carbons command functional test

This commit is contained in:
James Booth 2015-07-05 17:29:33 +01:00
parent 252c7c2e06
commit 5e324e407f
4 changed files with 31 additions and 0 deletions

View File

@ -101,6 +101,7 @@ functionaltest_sources = \
tests/functionaltests/test_presence.c tests/functionaltests/test_presence.h \
tests/functionaltests/test_message.c tests/functionaltests/test_message.h \
tests/functionaltests/test_chat_session.c tests/functionaltests/test_chat_session.h \
tests/functionaltests/test_carbons.c tests/functionaltests/test_carbons.h \
tests/functionaltests/functionaltests.c
main_source = src/main.c

View File

@ -15,6 +15,7 @@
#include "test_rooms.h"
#include "test_presence.h"
#include "test_message.h"
#include "test_carbons.h"
#include "test_chat_session.h"
int main(int argc, char* argv[]) {
@ -113,6 +114,10 @@ int main(int argc, char* argv[]) {
unit_test_setup_teardown(new_session_when_message_received_from_different_fulljid,
init_prof_test,
close_prof_test),
unit_test_setup_teardown(send_enable_carbons,
init_prof_test,
close_prof_test),
};
return run_tests(all_tests);

View File

@ -0,0 +1,24 @@
#include <glib.h>
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <cmocka.h>
#include <stdlib.h>
#include <string.h>
#include <stabber.h>
#include <expect.h>
#include "proftest.h"
void
send_enable_carbons(void **state)
{
prof_connect();
prof_input("/carbons on");
assert_true(stbbr_received(
"<iq id=\"*\" type=\"set\"><enable xmlns=\"urn:xmpp:carbons:2\"/></iq>"
));
}

View File

@ -0,0 +1 @@
void send_enable_carbons(void **state);