blob: bd665ecd35cd0a18076e236af706ba486cd9c567 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
package org.bouncycastle.asn1.test;
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
import org.bouncycastle.util.test.SimpleTest;
import org.bouncycastle.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);
}
}
|