[test] Fix failing tests on iOS
This commit is contained in:
BIN
test/fixtures/local_glyphs/ping_fang/expected.png
vendored
BIN
test/fixtures/local_glyphs/ping_fang/expected.png
vendored
Binary file not shown.
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 17 KiB |
@@ -621,7 +621,8 @@ TEST(Transform, LatLngBounds) {
|
||||
}
|
||||
|
||||
transform.jumpTo(CameraOptions().withCenter(sanFrancisco));
|
||||
ASSERT_EQ(transform.getLatLng(), sanFrancisco);
|
||||
ASSERT_NEAR(transform.getLatLng().latitude(), sanFrancisco.latitude(), 1e-8);
|
||||
ASSERT_NEAR(transform.getLatLng().longitude(), sanFrancisco.longitude(), 1e-8);
|
||||
|
||||
// Single location.
|
||||
transform.setLatLngBounds(LatLngBounds::singleton(sanFrancisco));
|
||||
@@ -655,7 +656,7 @@ TEST(Transform, LatLngBounds) {
|
||||
// └───┴───┸───┴───┸───┴───┘
|
||||
transform.setLatLngBounds(LatLngBounds::hull({ -90.0, 0.0 }, { 90.0, 180.0 }));
|
||||
transform.jumpTo(CameraOptions().withCenter(sanFrancisco));
|
||||
ASSERT_EQ(transform.getLatLng().latitude(), sanFrancisco.latitude());
|
||||
ASSERT_NEAR(transform.getLatLng().latitude(), sanFrancisco.latitude(), 1e-8);
|
||||
ASSERT_EQ(transform.getLatLng().longitude(), 0.0);
|
||||
|
||||
// -1 | 0 | +1
|
||||
|
||||
@@ -779,7 +779,7 @@ TEST(OfflineDatabase, MapboxTileLimitExceeded) {
|
||||
db.put(ambientTile, response);
|
||||
};
|
||||
|
||||
auto insertRegionTile = [&](int64_t regionID, unsigned i) {
|
||||
auto insertRegionTile = [&](int64_t regionID, uint64_t i) {
|
||||
const Resource tile = Resource::tile("mapbox://region_tile_" + std::to_string(i), 1, 0, 0, 0, Tileset::Scheme::XYZ);
|
||||
db.putRegionResource(regionID, tile, response);
|
||||
};
|
||||
@@ -801,14 +801,14 @@ TEST(OfflineDatabase, MapboxTileLimitExceeded) {
|
||||
ASSERT_EQ(db.getOfflineMapboxTileCount(), 0);
|
||||
|
||||
// Fine because this region is under the tile limit.
|
||||
for (unsigned i = 0; i < limit - 10; ++i) {
|
||||
for (uint64_t i = 0; i < limit - 10; ++i) {
|
||||
insertRegionTile(region1->getID(), i);
|
||||
}
|
||||
|
||||
ASSERT_EQ(db.getOfflineMapboxTileCount(), limit - 10);
|
||||
|
||||
// Fine because this region + the previous is at the limit.
|
||||
for (unsigned i = limit; i < limit + 10; ++i) {
|
||||
for (uint64_t i = limit; i < limit + 10; ++i) {
|
||||
insertRegionTile(region2->getID(), i);
|
||||
}
|
||||
|
||||
@@ -848,7 +848,7 @@ TEST(OfflineDatabase, MapboxTileLimitExceeded) {
|
||||
// 10, which would blow up the limit if it wasn't
|
||||
// for the fact that tile 60 is already on the
|
||||
// database and will not count.
|
||||
for (unsigned i = limit; i < limit + 10; ++i) {
|
||||
for (uint64_t i = limit; i < limit + 10; ++i) {
|
||||
insertRegionTile(region1->getID(), i);
|
||||
}
|
||||
|
||||
|
||||
@@ -91,6 +91,8 @@ TEST(VectorTileData, ParseResults) {
|
||||
ASSERT_TRUE(false) << "should throw: feature index is out of range.";
|
||||
} catch (const std::out_of_range&) {
|
||||
ASSERT_TRUE(true);
|
||||
} catch (...) { // needed for iOS when MBGL_WITH_RTTI=OFF
|
||||
ASSERT_TRUE(true);
|
||||
}
|
||||
|
||||
std::unique_ptr<GeometryTileFeature> feature = layer->getFeature(0u);
|
||||
|
||||
@@ -365,7 +365,7 @@ TEST(TileCount, BoundsCrossingAntimeridian) {
|
||||
TEST(TileCover, DISABLED_FuzzPoly) {
|
||||
while(true)
|
||||
{
|
||||
std::srand (time(nullptr));
|
||||
std::srand(static_cast<uint32_t>(time(nullptr)));
|
||||
std::size_t len = std::rand() % 10000 + 3;
|
||||
Polygon<double> polygon;
|
||||
|
||||
@@ -393,7 +393,7 @@ TEST(TileCover, DISABLED_FuzzPoly) {
|
||||
TEST(TileCover, DISABLED_FuzzLine) {
|
||||
while(true)
|
||||
{
|
||||
std::srand (time(nullptr));
|
||||
std::srand(static_cast<uint32_t>(time(nullptr)));
|
||||
std::size_t len = std::rand() % 10000 + 3;
|
||||
MultiLineString<double> mls;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user