Fix LogEventQueue_tests

These tests were broken by ag/10444161, which deleted a test-only
LogEvent constructor (the tests still built though because there was
another constructor that accepted the same parameter types but with much
different semantics).

Also fixes a bug in TestSlicedCondition that was introduced by one of
the later patchsets in ag/10444161.

Test: bit statsd_test:*
Bug: 149590301
Change-Id: If7de80922680c63505a4b30a1dcefdc47be13219
This commit is contained in:
Ruchir Rastogi
2020-02-27 16:33:39 -08:00
parent 720830ee90
commit 2250fa1593
2 changed files with 27 additions and 8 deletions

View File

@@ -297,7 +297,7 @@ TEST(SimpleConditionTrackerTest, TestSlicedCondition) {
std::vector<int> uids = {111, 222, 333};
LogEvent event(/*uid=*/-1, /*pid=*/-1);
makeWakeLockEvent(&event, /*atomId=*/ 1, /*timestamp=*/ 0, uids, "wl1", /*acquire=*/ 1);
makeWakeLockEvent(&event, /*atomId=*/1, /*timestamp=*/0, uids, "wl1", /*acquire=*/1);
// one matched start
vector<MatchingState> matcherState;
@@ -334,7 +334,7 @@ TEST(SimpleConditionTrackerTest, TestSlicedCondition) {
// another wake lock acquired by this uid
LogEvent event2(/*uid=*/-1, /*pid=*/-1);
makeWakeLockEvent(&event2, /*atomId=*/ 1, /*timestamp=*/ 0, uids, "wl2", /*acquire=*/ 1);
makeWakeLockEvent(&event2, /*atomId=*/1, /*timestamp=*/0, uids, "wl2", /*acquire=*/1);
matcherState.clear();
matcherState.push_back(MatchingState::kMatched);
matcherState.push_back(MatchingState::kNotMatched);
@@ -373,7 +373,7 @@ TEST(SimpleConditionTrackerTest, TestSlicedCondition) {
EXPECT_TRUE(conditionTracker.getChangedToFalseDimensions(allConditions)->empty());
LogEvent event4(/*uid=*/-1, /*pid=*/-1);
makeWakeLockEvent(&event, /*atomId=*/1, /*timestamp=*/ 0, uids, "wl2", /*acquire=*/0);
makeWakeLockEvent(&event4, /*atomId=*/1, /*timestamp=*/0, uids, "wl2", /*acquire=*/0);
matcherState.clear();
matcherState.push_back(MatchingState::kNotMatched);
matcherState.push_back(MatchingState::kMatched);