diff options
author | Yohann Roussel <yroussel@google.com> | 2015-03-03 18:53:07 +0100 |
---|---|---|
committer | Yohann Roussel <yroussel@google.com> | 2015-03-13 18:11:28 +0100 |
commit | 32f5e8e86a73b4cdcf692e1e3c588451eb1f8c31 (patch) | |
tree | da177a49c80882dc993614f029171c32f02cace5 /luni | |
parent | f94993c756f36e2b4b1f776264bb6aca4e799a7b (diff) | |
download | libcore-32f5e8e86a73b4cdcf692e1e3c588451eb1f8c31.zip libcore-32f5e8e86a73b4cdcf692e1e3c588451eb1f8c31.tar.gz libcore-32f5e8e86a73b4cdcf692e1e3c588451eb1f8c31.tar.bz2 |
Remove ExemptionMechanismTest.test_finalize
The test was making assumption on compiler + runtime and it seems there's
nothing left to test about finalizer in ExemptionMechanism anyway.
Bug: 18911912
Change-Id: I79efffa065ea6e8380741aac5cd4764e05acc7f7
Diffstat (limited to 'luni')
-rw-r--r-- | luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/ExemptionMechanismTest.java | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/ExemptionMechanismTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/ExemptionMechanismTest.java index 87b2913..17fb127 100644 --- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/ExemptionMechanismTest.java +++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/ExemptionMechanismTest.java @@ -28,7 +28,6 @@ import java.security.Provider; import java.security.SecureRandom; import java.security.spec.AlgorithmParameterSpec; import java.security.spec.RSAKeyGenParameterSpec; -import java.util.Vector; import javax.crypto.ExemptionMechanism; import javax.crypto.ExemptionMechanismException; @@ -37,7 +36,6 @@ import javax.crypto.KeyGenerator; import javax.crypto.ShortBufferException; import org.apache.harmony.crypto.tests.support.MyExemptionMechanismSpi; -import org.apache.harmony.crypto.tests.support.MyExemptionMechanismSpi.tmpKey; import org.apache.harmony.security.tests.support.SpiEngUtils; import junit.framework.TestCase; @@ -170,45 +168,6 @@ public class ExemptionMechanismTest extends TestCase { em.genExemptionBlob(new byte[10], -5); } - static boolean flag = false; - - class Mock_ExemptionMechanism extends ExemptionMechanism { - protected Mock_ExemptionMechanism(ExemptionMechanismSpi exmechSpi, Provider provider, String mechanism) { - super(exmechSpi, provider, mechanism); - } - - @Override - protected void finalize() { - flag = true; - super.finalize(); - } - } - - // Side Effect: Causes OutOfMemoryError to test finalization - public void test_finalize () { - Mock_ExemptionMechanism mem = new Mock_ExemptionMechanism(null, null, "Name"); - assertNotNull(mem); - mem = null; - assertFalse(flag); - Vector v = new Vector(); - int capacity; - try { - while(true) { - v.add(this); - } - } catch (OutOfMemoryError e) { - capacity = v.size(); - v = null; - } - - v = new Vector(); - for (int i = 0; i < capacity/2; i++) { - v.add(this); - } - v = null; - assertTrue(flag); - } - class Mock_ExemptionMechanismSpi extends MyExemptionMechanismSpi { @Override protected byte[] engineGenExemptionBlob() |