summaryrefslogtreecommitdiff
path: root/test/sprite
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-06-03 18:05:04 +0200
committerKonstantin Käfer <mail@kkaefer.com>2016-06-13 11:16:19 +0200
commit2bdecdf9f9a93c30f7d482f9993c47b86a9f5eb8 (patch)
treeef946d0f27b721f12662047beda6ff1d3cb31e23 /test/sprite
parent9b6c2e6940ed33a87a20274eda19320e8c688fdf (diff)
downloadqtlocation-mapboxgl-2bdecdf9f9a93c30f7d482f9993c47b86a9f5eb8.tar.gz
[core] fix pedantic warning messages
Diffstat (limited to 'test/sprite')
-rw-r--r--test/sprite/sprite_atlas.cpp12
-rw-r--r--test/sprite/sprite_image.cpp8
-rw-r--r--test/sprite/sprite_parser.cpp20
-rw-r--r--test/sprite/sprite_store.cpp8
4 files changed, 24 insertions, 24 deletions
diff --git a/test/sprite/sprite_atlas.cpp b/test/sprite/sprite_atlas.cpp
index 08b8e54002..d9f96d57d1 100644
--- a/test/sprite/sprite_atlas.cpp
+++ b/test/sprite/sprite_atlas.cpp
@@ -52,8 +52,8 @@ TEST(Sprite, SpriteAtlas) {
EXPECT_EQ(20, metro.pos.h);
EXPECT_EQ(18, metro.spriteImage->getWidth());
EXPECT_EQ(18, metro.spriteImage->getHeight());
- EXPECT_EQ(18, metro.spriteImage->image.width);
- EXPECT_EQ(18, metro.spriteImage->image.height);
+ EXPECT_EQ(18u, metro.spriteImage->image.width);
+ EXPECT_EQ(18u, metro.spriteImage->image.height);
EXPECT_EQ(1.0f, metro.spriteImage->pixelRatio);
EXPECT_TRUE(atlas.getData());
@@ -108,8 +108,8 @@ TEST(Sprite, SpriteAtlasSize) {
EXPECT_EQ(16, metro.pos.h);
EXPECT_EQ(18, metro.spriteImage->getWidth());
EXPECT_EQ(18, metro.spriteImage->getHeight());
- EXPECT_EQ(18, metro.spriteImage->image.width);
- EXPECT_EQ(18, metro.spriteImage->image.height);
+ EXPECT_EQ(18u, metro.spriteImage->image.width);
+ EXPECT_EQ(18u, metro.spriteImage->image.height);
EXPECT_EQ(1.0f, metro.spriteImage->pixelRatio);
EXPECT_EQ(readImage("test/fixtures/annotations/result-spriteatlassize.png"),
@@ -135,8 +135,8 @@ TEST(Sprite, SpriteAtlasUpdates) {
EXPECT_EQ(16, one.pos.h);
EXPECT_EQ(16, one.spriteImage->getWidth());
EXPECT_EQ(12, one.spriteImage->getHeight());
- EXPECT_EQ(16, one.spriteImage->image.width);
- EXPECT_EQ(12, one.spriteImage->image.height);
+ EXPECT_EQ(16u, one.spriteImage->image.width);
+ EXPECT_EQ(12u, one.spriteImage->image.height);
EXPECT_EQ(1.0f, one.spriteImage->pixelRatio);
EXPECT_EQ(readImage("test/fixtures/annotations/result-spriteatlas-empty.png"),
diff --git a/test/sprite/sprite_image.cpp b/test/sprite/sprite_image.cpp
index 29e96cf134..f8982826a3 100644
--- a/test/sprite/sprite_image.cpp
+++ b/test/sprite/sprite_image.cpp
@@ -40,9 +40,9 @@ TEST(Sprite, SpriteImage) {
PremultipliedImage image(32, 24);
SpriteImage sprite(std::move(image), 2.0);
EXPECT_EQ(16, sprite.getWidth());
- EXPECT_EQ(32, sprite.image.width);
+ EXPECT_EQ(32u, sprite.image.width);
EXPECT_EQ(12, sprite.getHeight());
- EXPECT_EQ(24, sprite.image.height);
+ EXPECT_EQ(24u, sprite.image.height);
EXPECT_EQ(2, sprite.pixelRatio);
}
@@ -50,8 +50,8 @@ TEST(Sprite, SpriteImageFractionalRatio) {
PremultipliedImage image(20, 12);
SpriteImage sprite(std::move(image), 1.5);
EXPECT_EQ(float(20.0 / 1.5), sprite.getWidth());
- EXPECT_EQ(20, sprite.image.width);
+ EXPECT_EQ(20u, sprite.image.width);
EXPECT_EQ(float(12.0 / 1.5), sprite.getHeight());
- EXPECT_EQ(12, sprite.image.height);
+ EXPECT_EQ(12u, sprite.image.height);
EXPECT_EQ(1.5, sprite.pixelRatio);
}
diff --git a/test/sprite/sprite_parser.cpp b/test/sprite/sprite_parser.cpp
index 318911674e..85a5387898 100644
--- a/test/sprite/sprite_parser.cpp
+++ b/test/sprite/sprite_parser.cpp
@@ -60,8 +60,8 @@ TEST(Sprite, SpriteImageCreation1x) {
ASSERT_TRUE(sprite.get());
EXPECT_EQ(18, sprite->getWidth());
EXPECT_EQ(18, sprite->getHeight());
- EXPECT_EQ(18, sprite->image.width);
- EXPECT_EQ(18, sprite->image.height);
+ EXPECT_EQ(18u, sprite->image.width);
+ EXPECT_EQ(18u, sprite->image.height);
EXPECT_EQ(1, sprite->pixelRatio);
EXPECT_EQ(readImage("test/fixtures/annotations/result-spriteimagecreation1x-museum.png"),
sprite->image);
@@ -76,8 +76,8 @@ TEST(Sprite, SpriteImageCreation2x) {
ASSERT_TRUE(sprite.get());
EXPECT_EQ(18, sprite->getWidth());
EXPECT_EQ(18, sprite->getHeight());
- EXPECT_EQ(36, sprite->image.width);
- EXPECT_EQ(36, sprite->image.height);
+ EXPECT_EQ(36u, sprite->image.width);
+ EXPECT_EQ(36u, sprite->image.height);
EXPECT_EQ(2, sprite->pixelRatio);
EXPECT_EQ(readImage("test/fixtures/annotations/result-spriteimagecreation2x.png"),
sprite->image);
@@ -91,8 +91,8 @@ TEST(Sprite, SpriteImageCreation1_5x) {
ASSERT_TRUE(sprite.get());
EXPECT_EQ(24, sprite->getWidth());
EXPECT_EQ(24, sprite->getHeight());
- EXPECT_EQ(36, sprite->image.width);
- EXPECT_EQ(36, sprite->image.height);
+ EXPECT_EQ(36u, sprite->image.width);
+ EXPECT_EQ(36u, sprite->image.height);
EXPECT_EQ(1.5, sprite->pixelRatio);
EXPECT_EQ(readImage("test/fixtures/annotations/result-spriteimagecreation1_5x-museum.png"),
sprite->image);
@@ -102,8 +102,8 @@ TEST(Sprite, SpriteImageCreation1_5x) {
ASSERT_TRUE(sprite2.get());
EXPECT_EQ(float(35 / 1.5), sprite2->getWidth());
EXPECT_EQ(float(35 / 1.5), sprite2->getHeight());
- EXPECT_EQ(35, sprite2->image.width);
- EXPECT_EQ(35, sprite2->image.height);
+ EXPECT_EQ(35u, sprite2->image.width);
+ EXPECT_EQ(35u, sprite2->image.height);
EXPECT_EQ(1.5, sprite2->pixelRatio);
EXPECT_EQ(readImage("test/fixtures/annotations/result-spriteimagecreation1_5x-hospital.png"),
sprite2->image);
@@ -198,8 +198,8 @@ TEST(Sprite, SpriteParsing) {
auto sprite = images.find("generic-metro")->second;
EXPECT_EQ(18, sprite->getWidth());
EXPECT_EQ(18, sprite->getHeight());
- EXPECT_EQ(18, sprite->image.width);
- EXPECT_EQ(18, sprite->image.height);
+ EXPECT_EQ(18u, sprite->image.width);
+ EXPECT_EQ(18u, sprite->image.height);
EXPECT_EQ(1, sprite->pixelRatio);
EXPECT_EQ(readImage("test/fixtures/annotations/result-spriteparsing.png"), sprite->image);
}
diff --git a/test/sprite/sprite_store.cpp b/test/sprite/sprite_store.cpp
index 90f1e3b3f1..4c1ddc7934 100644
--- a/test/sprite/sprite_store.cpp
+++ b/test/sprite/sprite_store.cpp
@@ -181,14 +181,14 @@ Response successfulSpriteImageResponse(const Resource& resource) {
Response response;
response.data = std::make_shared<std::string>(util::read_file(resource.url));
return response;
-};
+}
Response successfulSpriteJSONResponse(const Resource& resource) {
EXPECT_EQ("test/fixtures/resources/sprite.json", resource.url);
Response response;
response.data = std::make_shared<std::string>(util::read_file(resource.url));
return response;
-};
+}
Response failedSpriteResponse(const Resource&) {
Response response;
@@ -196,13 +196,13 @@ Response failedSpriteResponse(const Resource&) {
Response::Error::Reason::Other,
"Failed by the test case");
return response;
-};
+}
Response corruptSpriteResponse(const Resource&) {
Response response;
response.data = std::make_shared<std::string>("CORRUPT");
return response;
-};
+}
TEST(SpriteStore, LoadingSuccess) {
SpriteStoreTest test;