summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Lotterbach <timo.lotterbach@bmw-carit.de>2014-05-30 08:40:33 +0200
committerNobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>2014-05-30 16:58:12 +0900
commitc57b4de740422f375719f5bb1bdf3dcbe3487ca1 (patch)
treecf76e6e9d01d2bf24d5618bcd8ee6eb93d3d99cf
parent17209dffd0395da6145323f1cb65ed15ba8f9998 (diff)
downloadwayland-ivi-extension-c57b4de740422f375719f5bb1bdf3dcbe3487ca1.tar.gz
fixed unit test crash, if compositor service is not running
Signed-off-by: Timo Lotterbach <timo.lotterbach@bmw-carit.de>
-rw-r--r--ivi-layermanagement-api/test/TestBase.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/ivi-layermanagement-api/test/TestBase.cpp b/ivi-layermanagement-api/test/TestBase.cpp
index ec5608b..5b96942 100644
--- a/ivi-layermanagement-api/test/TestBase.cpp
+++ b/ivi-layermanagement-api/test/TestBase.cpp
@@ -1,5 +1,6 @@
#include "TestBase.h"
#include <cstring>
+#include <stdexcept>
void registry_listener_callback(void* data, struct wl_registry* registry, uint32_t id, const char* interface, uint32_t version)
{
@@ -16,6 +17,10 @@ TestBase::TestBase()
, wlRegistry(NULL)
{
wlDisplay = wl_display_connect(NULL);
+ if (!wlDisplay)
+ {
+ throw std::runtime_error("could not connect to wayland display");
+ }
wlRegistry = wl_display_get_registry(wlDisplay);
static const struct wl_registry_listener registry_listener = {