summaryrefslogtreecommitdiffstats
path: root/tests/component/edify_test.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2016-10-04 03:06:46 +0200
committerTao Bao <tbao@google.com>2016-10-04 23:24:32 +0200
commit59dcb9cbea8fb70ab933fd10d35582b08cd13f37 (patch)
tree64a8c1e78aa282460aebf39d3f4147d00ffa0fcc /tests/component/edify_test.cpp
parentMerge "recovery: drop log/logger.h" (diff)
downloadandroid_bootable_recovery-59dcb9cbea8fb70ab933fd10d35582b08cd13f37.tar
android_bootable_recovery-59dcb9cbea8fb70ab933fd10d35582b08cd13f37.tar.gz
android_bootable_recovery-59dcb9cbea8fb70ab933fd10d35582b08cd13f37.tar.bz2
android_bootable_recovery-59dcb9cbea8fb70ab933fd10d35582b08cd13f37.tar.lz
android_bootable_recovery-59dcb9cbea8fb70ab933fd10d35582b08cd13f37.tar.xz
android_bootable_recovery-59dcb9cbea8fb70ab933fd10d35582b08cd13f37.tar.zst
android_bootable_recovery-59dcb9cbea8fb70ab933fd10d35582b08cd13f37.zip
Diffstat (limited to 'tests/component/edify_test.cpp')
-rw-r--r--tests/component/edify_test.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/tests/component/edify_test.cpp b/tests/component/edify_test.cpp
index ded8540a0..ede2ecb0a 100644
--- a/tests/component/edify_test.cpp
+++ b/tests/component/edify_test.cpp
@@ -25,10 +25,7 @@ static void expect(const char* expr_str, const char* expected) {
int error_count;
EXPECT_EQ(parse_string(expr_str, &e, &error_count), 0);
- State state;
- state.cookie = nullptr;
- state.errmsg = nullptr;
- state.script = strdup(expr_str);
+ State state(expr_str, nullptr);
char* result = Evaluate(&state, e);
@@ -38,8 +35,6 @@ static void expect(const char* expr_str, const char* expected) {
EXPECT_STREQ(result, expected);
}
- free(state.errmsg);
- free(state.script);
free(result);
}