CipherTest: test providers that don't use full transform name

Some providers such as Bouncycastle list their Cipher implementations
without mode or padding specified, so we should test those providers as
well.

Test: make -j32 build-art-host vogar && vogar --mode host --classpath out/host/common/obj/JAVA_LIBRARIES/core-tests-support-hostdex_intermediates/classes.jack --classpath out/host/common/obj/JAVA_LIBRARIES/core-tests-hostdex_intermediates/classes.jack libcore/luni/src/test/java/libcore/javax/crypto/CipherTest.java
Change-Id: I79c59db637d7b7bfae4b1c1cb78be72490384e1d
diff --git a/luni/src/test/java/libcore/javax/crypto/CipherTest.java b/luni/src/test/java/libcore/javax/crypto/CipherTest.java
index 8dad349..d3a2615 100644
--- a/luni/src/test/java/libcore/javax/crypto/CipherTest.java
+++ b/luni/src/test/java/libcore/javax/crypto/CipherTest.java
@@ -3240,16 +3240,37 @@
         ByteArrayOutputStream errBuffer = new ByteArrayOutputStream();
         PrintStream out = new PrintStream(errBuffer);
         for (CipherTestParam testVector : testVectors) {
-            Provider[] providers = Security.getProviders("Cipher." + testVector.transformation);
-            if ((providers == null) || (providers.length == 0)) {
+            ArrayList<Provider> providers = new ArrayList<>();
+
+            Provider[] providerArray = Security.getProviders("Cipher." + testVector.transformation);
+            if (providerArray != null) {
+                Collections.addAll(providers, providerArray);
+            }
+
+            if (testVector.transformation.indexOf('/') > 0) {
+                Provider[] baseTransformProviderArray = Security.getProviders("Cipher."
+                        + testVector.transformation.substring(
+                                  0, testVector.transformation.indexOf('/')));
+                if (baseTransformProviderArray != null) {
+                    Collections.addAll(providers, baseTransformProviderArray);
+                }
+            }
+
+            if (providers.isEmpty()) {
                 out.append("No providers offer " + testVector.transformation + "\n");
                 continue;
             }
+
             for (Provider provider : providers) {
                 try {
                     checkCipher(testVector, provider.getName());
-                } catch (Exception e) {
-                    logTestFailure(out, provider.getName(), testVector, e);
+                } catch (Throwable e) {
+                    out.append("Error encountered checking " + testVector.transformation);
+                    if (testVector.encryptKey instanceof SecretKey) {
+                        out.append(", keySize=" + testVector.encryptKey.getEncoded().length * 8);
+                    }
+                    out.append(" with provider " + provider + "\n");
+                    e.printStackTrace(out);
                 }
             }
         }