diff options
| author | 2020-12-02 12:19:13 +0100 | |
|---|---|---|
| committer | 2020-12-08 15:27:58 +0100 | |
| commit | d52137ea4df4bd3961bf92429401a9c4dbdc936c (patch) | |
| tree | c85ca3b41443ba5329c4c2e7462a83b1b9892f49 | |
| parent | 68a9409306f2d3b1eae220eb20c7fac4fa3e5452 (diff) | |
SF: fix conversion issues
Test: presubmit
Bug: 129481165
Change-Id: Ia3e2dfa38ad6b113c9b0ec5c50ce64225cd2898b
| -rw-r--r-- | services/surfaceflinger/tests/unittests/RefreshRateStatsTest.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/services/surfaceflinger/tests/unittests/RefreshRateStatsTest.cpp b/services/surfaceflinger/tests/unittests/RefreshRateStatsTest.cpp index f938ba1133..e93d0d0805 100644 --- a/services/surfaceflinger/tests/unittests/RefreshRateStatsTest.cpp +++ b/services/surfaceflinger/tests/unittests/RefreshRateStatsTest.cpp @@ -14,10 +14,6 @@ * limitations under the License. */ -// TODO(b/129481165): remove the #pragma below and fix conversion issues -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wconversion" - #undef LOG_TAG #define LOG_TAG "SchedulerUnittests" @@ -83,7 +79,7 @@ RefreshRateStatsTest::~RefreshRateStatsTest() { std::shared_ptr<const HWC2::Display::Config> RefreshRateStatsTest::createConfig( HwcConfigIndexType configId, int32_t configGroup, int64_t vsyncPeriod) { - return HWC2::Display::Config::Builder(mDisplay, configId.value()) + return HWC2::Display::Config::Builder(mDisplay, static_cast<hal::HWConfigId>(configId.value())) .setVsyncPeriod(static_cast<int32_t>(vsyncPeriod)) .setConfigGroup(configGroup) .build(); @@ -105,7 +101,7 @@ TEST_F(RefreshRateStatsTest, oneConfigTest) { // Setting up tests on mobile harness can be flaky with time passing, so testing for // exact time changes can result in flaxy numbers. To avoid that remember old // numbers to make sure the correct values are increasing in the next test. - int screenOff = times["ScreenOff"]; + auto screenOff = times["ScreenOff"]; // Screen is off by default. std::this_thread::sleep_for(std::chrono::milliseconds(2)); @@ -124,7 +120,7 @@ TEST_F(RefreshRateStatsTest, oneConfigTest) { EXPECT_LT(0, times["90.00fps"]); mRefreshRateStats->setPowerMode(PowerMode::DOZE); - int ninety = mRefreshRateStats->getTotalTimes()["90.00fps"]; + auto ninety = mRefreshRateStats->getTotalTimes()["90.00fps"]; std::this_thread::sleep_for(std::chrono::milliseconds(2)); times = mRefreshRateStats->getTotalTimes(); EXPECT_LT(screenOff, times["ScreenOff"]); @@ -154,7 +150,7 @@ TEST_F(RefreshRateStatsTest, twoConfigsTest) { // Setting up tests on mobile harness can be flaky with time passing, so testing for // exact time changes can result in flaxy numbers. To avoid that remember old // numbers to make sure the correct values are increasing in the next test. - int screenOff = times["ScreenOff"]; + auto screenOff = times["ScreenOff"]; // Screen is off by default. std::this_thread::sleep_for(std::chrono::milliseconds(2)); @@ -174,7 +170,7 @@ TEST_F(RefreshRateStatsTest, twoConfigsTest) { // When power mode is normal, time for configs updates. mRefreshRateStats->setRefreshRate(config1Fps); - int ninety = mRefreshRateStats->getTotalTimes()["90.00fps"]; + auto ninety = mRefreshRateStats->getTotalTimes()["90.00fps"]; std::this_thread::sleep_for(std::chrono::milliseconds(2)); times = mRefreshRateStats->getTotalTimes(); EXPECT_EQ(screenOff, times["ScreenOff"]); @@ -183,7 +179,7 @@ TEST_F(RefreshRateStatsTest, twoConfigsTest) { EXPECT_LT(0, times["60.00fps"]); mRefreshRateStats->setRefreshRate(config0Fps); - int sixty = mRefreshRateStats->getTotalTimes()["60.00fps"]; + auto sixty = mRefreshRateStats->getTotalTimes()["60.00fps"]; std::this_thread::sleep_for(std::chrono::milliseconds(2)); times = mRefreshRateStats->getTotalTimes(); EXPECT_EQ(screenOff, times["ScreenOff"]); @@ -220,6 +216,3 @@ TEST_F(RefreshRateStatsTest, twoConfigsTest) { } // namespace } // namespace scheduler } // namespace android - -// TODO(b/129481165): remove the #pragma below and fix conversion issues -#pragma clang diagnostic pop // ignored "-Wconversion" |