[ios] make unit tests work on iOS and iOS Simulator
This commit is contained in:
committed by
John Firebaugh
parent
db5ac4785f
commit
c587eefbb1
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user