summaryrefslogtreecommitdiff
path: root/libs/androidfw/tests/TestHelpers.cpp
diff options
context:
space:
mode:
authorRyan Mitchell <rtmitchell@google.com>2020-11-13 23:55:20 +0000
committerRyan Mitchell <rtmitchell@google.com>2020-11-13 23:55:20 +0000
commit55ef6167a2c235bd88c7216238b2001b46795b79 (patch)
tree5a63ff5e6b8a0ade4ce5aa2c4d663d62a7d993d9 /libs/androidfw/tests/TestHelpers.cpp
parent6ca48473e533a8b89abac6294a0bb8130b8c8c89 (diff)
Revert "libandroidfw hardening for IncFs"
Revert "Move map_ptr to incfs namspace" Revert submission 12787270 Reason for revert: b/173250495 Reverted Changes: I5cd1bc8a2:libandroidfw hardening for IncFs Ice5dbcfb2:Move map_ptr to incfs namspace I29ccdc8ed:Do not cache bag parent stack until requested I1e9e9acaa:Cache resolved theme values Change-Id: Ib90ef68339710086df41e9abe0833a542d03a74f
Diffstat (limited to 'libs/androidfw/tests/TestHelpers.cpp')
-rw-r--r--libs/androidfw/tests/TestHelpers.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/libs/androidfw/tests/TestHelpers.cpp b/libs/androidfw/tests/TestHelpers.cpp
index 10c0a4fc8316..a81bb6ffab06 100644
--- a/libs/androidfw/tests/TestHelpers.cpp
+++ b/libs/androidfw/tests/TestHelpers.cpp
@@ -73,15 +73,11 @@ AssertionResult IsStringEqual(const ResTable& table, uint32_t resource_id,
return AssertionFailure() << "table has no string pool for block " << block;
}
- auto actual_str = pool->string8ObjectAt(val.data);
- if (!actual_str.has_value()) {
- return AssertionFailure() << "could not find string entry";
+ const String8 actual_str = pool->string8ObjectAt(val.data);
+ if (String8(expected_str) != actual_str) {
+ return AssertionFailure() << actual_str.string();
}
-
- if (String8(expected_str) != *actual_str) {
- return AssertionFailure() << actual_str->string();
- }
- return AssertionSuccess() << actual_str->string();
+ return AssertionSuccess() << actual_str.string();
}
} // namespace android