summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzmiao <miao.zhao@mapbox.com>2020-04-07 16:30:30 +0300
committerGitHub <noreply@github.com>2020-04-07 16:30:30 +0300
commitbf4c7340f32c1e673e6a37b91fc65305757f52d1 (patch)
treec7871ff8901617b09d8a8d45b57334c2198b9b99 /test
parent8986b558eb92e431c773b6033d8ae271eb71de00 (diff)
downloadqtlocation-mapboxgl-bf4c7340f32c1e673e6a37b91fc65305757f52d1.tar.gz
[build] Fix undefined behavour sanitizer (#16375)
* [build] Fix integer overflow runtime error for core part Temporarily remove circle ci UBSAN build precondition * [build] Enable all of the ubsans [build] Check runtime error [build] Update UBSAN_OPTION * [build] Add UBSAN blacklist [build] Ignore system libraries [build] Ignore vendor library * [build] Fix implicit conversion runtime error in core * [build] Fix division by zero runtime error * [build] Add unfixed error to ubsan blacklist * [build] Make UBSAN halt on error Revert "Temporary remove build precondition" * [build] Fix division by zero error * [build] Make UBSAN officially work without FIXME prefix * [build] Fix implicit conversion from int64_t to uint64_t * [build] Rename style test json file name * Address review findings
Diffstat (limited to 'test')
-rw-r--r--test/sprite/sprite_parser.test.cpp8
-rw-r--r--test/storage/offline_database.test.cpp2
2 files changed, 5 insertions, 5 deletions
diff --git a/test/sprite/sprite_parser.test.cpp b/test/sprite/sprite_parser.test.cpp
index 58979a0e61..db6f8fb5a8 100644
--- a/test/sprite/sprite_parser.test.cpp
+++ b/test/sprite/sprite_parser.test.cpp
@@ -54,7 +54,7 @@ TEST(Sprite, SpriteImageCreationInvalid) {
EventSeverity::Error,
Event::Sprite,
int64_t(-1),
- "Can't create image with invalid metrics: 4294967295x16@0,0 in 200x299@1x sprite",
+ "Can't create image with invalid metrics: -1x16@0,0 in 200x299@1x sprite",
}));
EXPECT_EQ(0u, log.uncheckedCount());
@@ -64,7 +64,7 @@ TEST(Sprite, SpriteImageCreationInvalid) {
EventSeverity::Error,
Event::Sprite,
int64_t(-1),
- "Can't create image with invalid metrics: 16x4294967295@0,0 in 200x299@1x sprite",
+ "Can't create image with invalid metrics: 16x-1@0,0 in 200x299@1x sprite",
}));
EXPECT_EQ(0u, log.uncheckedCount());
@@ -124,7 +124,7 @@ TEST(Sprite, SpriteImageCreationInvalid) {
EventSeverity::Error,
Event::Sprite,
int64_t(-1),
- "Can't create image with invalid metrics: 16x16@4294967295,0 in 200x299@1x sprite",
+ "Can't create image with invalid metrics: 16x16@-1,0 in 200x299@1x sprite",
}));
EXPECT_EQ(0u, log.uncheckedCount());
@@ -134,7 +134,7 @@ TEST(Sprite, SpriteImageCreationInvalid) {
EventSeverity::Error,
Event::Sprite,
int64_t(-1),
- "Can't create image with invalid metrics: 16x16@0,4294967295 in 200x299@1x sprite",
+ "Can't create image with invalid metrics: 16x16@0,-1 in 200x299@1x sprite",
}));
EXPECT_EQ(0u, log.uncheckedCount());
diff --git a/test/storage/offline_database.test.cpp b/test/storage/offline_database.test.cpp
index 146cb33530..6b444bf3d1 100644
--- a/test/storage/offline_database.test.cpp
+++ b/test/storage/offline_database.test.cpp
@@ -34,7 +34,7 @@ static std::shared_ptr<std::string> randomString(size_t size) {
std::mt19937 random;
for (size_t i = 0; i < size; i++) {
- (*result)[i] = random();
+ (*result)[i] = static_cast<char>(random());
}
return result;