From 3e92f36afc258f4483ab20b10d81dca0bf9e51b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Fri, 25 Apr 2014 16:12:03 +0200 Subject: [PATCH] fix headless test case --- include/llmr/map/map.hpp | 1 + src/map/map.cpp | 5 ++++- test/headless.cpp | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/llmr/map/map.hpp b/include/llmr/map/map.hpp index 245aa2992..d7c88b128 100644 --- a/include/llmr/map/map.hpp +++ b/include/llmr/map/map.hpp @@ -27,6 +27,7 @@ public: ~Map(); void start(); + void run(); void stop(); /* setup */ diff --git a/src/map/map.cpp b/src/map/map.cpp index 661b41cdf..019ba97c6 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -45,8 +45,11 @@ void Map::stop() { void Map::eventloop(void *arg) { Map *map = static_cast(arg); + map->run(); +} - uv_run(map->loop, UV_RUN_DEFAULT); +void Map::run() { + uv_run(loop, UV_RUN_DEFAULT); } void Map::setup() { diff --git a/test/headless.cpp b/test/headless.cpp index 0dbf79d40..86f112c2a 100644 --- a/test/headless.cpp +++ b/test/headless.cpp @@ -105,7 +105,7 @@ TEST(Headless, initialize) { map.update(); // Run the loop. It will terminate when we don't have any further listeners. - uv_run(uv_default_loop(), UV_RUN_DEFAULT); + map.run(); map.render();