summaryrefslogtreecommitdiff
path: root/libs/androidfw/tests/CommonHelpers.cpp
diff options
context:
space:
mode:
authorRyan Mitchell <rtmitchell@google.com>2020-12-14 20:42:03 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2020-12-14 20:42:03 +0000
commit314863c132479b108f0ce61a5a753123cd3a15ca (patch)
tree8c2c62e7f5964b3ed503f1f2c753d0850ac70dec /libs/androidfw/tests/CommonHelpers.cpp
parent2991744d472491889d9ba465c8f96c1022af5df0 (diff)
parenta45506e6f6619f59ce1ae94b20ad377b86966be0 (diff)
Merge changes from topic "inc-hard-am"
* changes: Revert^2 "Cache resolved theme values" Set resource id correctly when resolve fails Revert^2 "libandroidfw hardening for IncFs" idmap2: remove call to obsolete 'idmap2 verify' from valgrind.sh idmap2: remove the 'scan' command
Diffstat (limited to 'libs/androidfw/tests/CommonHelpers.cpp')
-rw-r--r--libs/androidfw/tests/CommonHelpers.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/libs/androidfw/tests/CommonHelpers.cpp b/libs/androidfw/tests/CommonHelpers.cpp
index faa5350f9ecc..3396729536a4 100644
--- a/libs/androidfw/tests/CommonHelpers.cpp
+++ b/libs/androidfw/tests/CommonHelpers.cpp
@@ -58,8 +58,9 @@ const std::string& GetTestDataPath() {
}
std::string GetStringFromPool(const ResStringPool* pool, uint32_t idx) {
- String8 str = pool->string8ObjectAt(idx);
- return std::string(str.string(), str.length());
+ auto str = pool->string8ObjectAt(idx);
+ CHECK(str.has_value()) << "failed to find string entry";
+ return std::string(str->string(), str->length());
}
} // namespace android