summaryrefslogtreecommitdiffstats
path: root/tests/sender-receiver.c
diff options
context:
space:
mode:
authorJulian Bouzas <julian.bouzas@collabora.com>2021-06-26 11:52:48 -0400
committerGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2021-07-28 13:19:02 +0300
commit90bc52450f7a65f5489ae6a499ac7bb8c8781f23 (patch)
tree88c6adf3eb96367730a3afe5a3216770648b6e84 /tests/sender-receiver.c
parent03fc350641c4a508dadf1a3d7477a48c5f4cda42 (diff)
tests: wpipc: check if new connection to new receiver is valid after losing connection
Signed-off-by: George Kiagiadakis <george.kiagiadakis@collabora.com>
Diffstat (limited to 'tests/sender-receiver.c')
-rw-r--r--tests/sender-receiver.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/sender-receiver.c b/tests/sender-receiver.c
index 9c47ac3..ca6e816 100644
--- a/tests/sender-receiver.c
+++ b/tests/sender-receiver.c
@@ -168,10 +168,22 @@ test_icipc_sender_lost_connection ()
icipc_receiver_free (r);
wait_for_event (&data, 1);
+ /* make sure the connection was lost */
+ g_assert_false (icipc_sender_is_connected (s));
+
+ /* create a new receiver */
+ struct icipc_receiver *r2 = icipc_receiver_new (TEST_ADDRESS, 16, NULL, NULL, 0);
+ g_assert_nonnull (r2);
+
+ /* re-connect sender with new receiver */
+ g_assert_true (icipc_sender_connect (s));
+ g_assert_true (icipc_sender_is_connected (s));
+
/* clean up */
g_cond_clear (&data.cond);
g_mutex_clear (&data.mutex);
icipc_sender_free (s);
+ icipc_receiver_free (r2);
}
static void