Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 92912b63 authored by masonwang's avatar masonwang
Browse files

Fix VTS BatchingOperation Test.

Change list:
1. Cap minFifoCount to batching period worth of samples.
2. Modify the test period:
From :
batchingPeriodInNs * (0.8 + 0.8) = 1.6 times the batchingPeriodInNs
To
batchingPeriodInNs * (0.8 + 0.2) = batchingPeriodInNs

Bug: 185972775
Test: Verify pass by checking event count if it is closed to the
criteria.

Change-Id: Ied178150788e1a80d6fa6c87afbd1738ade48a0b
parent e84db6be
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -425,7 +425,10 @@ class SensorsHidlTestBase : public testing::TestWithParam<std::string> {
            return;
        }

        batchingPeriodInNs = std::min(batchingPeriodInNs, maxBatchingTestTimeNs);
        if (batchingPeriodInNs > maxBatchingTestTimeNs) {
            batchingPeriodInNs = maxBatchingTestTimeNs;
            minFifoCount = (uint32_t)(batchingPeriodInNs / minSamplingPeriodInNs);
        }

        ALOGI("Test batching for %d ms", (int)(batchingPeriodInNs / 1000 / 1000));

@@ -448,7 +451,7 @@ class SensorsHidlTestBase : public testing::TestWithParam<std::string> {
                      false /*change collection*/);

        // 0.8 + 0.2 times the batching period
        usleep(batchingPeriodInNs / 1000 * 8 / 10);
        usleep(batchingPeriodInNs / 1000 * 2 / 10);
        ASSERT_EQ(flush(handle), Result::OK);

        // plus some time for the event to deliver