diff options
Diffstat (limited to 'cmds/incident_helper/tests/SystemPropertiesParser_test.cpp')
-rw-r--r-- | cmds/incident_helper/tests/SystemPropertiesParser_test.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/cmds/incident_helper/tests/SystemPropertiesParser_test.cpp b/cmds/incident_helper/tests/SystemPropertiesParser_test.cpp index 98838e98d796..2fe2411e2017 100644 --- a/cmds/incident_helper/tests/SystemPropertiesParser_test.cpp +++ b/cmds/incident_helper/tests/SystemPropertiesParser_test.cpp @@ -21,7 +21,7 @@ #include <android-base/file.h> #include <android-base/test_utils.h> #include <gmock/gmock.h> -#include <google/protobuf/message.h> +#include <google/protobuf/message_lite.h> #include <gtest/gtest.h> #include <string.h> #include <fcntl.h> @@ -42,13 +42,6 @@ public: ASSERT_TRUE(tf.fd != -1); } - string getSerializedString(::google::protobuf::Message& message) { - string expectedStr; - message.SerializeToFileDescriptor(tf.fd); - ReadFileToString(tf.path, &expectedStr); - return expectedStr; - } - protected: TemporaryFile tf; @@ -99,6 +92,6 @@ TEST_F(SystemPropertiesParserTest, HasSwapInfo) { CaptureStdout(); ASSERT_EQ(NO_ERROR, parser.Parse(fd, STDOUT_FILENO)); - EXPECT_EQ(GetCapturedStdout(), getSerializedString(expected)); + EXPECT_EQ(GetCapturedStdout(), expected.SerializeAsString()); close(fd); } |