summaryrefslogtreecommitdiff
path: root/test/util
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2019-04-03 12:27:14 +0200
committerKonstantin Käfer <mail@kkaefer.com>2019-04-05 11:49:17 +0200
commit3ceabcd3ec91dbd9458d3c5b78fb12c3182636e1 (patch)
treeb8be2ac790afce844178a314b42683ab9d06f744 /test/util
parentd7aaf83421261087a99d18d92eca9637c1bf72f8 (diff)
downloadqtlocation-mapboxgl-3ceabcd3ec91dbd9458d3c5b78fb12c3182636e1.tar.gz
[core] clang-tidy fixes
Diffstat (limited to 'test/util')
-rw-r--r--test/util/merge_lines.test.cpp2
-rw-r--r--test/util/peer.test.cpp12
-rw-r--r--test/util/tile_cover.test.cpp12
3 files changed, 13 insertions, 13 deletions
diff --git a/test/util/merge_lines.test.cpp b/test/util/merge_lines.test.cpp
index 1d4b0d230e..1c8c7aae8f 100644
--- a/test/util/merge_lines.test.cpp
+++ b/test/util/merge_lines.test.cpp
@@ -15,7 +15,7 @@ namespace {
PropertyMap properties;
LineString<int16_t> emptyLine;
-}
+} // namespace
class SymbolFeatureStub : public SymbolFeature {
public:
diff --git a/test/util/peer.test.cpp b/test/util/peer.test.cpp
index aa5a4cc538..a808dd27d1 100644
--- a/test/util/peer.test.cpp
+++ b/test/util/peer.test.cpp
@@ -6,7 +6,7 @@ using namespace mbgl::util;
class TestType {
public:
- TestType() : i1(0), i2(1) {
+ TestType() {
str[0] = 'a';
}
@@ -18,14 +18,14 @@ public:
TestType(const TestType&) = delete;
TestType& operator=(const TestType&) = delete;
- int i1;
- int i2;
+ int i1 = 0;
+ int i2 = 1;
char str[256];
};
bool IsStackAllocated (const peer& a, const void* obj1) {
- uintptr_t a_ptr = (uintptr_t)(&a);
- uintptr_t obj = (uintptr_t)(obj1);
+ auto a_ptr = (uintptr_t)(&a);
+ auto obj = (uintptr_t)(obj1);
return (obj >= a_ptr && obj < a_ptr + sizeof(peer));
};
@@ -163,7 +163,7 @@ TEST(Peer, UniquePtr) {
EXPECT_FALSE(u1.has_value());
peer u2;
- TestType * t3 = new TestType();
+ auto* t3 = new TestType();
u2 = std::unique_ptr<TestType>(t3);
EXPECT_TRUE(u2.has_value());
}
diff --git a/test/util/tile_cover.test.cpp b/test/util/tile_cover.test.cpp
index 7045305625..3fc7681520 100644
--- a/test/util/tile_cover.test.cpp
+++ b/test/util/tile_cover.test.cpp
@@ -3,8 +3,8 @@
#include <mbgl/map/transform.hpp>
#include <algorithm>
-#include <stdlib.h> /* srand, rand */
-#include <time.h> /* time */
+#include <cstdlib> /* srand, rand */
+#include <ctime> /* time */
#include <gtest/gtest.h>
using namespace mbgl;
@@ -314,9 +314,9 @@ TEST(TileCount, BoundsCrossingAntimeridian) {
}
TEST(TileCover, DISABLED_FuzzPoly) {
- while(1)
+ while(true)
{
- std::srand (time(NULL));
+ std::srand (time(nullptr));
std::size_t len = std::rand() % 10000 + 3;
Polygon<double> polygon;
@@ -342,9 +342,9 @@ TEST(TileCover, DISABLED_FuzzPoly) {
}
TEST(TileCover, DISABLED_FuzzLine) {
- while(1)
+ while(true)
{
- std::srand (time(NULL));
+ std::srand (time(nullptr));
std::size_t len = std::rand() % 10000 + 3;
MultiLineString<double> mls;