about summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-08-04 23:22:43 +0100
committerJames Booth <boothj5@gmail.com>2015-08-04 23:22:43 +0100
commit2cb2f83ce3519a40f752ca2be7a07669a125ed1b (patch)
tree3bdeeab37f0db0cf84ee8b50f8b81ae4e5a80f11 /tests
parent091a23fc48a23e48e5e1aad6bb0d900c2b48cdc5 (diff)
downloadprofani-tty-2cb2f83ce3519a40f752ca2be7a07669a125ed1b.tar.gz
Added test for missing resource on presence
Diffstat (limited to 'tests')
-rw-r--r--tests/functionaltests/functionaltests.c1
-rw-r--r--tests/functionaltests/test_presence.c19
-rw-r--r--tests/functionaltests/test_presence.h1
3 files changed, 21 insertions, 0 deletions
diff --git a/tests/functionaltests/functionaltests.c b/tests/functionaltests/functionaltests.c
index 6eb57589..4b2b76ee 100644
--- a/tests/functionaltests/functionaltests.c
+++ b/tests/functionaltests/functionaltests.c
@@ -50,6 +50,7 @@ int main(int argc, char* argv[]) {
         PROF_FUNC_TEST(presence_set_priority),
         PROF_FUNC_TEST(presence_includes_priority),
         PROF_FUNC_TEST(presence_received),
+        PROF_FUNC_TEST(presence_missing_resource_defaults),
 
         PROF_FUNC_TEST(message_send),
         PROF_FUNC_TEST(message_receive),
diff --git a/tests/functionaltests/test_presence.c b/tests/functionaltests/test_presence.c
index cb2eacd3..936d9405 100644
--- a/tests/functionaltests/test_presence.c
+++ b/tests/functionaltests/test_presence.c
@@ -241,3 +241,22 @@ presence_received(void **state)
 
     assert_true(prof_output_exact("Buddy1 (mobile) is online, \"I'm here\""));
 }
+
+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"));
+}
diff --git a/tests/functionaltests/test_presence.h b/tests/functionaltests/test_presence.h
index 0603732a..7df362bf 100644
--- a/tests/functionaltests/test_presence.h
+++ b/tests/functionaltests/test_presence.h
@@ -11,3 +11,4 @@ void presence_chat_with_message(void **state);
 void presence_set_priority(void **state);
 void presence_includes_priority(void **state);
 void presence_received(void **state);
+void presence_missing_resource_defaults(void **state);