From 2a514d0969f5c25d5e2d14421125a47df6b14974 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Fri, 17 Nov 2017 16:06:54 +0100 Subject: Fix unit tests using async + read message marker --- xmpp-vala/tests/stanza.vala | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'xmpp-vala/tests') diff --git a/xmpp-vala/tests/stanza.vala b/xmpp-vala/tests/stanza.vala index 1662c9bc..40b54a38 100644 --- a/xmpp-vala/tests/stanza.vala +++ b/xmpp-vala/tests/stanza.vala @@ -6,12 +6,12 @@ class StanzaTest : Gee.TestCase { public StanzaTest() { base("Stanza"); - add_test("node_one", test_node_one); - add_test("typical_stream", test_typical_stream); - add_test("ack_stream", test_ack_stream); + add_test("node_one", () => { test_node_one.begin(); }); + add_test("typical_stream", () => { test_typical_stream.begin(); }); + add_test("ack_stream", () => { test_ack_stream.begin(); }); } - private void test_node_one() { + private async void test_node_one() { var node1 = new StanzaNode.build("test", "ns1_uri") .add_self_xmlns() .put_attribute("ns2", "ns2_uri", XMLNS_URI) @@ -22,12 +22,12 @@ class StanzaTest : Gee.TestCase { .add_self_xmlns()); var xml1 = node1.to_xml(); - var node2 = new StanzaReader.for_string(xml1).read_node(); + var node2 = yield new StanzaReader.for_string(xml1).read_node(); fail_if_not(node1.equals(node2)); fail_if_not_eq_str(node1.to_string(), node2.to_string()); } - private void test_typical_stream() { + private async void test_typical_stream() { var stream = """ reader.read_node(), 3, "end of stream should be reached"); } - private void test_ack_stream() { + private async void test_ack_stream() { var stream = """ reader.read_node(), 3, "end of stream should be reached"); } -- cgit v1.2.3-54-g00ecf