/* * test_lastactivity.c * Functional tests for Last Activity (XEP-0012) */ #include #include "prof_cmocka.h" #include #include #include #include "proftest.h" void responds_to_last_activity_request(void **state) { prof_connect(); // Send incoming last activity request stbbr_send( "" "" "" ); // Verify that CProof responds with last activity info // The 'seconds' attribute indicates idle time assert_true(stbbr_received( "" "" "" )); } void last_activity_request_to_contact(void **state) { prof_connect(); stbbr_send( "" "10" "I'm here" "" ); assert_true(prof_output_exact("Buddy1 (mobile) is online, \"I'm here\"")); // Register response for last activity query stbbr_for_query("jabber:iq:last", "" "" "" ); prof_input("/lastactivity get buddy1@localhost/mobile"); // Verify the request was sent assert_true(stbbr_received( "" "" "" )); }