summaryrefslogtreecommitdiff
path: root/test/util
diff options
context:
space:
mode:
Diffstat (limited to 'test/util')
-rw-r--r--test/util/image.test.cpp18
-rw-r--r--test/util/memory.test.cpp16
-rw-r--r--test/util/offscreen_texture.test.cpp6
-rw-r--r--test/util/tile_cover.test.cpp2
4 files changed, 21 insertions, 21 deletions
diff --git a/test/util/image.test.cpp b/test/util/image.test.cpp
index b2814e66da..b15ddc1b3f 100644
--- a/test/util/image.test.cpp
+++ b/test/util/image.test.cpp
@@ -7,7 +7,7 @@
using namespace mbgl;
TEST(Image, PNGRoundTrip) {
- PremultipliedImage rgba { 1, 1 };
+ PremultipliedImage rgba({ 1, 1 });
rgba.data[0] = 128;
rgba.data[1] = 0;
rgba.data[2] = 0;
@@ -21,7 +21,7 @@ TEST(Image, PNGRoundTrip) {
}
TEST(Image, PNGRoundTripAlpha) {
- PremultipliedImage rgba { 1, 1 };
+ PremultipliedImage rgba({ 1, 1 });
rgba.data[0] = 128;
rgba.data[1] = 0;
rgba.data[2] = 0;
@@ -68,26 +68,26 @@ TEST(Image, PNGReadProfileAlpha) {
TEST(Image, PNGTile) {
PremultipliedImage image = decodeImage(util::read_file("test/fixtures/image/tile.png"));
- EXPECT_EQ(256u, image.width);
- EXPECT_EQ(256u, image.height);
+ EXPECT_EQ(256u, image.size.width);
+ EXPECT_EQ(256u, image.size.height);
}
TEST(Image, JPEGTile) {
PremultipliedImage image = decodeImage(util::read_file("test/fixtures/image/tile.jpeg"));
- EXPECT_EQ(256u, image.width);
- EXPECT_EQ(256u, image.height);
+ EXPECT_EQ(256u, image.size.width);
+ EXPECT_EQ(256u, image.size.height);
}
#if !defined(__ANDROID__) && !defined(__APPLE__) && !defined(QT_IMAGE_DECODERS)
TEST(Image, WebPTile) {
PremultipliedImage image = decodeImage(util::read_file("test/fixtures/image/tile.webp"));
- EXPECT_EQ(256u, image.width);
- EXPECT_EQ(256u, image.height);
+ EXPECT_EQ(256u, image.size.width);
+ EXPECT_EQ(256u, image.size.height);
}
#endif // !defined(__ANDROID__) && !defined(__APPLE__) && !defined(QT_IMAGE_DECODERS)
TEST(Image, Premultiply) {
- UnassociatedImage rgba { 1, 1 };
+ UnassociatedImage rgba({ 1, 1 });
rgba.data[0] = 255;
rgba.data[1] = 254;
rgba.data[2] = 253;
diff --git a/test/util/memory.test.cpp b/test/util/memory.test.cpp
index a1e47d6c2b..07927b43eb 100644
--- a/test/util/memory.test.cpp
+++ b/test/util/memory.test.cpp
@@ -57,7 +57,7 @@ public:
util::RunLoop runLoop;
HeadlessBackend backend;
- OffscreenView view{ backend.getContext(), {{ 512, 512 }} };
+ OffscreenView view{ backend.getContext(), { 512, 512 } };
StubFileSource fileSource;
ThreadPool threadPool { 4 };
@@ -93,7 +93,7 @@ private:
TEST(Memory, Vector) {
MemoryTest test;
- Map map(test.backend, { { 256, 256 } }, 2, test.fileSource, test.threadPool, MapMode::Still);
+ Map map(test.backend, { 256, 256 }, 2, test.fileSource, test.threadPool, MapMode::Still);
map.setZoom(16); // more map features
map.setStyleURL("mapbox://streets");
@@ -103,7 +103,7 @@ TEST(Memory, Vector) {
TEST(Memory, Raster) {
MemoryTest test;
- Map map(test.backend, { { 256, 256 } }, 2, test.fileSource, test.threadPool, MapMode::Still);
+ Map map(test.backend, { 256, 256 }, 2, test.fileSource, test.threadPool, MapMode::Still);
map.setStyleURL("mapbox://satellite");
test::render(map, test.view);
@@ -129,7 +129,7 @@ TEST(Memory, Footprint) {
// Warm up buffers and cache.
for (unsigned i = 0; i < 10; ++i) {
- Map map(test.backend, {{ 256, 256 }}, 2, test.fileSource, test.threadPool, MapMode::Still);
+ Map map(test.backend, { 256, 256 }, 2, test.fileSource, test.threadPool, MapMode::Still);
renderMap(map, "mapbox://streets");
renderMap(map, "mapbox://satellite");
};
@@ -143,8 +143,8 @@ TEST(Memory, Footprint) {
long vectorInitialRSS = getRSS();
for (unsigned i = 0; i < runs; ++i) {
- auto vector = std::make_unique<Map>(test.backend, std::array<uint16_t, 2>{ { 256, 256 } },
- 2, test.fileSource, test.threadPool, MapMode::Still);
+ auto vector = std::make_unique<Map>(test.backend, Size{ 256, 256 }, 2, test.fileSource,
+ test.threadPool, MapMode::Still);
renderMap(*vector, "mapbox://streets");
maps.push_back(std::move(vector));
};
@@ -153,8 +153,8 @@ TEST(Memory, Footprint) {
long rasterInitialRSS = getRSS();
for (unsigned i = 0; i < runs; ++i) {
- auto raster = std::make_unique<Map>(test.backend, std::array<uint16_t, 2>{ { 256, 256 } },
- 2, test.fileSource, test.threadPool, MapMode::Still);
+ auto raster = std::make_unique<Map>(test.backend, Size{ 256, 256 }, 2, test.fileSource,
+ test.threadPool, MapMode::Still);
renderMap(*raster, "mapbox://satellite");
maps.push_back(std::move(raster));
};
diff --git a/test/util/offscreen_texture.test.cpp b/test/util/offscreen_texture.test.cpp
index bd4eab69a8..a1e444ed65 100644
--- a/test/util/offscreen_texture.test.cpp
+++ b/test/util/offscreen_texture.test.cpp
@@ -11,7 +11,7 @@ using namespace mbgl;
TEST(OffscreenTexture, EmptyRed) {
HeadlessBackend backend;
- OffscreenView view(backend.getContext(), {{ 512, 256 }});
+ OffscreenView view(backend.getContext(), { 512, 256 });
view.bind();
MBGL_CHECK_ERROR(glClearColor(1.0f, 0.0f, 0.0f, 1.0f));
@@ -106,7 +106,7 @@ void main() {
// Make sure the texture gets destructed before we call context.reset();
{
- OffscreenView view(context, {{ 512, 256 }});
+ OffscreenView view(context, { 512, 256 });
// First, draw red to the bound FBO.
context.clearColor = { 1, 0, 0, 1 };
@@ -115,7 +115,7 @@ void main() {
// Then, create a texture, bind it, and render yellow to that texture. This should not
// affect the originally bound FBO.
- OffscreenTexture texture(context, {{ 128, 128 }});
+ OffscreenTexture texture(context, { 128, 128 });
texture.bind();
context.clearColor = { 0, 0, 0, 0 };
diff --git a/test/util/tile_cover.test.cpp b/test/util/tile_cover.test.cpp
index cc183509d9..47440ff0b5 100644
--- a/test/util/tile_cover.test.cpp
+++ b/test/util/tile_cover.test.cpp
@@ -29,7 +29,7 @@ TEST(TileCover, WorldZ0) {
TEST(TileCover, Pitch) {
Transform transform;
- transform.resize({ { 512, 512 } });
+ transform.resize({ 512, 512 });
transform.setZoom(2);
transform.setPitch(40.0 * M_PI / 180.0);