diff options
| author | 2019-08-07 10:54:29 -0700 | |
|---|---|---|
| committer | 2019-08-07 11:08:38 -0700 | |
| commit | 6740e66bd1dd14c09804d56fbf859b64ae19fa84 (patch) | |
| tree | 2b269e098aa3507edfbc796809c68854870684fd | |
| parent | 3d3fa52c8bbe481ffb87d75e24725444bef0b939 (diff) | |
Add sleep to ShouldReportStats Test in libinput_tests
Tests were flaky previously, by adding this sleep, this should should
assert that stats.shouldReport() is always true.
Test: atest LatencyStatisticsTest
Bug: 139050511
Change-Id: I9ca106fca758378eded19c6bf130aaee5387967c
Signed-off-by: Atif Niyaz <atifniyaz@google.com>
| -rw-r--r-- | libs/input/tests/LatencyStatistics_test.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libs/input/tests/LatencyStatistics_test.cpp b/libs/input/tests/LatencyStatistics_test.cpp index 6d1cab4187..eb12d4ef6f 100644 --- a/libs/input/tests/LatencyStatistics_test.cpp +++ b/libs/input/tests/LatencyStatistics_test.cpp @@ -18,6 +18,7 @@ #include <input/LatencyStatistics.h> #include <cmath> #include <limits> +#include <thread> namespace android { namespace test { @@ -65,6 +66,8 @@ TEST(LatencyStatisticsTest, ShouldReportStats) { LatencyStatistics stats{0min}; stats.addValue(5.0); + std::this_thread::sleep_for(1us); + ASSERT_EQ(stats.shouldReport(), true); } |