Fix: Crash when testing ut-zones-manager 72/33672/1
authorMateusz Malicki <m.malicki2@samsung.com>
Tue, 13 Jan 2015 14:36:23 +0000 (15:36 +0100)
committerMateusz Malicki <m.malicki2@samsung.com>
Tue, 13 Jan 2015 16:29:49 +0000 (17:29 +0100)
[Bug/Feature]   Crash when testing ut-zones-manager
[Cause]         BOOST_CHECK is not thread safe
[Solution]      BOOSR_CHECK was removed from child thread
[Verification]  Build, install, run test on slp

Change-Id: I6cb10f626d8e5ec908e359de15b3fbbed9abb77c

tests/unit_tests/server/ut-zones-manager.cpp

index 06af8eb..a733e05 100644 (file)
@@ -313,8 +313,9 @@ public:
                                    const VoidResultCallback& result)
     {
         auto asyncResult = [result](dbus::AsyncMethodCallResult& asyncMethodCallResult) {
-            BOOST_CHECK(g_variant_is_of_type(asyncMethodCallResult.get(), G_VARIANT_TYPE_UNIT));
-            result();
+            if (g_variant_is_of_type(asyncMethodCallResult.get(), G_VARIANT_TYPE_UNIT)) {
+                result();
+            }
         };
 
         assert(isHost());
@@ -332,8 +333,9 @@ public:
                                     const VoidResultCallback& result)
     {
         auto asyncResult = [result](dbus::AsyncMethodCallResult& asyncMethodCallResult) {
-            BOOST_CHECK(g_variant_is_of_type(asyncMethodCallResult.get(), G_VARIANT_TYPE_UNIT));
-            result();
+            if (g_variant_is_of_type(asyncMethodCallResult.get(), G_VARIANT_TYPE_UNIT)) {
+                result();
+            }
         };
 
         assert(isHost());
@@ -351,8 +353,9 @@ public:
                                      const VoidResultCallback& result)
     {
         auto asyncResult = [result](dbus::AsyncMethodCallResult& asyncMethodCallResult) {
-            BOOST_CHECK(g_variant_is_of_type(asyncMethodCallResult.get(), G_VARIANT_TYPE_UNIT));
-            result();
+            if (g_variant_is_of_type(asyncMethodCallResult.get(), G_VARIANT_TYPE_UNIT)) {
+                result();
+            }
         };
 
         assert(isHost());
@@ -370,8 +373,9 @@ public:
                                   const VoidResultCallback& result)
     {
         auto asyncResult = [result](dbus::AsyncMethodCallResult& asyncMethodCallResult) {
-            BOOST_CHECK(g_variant_is_of_type(asyncMethodCallResult.get(), G_VARIANT_TYPE_UNIT));
-            result();
+            if (g_variant_is_of_type(asyncMethodCallResult.get(), G_VARIANT_TYPE_UNIT)) {
+                result();
+            }
         };
 
         assert(isHost());
@@ -923,7 +927,7 @@ BOOST_AUTO_TEST_CASE(ZoneDbusesSignalsTest)
 
         cm.startAll();
 
-        BOOST_CHECK(signalLatch.waitForN(TEST_DBUS_CONNECTION_ZONES_COUNT, EVENT_TIMEOUT));
+        BOOST_REQUIRE(signalLatch.waitForN(TEST_DBUS_CONNECTION_ZONES_COUNT, EVENT_TIMEOUT));
         BOOST_CHECK(signalLatch.empty());
         BOOST_CHECK(EXPECTED_DBUSES_STARTED == collectedDbuses);
         collectedDbuses.clear();