From dc034771cded31d98653e2abd9237f6b8ebf52d7 Mon Sep 17 00:00:00 2001 From: Bertrand SIMONNET Date: Mon, 21 Sep 2015 11:11:59 -0700 Subject: [PATCH] metricsd: Fix unit tests. When logging, libchrome will extract the program's name from the command line. If the command line helpers have not been initialized, the logging call will fail and the program will abort. BUG: 24262190 TEST: unit tests. Change-Id: Ie7982d5491f8373dc06ba44b69b518ff8673b568 --- metricsd/metrics_daemon_test.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/metricsd/metrics_daemon_test.cc b/metricsd/metrics_daemon_test.cc index 476d0f32c..1adf9de59 100644 --- a/metricsd/metrics_daemon_test.cc +++ b/metricsd/metrics_daemon_test.cc @@ -25,6 +25,7 @@ #include #include #include +#include #include #include "constants.h" @@ -60,6 +61,7 @@ class MetricsDaemonTest : public testing::Test { std::string kFakeDiskStats1; virtual void SetUp() { + chromeos::FlagHelper::Init(0, nullptr, ""); EXPECT_TRUE(temp_dir_.CreateUniqueTempDir()); scaling_max_freq_path_ = temp_dir_.path().Append("scaling_max"); cpu_max_freq_path_ = temp_dir_.path().Append("cpu_freq_max");