[evolution-data-server] test-cal-client-get-revision could fail due to delayed D-Bus property change notification



commit 5eaebbe5c1fd81baf93c2f8d3aeafa49abc92af6
Author: Milan Crha <mcrha redhat com>
Date:   Tue Nov 13 10:36:37 2018 +0100

    test-cal-client-get-revision could fail due to delayed D-Bus property change notification
    
    The test had been mostly working, except cases when the delivery
    of a D-Bus property change signal had been delayed. Then the value
    on the client side was not the same as the value on the server side.
    There's a very similar test for EBookClient, which does slightly more
    things, which gives D-Bus enough time to deliver the property change
    to the client, thus this change adds the component removal to address it.

 tests/libebook/client/test-book-client-get-revision.c | 2 +-
 tests/libecal/client/test-cal-client-get-revision.c   | 9 ++++++---
 2 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/tests/libebook/client/test-book-client-get-revision.c 
b/tests/libebook/client/test-book-client-get-revision.c
index 601c5e8c5..8995f0659 100644
--- a/tests/libebook/client/test-book-client-get-revision.c
+++ b/tests/libebook/client/test-book-client-get-revision.c
@@ -50,7 +50,7 @@ get_revision_compare_cycle (EBookClient *client)
 
        g_assert (revision_before);
        g_assert (revision_after);
-       g_assert (strcmp (revision_before, revision_after) != 0);
+       g_assert_cmpstr (revision_before, !=, revision_after);
 
        g_message (
                "Passed cycle, revision before '%s' revision after '%s'",
diff --git a/tests/libecal/client/test-cal-client-get-revision.c 
b/tests/libecal/client/test-cal-client-get-revision.c
index 305f15f0b..96887a360 100644
--- a/tests/libecal/client/test-cal-client-get-revision.c
+++ b/tests/libecal/client/test-cal-client-get-revision.c
@@ -42,18 +42,21 @@ get_revision_compare_cycle (ECalClient *client)
 
        if (!e_client_get_backend_property_sync (E_CLIENT (client), CLIENT_BACKEND_PROPERTY_REVISION,
                                                &revision_before, NULL, &error))
-               g_error ("Error getting book revision: %s", error->message);
+               g_error ("Error getting calendar revision: %s", error->message);
 
        if (!e_cal_client_create_object_sync (client, icalcomp, &uid, NULL, &error))
                g_error ("Error creating object: %s", error->message);
 
+       if (!e_cal_client_remove_object_sync (client, uid, NULL, E_CAL_OBJ_MOD_ALL, NULL, &error))
+               g_error ("Error removing created object: %s", error->message);
+
        if (!e_client_get_backend_property_sync (E_CLIENT (client), CLIENT_BACKEND_PROPERTY_REVISION,
                                                &revision_after, NULL, &error))
-               g_error ("Error getting book revision: %s", error->message);
+               g_error ("Error getting calendar revision: %s", error->message);
 
        g_assert (revision_before);
        g_assert (revision_after);
-       g_assert (strcmp (revision_before, revision_after) != 0);
+       g_assert_cmpstr (revision_before, !=, revision_after);
 
        g_message (
                "Passed cycle, revision before '%s' revision after '%s'",


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]