diff options
Diffstat (limited to 'cmds/incident_helper/tests/ProcrankParser_test.cpp')
-rw-r--r-- | cmds/incident_helper/tests/ProcrankParser_test.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/cmds/incident_helper/tests/ProcrankParser_test.cpp b/cmds/incident_helper/tests/ProcrankParser_test.cpp index e86647ad479b..76b25d7f8f47 100644 --- a/cmds/incident_helper/tests/ProcrankParser_test.cpp +++ b/cmds/incident_helper/tests/ProcrankParser_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; @@ -104,7 +97,7 @@ TEST_F(ProcrankParserTest, HasSwapInfo) { CaptureStdout(); ASSERT_EQ(NO_ERROR, parser.Parse(fd, STDOUT_FILENO)); - EXPECT_EQ(GetCapturedStdout(), getSerializedString(expected)); + EXPECT_EQ(GetCapturedStdout(), expected.SerializeAsString()); close(fd); } @@ -142,6 +135,6 @@ TEST_F(ProcrankParserTest, NoSwapInfo) { CaptureStdout(); ASSERT_EQ(NO_ERROR, parser.Parse(fd, STDOUT_FILENO)); - EXPECT_EQ(GetCapturedStdout(), getSerializedString(expected)); + EXPECT_EQ(GetCapturedStdout(), expected.SerializeAsString()); close(fd); } |