tests: check roundtrip() result in Test ctor
authorMarcus Fritzsch <marcus.fritzsch@xse.de>
Tue, 5 Aug 2014 08:57:01 +0000 (10:57 +0200)
committerNobuhiko Tanibata <NOBUHIKO_TANIBATA@denso.co.jp>
Mon, 1 Sep 2014 06:55:42 +0000 (15:55 +0900)
Signed-off-by: Marcus Fritzsch <marcus.fritzsch@xse.de>
ivi-layermanagement-api/test/TestBase.cpp

index da005f5..de521d5 100644 (file)
@@ -28,8 +28,11 @@ TestBase::TestBase()
     };
 
     wl_registry_add_listener(wlRegistry, &registry_listener, &wlCompositor);
-    wl_display_dispatch(wlDisplay);
-    wl_display_roundtrip(wlDisplay);
+
+    if (wl_display_roundtrip(wlDisplay) == -1 || wl_display_roundtrip(wlDisplay) == -1)
+    {
+        throw std::runtime_error("wl_display error");
+    }
 
     wlSurfaces.reserve(10);
     for (int i = 0; i < wlSurfaces.capacity(); ++i)