|
|
550ffc |
From 5eaebbe5c1fd81baf93c2f8d3aeafa49abc92af6 Mon Sep 17 00:00:00 2001
|
|
|
550ffc |
From: Milan Crha <mcrha@redhat.com>
|
|
|
550ffc |
Date: Tue, 13 Nov 2018 10:36:37 +0100
|
|
|
550ffc |
Subject: test-cal-client-get-revision could fail due to delayed D-Bus property
|
|
|
550ffc |
change notification
|
|
|
550ffc |
|
|
|
550ffc |
The test had been mostly working, except cases when the delivery
|
|
|
550ffc |
of a D-Bus property change signal had been delayed. Then the value
|
|
|
550ffc |
on the client side was not the same as the value on the server side.
|
|
|
550ffc |
There's a very similar test for EBookClient, which does slightly more
|
|
|
550ffc |
things, which gives D-Bus enough time to deliver the property change
|
|
|
550ffc |
to the client, thus this change adds the component removal to address it.
|
|
|
550ffc |
|
|
|
550ffc |
diff --git a/tests/libebook/client/test-book-client-get-revision.c b/tests/libebook/client/test-book-client-get-revision.c
|
|
|
550ffc |
index 601c5e8c5..8995f0659 100644
|
|
|
550ffc |
--- a/tests/libebook/client/test-book-client-get-revision.c
|
|
|
550ffc |
+++ b/tests/libebook/client/test-book-client-get-revision.c
|
|
|
550ffc |
@@ -50,7 +50,7 @@ get_revision_compare_cycle (EBookClient *client)
|
|
|
550ffc |
|
|
|
550ffc |
g_assert (revision_before);
|
|
|
550ffc |
g_assert (revision_after);
|
|
|
550ffc |
- g_assert (strcmp (revision_before, revision_after) != 0);
|
|
|
550ffc |
+ g_assert_cmpstr (revision_before, !=, revision_after);
|
|
|
550ffc |
|
|
|
550ffc |
g_message (
|
|
|
550ffc |
"Passed cycle, revision before '%s' revision after '%s'",
|
|
|
550ffc |
diff --git a/tests/libecal/client/test-cal-client-get-revision.c b/tests/libecal/client/test-cal-client-get-revision.c
|
|
|
550ffc |
index 305f15f0b..96887a360 100644
|
|
|
550ffc |
--- a/tests/libecal/client/test-cal-client-get-revision.c
|
|
|
550ffc |
+++ b/tests/libecal/client/test-cal-client-get-revision.c
|
|
|
550ffc |
@@ -42,18 +42,21 @@ get_revision_compare_cycle (ECalClient *client)
|
|
|
550ffc |
|
|
|
550ffc |
if (!e_client_get_backend_property_sync (E_CLIENT (client), CLIENT_BACKEND_PROPERTY_REVISION,
|
|
|
550ffc |
&revision_before, NULL, &error))
|
|
|
550ffc |
- g_error ("Error getting book revision: %s", error->message);
|
|
|
550ffc |
+ g_error ("Error getting calendar revision: %s", error->message);
|
|
|
550ffc |
|
|
|
550ffc |
if (!e_cal_client_create_object_sync (client, icalcomp, &uid, NULL, &error))
|
|
|
550ffc |
g_error ("Error creating object: %s", error->message);
|
|
|
550ffc |
|
|
|
550ffc |
+ if (!e_cal_client_remove_object_sync (client, uid, NULL, E_CAL_OBJ_MOD_ALL, NULL, &error))
|
|
|
550ffc |
+ g_error ("Error removing created object: %s", error->message);
|
|
|
550ffc |
+
|
|
|
550ffc |
if (!e_client_get_backend_property_sync (E_CLIENT (client), CLIENT_BACKEND_PROPERTY_REVISION,
|
|
|
550ffc |
&revision_after, NULL, &error))
|
|
|
550ffc |
- g_error ("Error getting book revision: %s", error->message);
|
|
|
550ffc |
+ g_error ("Error getting calendar revision: %s", error->message);
|
|
|
550ffc |
|
|
|
550ffc |
g_assert (revision_before);
|
|
|
550ffc |
g_assert (revision_after);
|
|
|
550ffc |
- g_assert (strcmp (revision_before, revision_after) != 0);
|
|
|
550ffc |
+ g_assert_cmpstr (revision_before, !=, revision_after);
|
|
|
550ffc |
|
|
|
550ffc |
g_message (
|
|
|
550ffc |
"Passed cycle, revision before '%s' revision after '%s'",
|