From aced5d9e4e438ba478ce54f9217166b8ab7cc24f Mon Sep 17 00:00:00 2001 From: Tianjie Xu Date: Wed, 12 Oct 2016 10:55:04 -0700 Subject: Change StringValue to use std::string Changing the field of 'Value' in edify to std::string from char*. Meanwhile cleaning up the users of 'Value' and switching them to cpp style. Test: compontent tests passed. Bug: 31713288 Change-Id: Iec5a7d601b1e4ca40935bf1c70d325dafecec235 --- tests/component/updater_test.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/component/updater_test.cpp') diff --git a/tests/component/updater_test.cpp b/tests/component/updater_test.cpp index 64a6b37ce..a859f11c1 100644 --- a/tests/component/updater_test.cpp +++ b/tests/component/updater_test.cpp @@ -32,12 +32,13 @@ static void expect(const char* expected, const char* expr_str, CauseCode cause_c State state(expr_str, nullptr); - char* result = Evaluate(&state, e); + std::string result; + bool status = Evaluate(&state, e, &result); if (expected == nullptr) { - EXPECT_EQ(nullptr, result); + EXPECT_FALSE(status); } else { - EXPECT_STREQ(expected, result); + EXPECT_STREQ(expected, result.c_str()); } // Error code is set in updater/updater.cpp only, by parsing State.errmsg. @@ -46,7 +47,6 @@ static void expect(const char* expected, const char* expr_str, CauseCode cause_c // Cause code should always be available. EXPECT_EQ(cause_code, state.cause_code); - free(result); } class UpdaterTest : public ::testing::Test { -- cgit v1.2.3