AAPT2: Disable locale domination for deduping
Locale deduping isn't straightforward, as parenting rules
change between platform versions and the selection
preference of a specific locale variant over the default
configuration lead to incorrect results at runtime.
Bug: 62409213
Test: make aapt2_tests
Change-Id: Iec8f1cfba7ae43c847d163529891fdc15f3db826
diff --git a/tools/aapt2/test/Common.h b/tools/aapt2/test/Common.h
index bc8d274..11821031 100644
--- a/tools/aapt2/test/Common.h
+++ b/tools/aapt2/test/Common.h
@@ -141,10 +141,23 @@
return arg.Equals(&a);
}
-MATCHER_P(StrValueEq, a, std::string(negation ? "isn't" : "is") + " equal to " + ::testing::PrintToString(a)) {
+MATCHER_P(StrValueEq, a,
+ std::string(negation ? "isn't" : "is") + " equal to " + ::testing::PrintToString(a)) {
return *(arg.value) == a;
}
+MATCHER_P(HasValue, name,
+ std::string(negation ? "does not have" : "has") + " value " +
+ ::testing::PrintToString(name)) {
+ return GetValueForConfig<Value>(&(*arg), name, {}) != nullptr;
+}
+
+MATCHER_P2(HasValue, name, config,
+ std::string(negation ? "does not have" : "has") + " value " +
+ ::testing::PrintToString(name) + " for config " + ::testing::PrintToString(config)) {
+ return GetValueForConfig<Value>(&(*arg), name, config) != nullptr;
+}
+
} // namespace test
} // namespace aapt