mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-18 19:16:21 +00:00
- Replace stbbr_for_id() with stbbr_for_query()/stbbr_send() - Content-based stubbing matches stanzas by namespace instead of ID - Use regex assertions for flexible output matching - Fix timing issues in chat_session and presence tests
35 lines
1.0 KiB
C
35 lines
1.0 KiB
C
#include <glib.h>
|
|
#include "prof_cmocka.h"
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
#include <stabber.h>
|
|
|
|
#include "proftest.h"
|
|
|
|
void
|
|
rooms_query(void **state)
|
|
{
|
|
stbbr_for_query("http://jabber.org/protocol/disco#items",
|
|
"<iq id='*' type='result' to='stabber@localhost/profanity' from='conference.localhost'>"
|
|
"<query xmlns='http://jabber.org/protocol/disco#items'>"
|
|
"<item jid='chatroom@conference.localhost' name='A chat room'/>"
|
|
"<item jid='hangout@conference.localhost' name='Another chat room'/>"
|
|
"</query>"
|
|
"</iq>"
|
|
);
|
|
|
|
prof_connect();
|
|
|
|
prof_input("/rooms service conference.localhost");
|
|
|
|
assert_true(prof_output_exact("chatroom@conference.localhost (A chat room)"));
|
|
assert_true(prof_output_exact("hangout@conference.localhost (Another chat room)"));
|
|
|
|
assert_true(stbbr_received(
|
|
"<iq id='*' to='conference.localhost' type='get'>"
|
|
"<query xmlns='http://jabber.org/protocol/disco#items'/>"
|
|
"</iq>"
|
|
));
|
|
}
|