diff options
Diffstat (limited to 'test/util')
-rw-r--r-- | test/util/merge_lines.test.cpp | 2 | ||||
-rw-r--r-- | test/util/peer.test.cpp | 12 | ||||
-rw-r--r-- | test/util/tile_cover.test.cpp | 12 |
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; |