summaryrefslogtreecommitdiff
path: root/cmds/statsd/tests/shell/ShellSubscriber_test.cpp
diff options
context:
space:
mode:
authortsaichristine <tsaichristine@google.com>2020-04-07 09:40:03 -0700
committertsaichristine <tsaichristine@google.com>2020-04-08 11:48:09 -0700
commit8dca82ed94a1417f46323860c36f4acb50f64846 (patch)
tree5cacbbb6523316bdf84657e08c92fbd666cbc773 /cmds/statsd/tests/shell/ShellSubscriber_test.cpp
parentb6c403b091c623718e2bb1d18b167b7d13b600f6 (diff)
statsd unit test and benchmark refactor
Abstract test utilities into two new functions: writeAttribution and parseStatsEventToLogEvent Bug: 149590301 Test: bit statsd_test:* && bit statsd_benchmark:* Change-Id: I5f77646b6d2d828344b8b6de8777a60d98f96d58
Diffstat (limited to 'cmds/statsd/tests/shell/ShellSubscriber_test.cpp')
-rw-r--r--cmds/statsd/tests/shell/ShellSubscriber_test.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/cmds/statsd/tests/shell/ShellSubscriber_test.cpp b/cmds/statsd/tests/shell/ShellSubscriber_test.cpp
index ac3ad690f81e..7b952d7a392e 100644
--- a/cmds/statsd/tests/shell/ShellSubscriber_test.cpp
+++ b/cmds/statsd/tests/shell/ShellSubscriber_test.cpp
@@ -171,13 +171,9 @@ shared_ptr<LogEvent> makeCpuActiveTimeAtom(int32_t uid, int64_t timeMillis) {
AStatsEvent_overwriteTimestamp(statsEvent, 1111L);
AStatsEvent_writeInt32(statsEvent, uid);
AStatsEvent_writeInt64(statsEvent, timeMillis);
- AStatsEvent_build(statsEvent);
-
- size_t size;
- uint8_t* buf = AStatsEvent_getBuffer(statsEvent, &size);
std::shared_ptr<LogEvent> logEvent = std::make_shared<LogEvent>(/*uid=*/0, /*pid=*/0);
- logEvent->parseBuffer(buf, size);
+ parseStatsEventToLogEvent(statsEvent, logEvent.get());
return logEvent;
}