Fix Security2Test counting
The test was counting the wrong thing. The alias code path is only
triggered by X509 and X.509. This worked when there was only 2 providers
that pointed at the opposites. When there were three the problem showed
up since it wasn't incrementing the right one.
Change-Id: Id4d01a1981658521a36c42c5d3aea13110069583
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/Security2Test.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/Security2Test.java
index 68e7cbc..4dfffda 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/Security2Test.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/Security2Test.java
@@ -57,17 +57,15 @@
for (Map.Entry entry : provider.entrySet()) {
String key = (String) entry.getKey();
if (isAlias(key)) {
- String aliasVal = key.substring("ALG.ALIAS.".length());
- String aliasKey = aliasVal.substring(0, aliasVal.indexOf(".") + 1)
- + entry.getValue();
+ String aliasName = key.substring("ALG.ALIAS.".length()).toUpperCase();
+ String realName = aliasName.substring(0, aliasName.indexOf(".") + 1) + entry.getValue();
// Skip over nonsense alias declarations where alias and
// aliased are identical. Such entries can occur.
- if (!aliasVal.equalsIgnoreCase(aliasKey)) {
- // Has a real entry been added for aliasValue ?
- if (allSupported.containsKey(aliasVal.toUpperCase())) {
- // Add 1 to the provider count of the thing being
- // aliased
- addOrIncrementTable(allSupported, aliasKey);
+ if (!aliasName.equalsIgnoreCase(realName)) {
+ // Has a real entry been added for aliasName ?
+ if (allSupported.containsKey(aliasName)) {
+ // Add 1 to the provider count of the thing being aliased
+ addOrIncrementTable(allSupported, aliasName);
}
}
}