Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/quite/humla-spongycastle.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/test/java/org/spongycastle/asn1/test/ObjectIdentifierTest.java')
-rw-r--r--core/src/test/java/org/spongycastle/asn1/test/ObjectIdentifierTest.java38
1 files changed, 38 insertions, 0 deletions
diff --git a/core/src/test/java/org/spongycastle/asn1/test/ObjectIdentifierTest.java b/core/src/test/java/org/spongycastle/asn1/test/ObjectIdentifierTest.java
new file mode 100644
index 00000000..ed0a6023
--- /dev/null
+++ b/core/src/test/java/org/spongycastle/asn1/test/ObjectIdentifierTest.java
@@ -0,0 +1,38 @@
+package org.spongycastle.asn1.test;
+
+import org.spongycastle.asn1.ASN1ObjectIdentifier;
+import org.spongycastle.util.test.SimpleTest;
+import org.spongycastle.util.test.TestResult;
+
+public class ObjectIdentifierTest
+ extends SimpleTest
+{
+ public String getName()
+ {
+ return "ObjectIdentifier";
+ }
+
+ public void performTest()
+ throws Exception
+ {
+ // exercise the object cache
+ for (int i = 0; i < 1024; i++)
+ {
+ for (int j = 0; j != 17000; j++)
+ {
+ byte[] encoded = new ASN1ObjectIdentifier("1.1." + i + "." + j).getEncoded();
+
+ ASN1ObjectIdentifier.getInstance(encoded);
+ }
+ }
+ }
+
+ public static void main(
+ String[] args)
+ {
+ ObjectIdentifierTest test = new ObjectIdentifierTest();
+ TestResult result = test.perform();
+
+ System.out.println(result);
+ }
+}