summaryrefslogtreecommitdiff
path: root/test/api
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-02-18 13:26:44 +0100
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-03-22 11:56:01 -0700
commitc587eefbb1290cc01e3e14a0ae18a2d316a498fd (patch)
tree85f3ba7e5997fa1d9d1a0305ce563741cb772d5d /test/api
parentdb5ac4785fdc02b4e233201bb3c6f55270e3c65d (diff)
downloadqtlocation-mapboxgl-c587eefbb1290cc01e3e14a0ae18a2d316a498fd.tar.gz
[ios] make unit tests work on iOS and iOS Simulator
Diffstat (limited to 'test/api')
-rw-r--r--test/api/annotations.cpp2
-rw-r--r--test/api/render_missing.cpp8
-rw-r--r--test/api/repeated_render.cpp4
3 files changed, 12 insertions, 2 deletions
diff --git a/test/api/annotations.cpp b/test/api/annotations.cpp
index ed95d29b10..0af64095c1 100644
--- a/test/api/annotations.cpp
+++ b/test/api/annotations.cpp
@@ -22,7 +22,7 @@ std::shared_ptr<SpriteImage> namedMarker(const std::string &name) {
namespace {
void checkRendering(Map& map, const char * name) {
- test::checkImage(std::string("test/fixtures/annotations/") + name + "/",
+ test::checkImage(std::string("test/fixtures/annotations/") + name,
test::render(map), 0.0002, 0.1);
}
diff --git a/test/api/render_missing.cpp b/test/api/render_missing.cpp
index 74cc38432a..8c3a1f8e52 100644
--- a/test/api/render_missing.cpp
+++ b/test/api/render_missing.cpp
@@ -10,7 +10,13 @@
#include <future>
-TEST(API, RenderMissingTile) {
+#if TEST_HAS_SERVER
+#define TEST_REQUIRES_SERVER(name) name
+#else
+#define TEST_REQUIRES_SERVER(name) DISABLED_ ## name
+#endif
+
+TEST(API, TEST_REQUIRES_SERVER(RenderMissingTile)) {
using namespace mbgl;
const auto style = util::read_file("test/fixtures/api/water_missing_tiles.json");
diff --git a/test/api/repeated_render.cpp b/test/api/repeated_render.cpp
index 24aa87ca67..ef707aa7c4 100644
--- a/test/api/repeated_render.cpp
+++ b/test/api/repeated_render.cpp
@@ -37,7 +37,9 @@ TEST(API, RepeatedRender) {
auto result = promise.get_future().get();
ASSERT_EQ(256, result.width);
ASSERT_EQ(512, result.height);
+#if !TEST_READ_ONLY
util::write_file("test/fixtures/api/1.png", encodePNG(result));
+#endif
}
{
@@ -49,7 +51,9 @@ TEST(API, RepeatedRender) {
auto result = promise.get_future().get();
ASSERT_EQ(256, result.width);
ASSERT_EQ(512, result.height);
+#if !TEST_READ_ONLY
util::write_file("test/fixtures/api/2.png", encodePNG(result));
+#endif
}
auto observer = Log::removeObserver();