diff options
author | 2018-12-20 13:49:51 -0800 | |
---|---|---|
committer | 2019-01-04 17:42:27 +0000 | |
commit | 1c57378eeddf5f981fcdda227829d6f6b2309c32 (patch) | |
tree | c15ac65238a6db51c5694cf1ce72baf77edd270f | |
parent | bd7379858523c4e06175ee6cd92b46750d05b1dd (diff) |
Fix/suppress hwui/tests google-explicit-constructor warnings
* Add explicit to conversion constructors/operators
Bug: 28341362
Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,google-explicit-constructor
Change-Id: I59c61af29ab09209c5a4c2bf43b10215bf59756a
-rw-r--r-- | libs/hwui/tests/common/scenes/BitmapFillrate.cpp | 4 | ||||
-rw-r--r-- | libs/hwui/tests/common/scenes/BitmapShaders.cpp | 2 | ||||
-rw-r--r-- | libs/hwui/tests/common/scenes/TvApp.cpp | 8 | ||||
-rw-r--r-- | libs/hwui/tests/unit/SkiaRenderPropertiesTests.cpp | 2 | ||||
-rw-r--r-- | libs/hwui/tests/unit/ThreadBaseTests.cpp | 4 |
5 files changed, 10 insertions, 10 deletions
diff --git a/libs/hwui/tests/common/scenes/BitmapFillrate.cpp b/libs/hwui/tests/common/scenes/BitmapFillrate.cpp index 1d3d60716d68..5af7d43d7f66 100644 --- a/libs/hwui/tests/common/scenes/BitmapFillrate.cpp +++ b/libs/hwui/tests/common/scenes/BitmapFillrate.cpp @@ -31,7 +31,7 @@ static bool _BitmapFillrate( class BitmapFillrate : public TestScene { public: - BitmapFillrate(BitmapAllocationTestUtils::BitmapAllocator allocator) + explicit BitmapFillrate(BitmapAllocationTestUtils::BitmapAllocator allocator) : TestScene(), mAllocator(allocator) {} void createContent(int width, int height, Canvas& canvas) override { @@ -70,4 +70,4 @@ private: BitmapAllocationTestUtils::BitmapAllocator mAllocator; std::vector<sp<RenderNode> > mNodes; -};
\ No newline at end of file +}; diff --git a/libs/hwui/tests/common/scenes/BitmapShaders.cpp b/libs/hwui/tests/common/scenes/BitmapShaders.cpp index 15039b5fa976..4ecb54c9f0fd 100644 --- a/libs/hwui/tests/common/scenes/BitmapShaders.cpp +++ b/libs/hwui/tests/common/scenes/BitmapShaders.cpp @@ -26,7 +26,7 @@ static bool _BitmapShaders(BitmapAllocationTestUtils::registerBitmapAllocationSc class BitmapShaders : public TestScene { public: - BitmapShaders(BitmapAllocationTestUtils::BitmapAllocator allocator) + explicit BitmapShaders(BitmapAllocationTestUtils::BitmapAllocator allocator) : TestScene(), mAllocator(allocator) {} sp<RenderNode> card; diff --git a/libs/hwui/tests/common/scenes/TvApp.cpp b/libs/hwui/tests/common/scenes/TvApp.cpp index a64e8444a9b1..286f5f194aed 100644 --- a/libs/hwui/tests/common/scenes/TvApp.cpp +++ b/libs/hwui/tests/common/scenes/TvApp.cpp @@ -48,7 +48,7 @@ static bool _TvAppNoRoundedCornerColorFilter( class TvApp : public TestScene { public: - TvApp(BitmapAllocationTestUtils::BitmapAllocator allocator) + explicit TvApp(BitmapAllocationTestUtils::BitmapAllocator allocator) : TestScene(), mAllocator(allocator) {} sp<RenderNode> mBg; @@ -232,7 +232,7 @@ private: class TvAppNoRoundedCorner : public TvApp { public: - TvAppNoRoundedCorner(BitmapAllocationTestUtils::BitmapAllocator allocator) : TvApp(allocator) {} + explicit TvAppNoRoundedCorner(BitmapAllocationTestUtils::BitmapAllocator allocator) : TvApp(allocator) {} private: virtual float roundedCornerRadius() override { return dp(0); } @@ -240,7 +240,7 @@ private: class TvAppColorFilter : public TvApp { public: - TvAppColorFilter(BitmapAllocationTestUtils::BitmapAllocator allocator) : TvApp(allocator) {} + explicit TvAppColorFilter(BitmapAllocationTestUtils::BitmapAllocator allocator) : TvApp(allocator) {} private: virtual bool useOverlay() override { return false; } @@ -248,7 +248,7 @@ private: class TvAppNoRoundedCornerColorFilter : public TvApp { public: - TvAppNoRoundedCornerColorFilter(BitmapAllocationTestUtils::BitmapAllocator allocator) + explicit TvAppNoRoundedCornerColorFilter(BitmapAllocationTestUtils::BitmapAllocator allocator) : TvApp(allocator) {} private: diff --git a/libs/hwui/tests/unit/SkiaRenderPropertiesTests.cpp b/libs/hwui/tests/unit/SkiaRenderPropertiesTests.cpp index ad5fdacc8594..7deb0b1486ea 100644 --- a/libs/hwui/tests/unit/SkiaRenderPropertiesTests.cpp +++ b/libs/hwui/tests/unit/SkiaRenderPropertiesTests.cpp @@ -45,7 +45,7 @@ static void testProperty(std::function<void(RenderProperties&)> propSetupCallbac static const int CANVAS_HEIGHT = 100; class PropertyTestCanvas : public TestCanvasBase { public: - PropertyTestCanvas(std::function<void(const SkCanvas&)> callback) + explicit PropertyTestCanvas(std::function<void(const SkCanvas&)> callback) : TestCanvasBase(CANVAS_WIDTH, CANVAS_HEIGHT), mCallback(callback) {} void onDrawRect(const SkRect& rect, const SkPaint& paint) override { EXPECT_EQ(mDrawCounter++, 0); diff --git a/libs/hwui/tests/unit/ThreadBaseTests.cpp b/libs/hwui/tests/unit/ThreadBaseTests.cpp index 1168ff211202..817c1f3d3e43 100644 --- a/libs/hwui/tests/unit/ThreadBaseTests.cpp +++ b/libs/hwui/tests/unit/ThreadBaseTests.cpp @@ -95,7 +95,7 @@ TEST(ThreadBase, lifecyclePerf) { }; struct Counter { - Counter(EventCount* count) : mCount(count) { mCount->construct++; } + explicit Counter(EventCount* count) : mCount(count) { mCount->construct++; } Counter(const Counter& other) : mCount(other.mCount) { if (mCount) mCount->copy++; @@ -148,4 +148,4 @@ TEST(ThreadBase, lifecycle) { ASSERT_EQ(1, dummyObject->getStrongCount()); ASSERT_EQ(2, lifecycleTestHelper(dummyObject)); ASSERT_EQ(1, dummyObject->getStrongCount()); -}
\ No newline at end of file +} |