summaryrefslogtreecommitdiffstats
path: root/tests/component/updater_test.cpp
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2016-10-18 02:21:59 +0200
committerandroid-build-merger <android-build-merger@google.com>2016-10-18 02:21:59 +0200
commit13d8ee8c72ae3705819e1e0afae765e2d66a89bf (patch)
treec9f593eb6a4f2a2aaef3d400366525048e40a2b5 /tests/component/updater_test.cpp
parentMerge "init: move healthd to late-init" am: a01ffc73ef (diff)
parentMerge "Change StringValue to use std::string" (diff)
downloadandroid_bootable_recovery-13d8ee8c72ae3705819e1e0afae765e2d66a89bf.tar
android_bootable_recovery-13d8ee8c72ae3705819e1e0afae765e2d66a89bf.tar.gz
android_bootable_recovery-13d8ee8c72ae3705819e1e0afae765e2d66a89bf.tar.bz2
android_bootable_recovery-13d8ee8c72ae3705819e1e0afae765e2d66a89bf.tar.lz
android_bootable_recovery-13d8ee8c72ae3705819e1e0afae765e2d66a89bf.tar.xz
android_bootable_recovery-13d8ee8c72ae3705819e1e0afae765e2d66a89bf.tar.zst
android_bootable_recovery-13d8ee8c72ae3705819e1e0afae765e2d66a89bf.zip
Diffstat (limited to 'tests/component/updater_test.cpp')
-rw-r--r--tests/component/updater_test.cpp8
1 files changed, 4 insertions, 4 deletions
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 {