@@ -36,24 +36,24 @@ public static CBORObject RandomNumber(IRandomGenExtended rand) {
3636 o = RandomObjects .RandomDouble (
3737 rand ,
3838 Integer .MAX_VALUE );
39- return ToObjectTest . TestToFromObjectRoundTrip (o );
39+ return CBORObject . FromObject (o );
4040 case 1 :
4141 o = RandomObjects .RandomSingle (
4242 rand ,
4343 Integer .MAX_VALUE );
44- return ToObjectTest . TestToFromObjectRoundTrip (o );
44+ return CBORObject . FromObject (o );
4545 case 2 :
46- return ToObjectTest . TestToFromObjectRoundTrip (
46+ return CBORObject . FromObject (
4747 RandomObjects .RandomEInteger (rand ));
4848 case 3 :
49- return ToObjectTest . TestToFromObjectRoundTrip (
49+ return CBORObject . FromObject (
5050 RandomObjects .RandomEFloat (rand ));
5151 case 4 :
5252 o = RandomObjects .RandomEDecimal (rand );
53- return ToObjectTest . TestToFromObjectRoundTrip (o );
53+ return CBORObject . FromObject (o );
5454 case 5 :
5555 o = RandomObjects .RandomInt64 (rand );
56- return ToObjectTest . TestToFromObjectRoundTrip (o );
56+ return CBORObject . FromObject (o );
5757 default : throw new IllegalStateException ();
5858 }
5959 }
@@ -65,27 +65,27 @@ public static CBORObject RandomNumberOrRational(IRandomGenExtended rand) {
6565 o = RandomObjects .RandomDouble (
6666 rand ,
6767 Integer .MAX_VALUE );
68- return ToObjectTest . TestToFromObjectRoundTrip (o );
68+ return CBORObject . FromObject (o );
6969 case 1 :
7070 o = RandomObjects .RandomSingle (
7171 rand ,
7272 Integer .MAX_VALUE );
73- return ToObjectTest . TestToFromObjectRoundTrip (o );
73+ return CBORObject . FromObject (o );
7474 case 2 :
75- return ToObjectTest . TestToFromObjectRoundTrip (
75+ return CBORObject . FromObject (
7676 RandomObjects .RandomEInteger (rand ));
7777 case 3 :
78- return ToObjectTest . TestToFromObjectRoundTrip (
78+ return CBORObject . FromObject (
7979 RandomObjects .RandomEFloat (rand ));
8080 case 4 :
8181 o = RandomObjects .RandomEDecimal (rand );
82- return ToObjectTest . TestToFromObjectRoundTrip (o );
82+ return CBORObject . FromObject (o );
8383 case 5 :
8484 o = RandomObjects .RandomInt64 (rand );
85- return ToObjectTest . TestToFromObjectRoundTrip (o );
85+ return CBORObject . FromObject (o );
8686 case 6 :
8787 o = RandomObjects .RandomERational (rand );
88- return ToObjectTest . TestToFromObjectRoundTrip (o );
88+ return CBORObject . FromObject (o );
8989 default : throw new IllegalStateException ();
9090 }
9191 }
@@ -111,7 +111,8 @@ public static EInteger RandomEIntegerMajorType0(IRandomGenExtended rand) {
111111 return ei ;
112112 }
113113
114- public static EInteger RandomEIntegerMajorType0Or1 (IRandomGenExtended rand ) {
114+ public static EInteger RandomEIntegerMajorType0Or1 (IRandomGenExtended
115+ rand ) {
115116 int v = rand .GetInt32 (0x10000 );
116117 EInteger ei = EInteger .FromInt32 (v );
117118 ei = ei .ShiftLeft (16 ).Add (rand .GetInt32 (0x10000 ));
@@ -147,7 +148,7 @@ public static CBORObject RandomCBORTaggedObject(
147148 }
148149 if (tag == 30 ) {
149150 Object o = RandomObjects .RandomByteString (rand );
150- return ToObjectTest . TestToFromObjectRoundTrip (o );
151+ return CBORObject . FromObject (o );
151152 }
152153 {
153154 CBORObject cbor ;
@@ -157,27 +158,28 @@ public static CBORObject RandomCBORTaggedObject(
157158 }
158159 if (tag == 2 || tag == 3 ) {
159160 Object o = RandomObjects .RandomByteStringShort (rand );
160- cbor = ToObjectTest . TestToFromObjectRoundTrip (o );
161+ cbor = CBORObject . FromObject (o );
161162 } else if (tag == 4 || tag == 5 ) {
162163 cbor = CBORObject .NewArray ();
163164 Object o = RandomObjects .RandomSmallIntegral (rand );
164- cbor .Add (ToObjectTest . TestToFromObjectRoundTrip ( o ) );
165+ cbor .Add (o );
165166 o = RandomObjects .RandomEInteger (rand );
166- cbor .Add (ToObjectTest . TestToFromObjectRoundTrip ( o ) );
167+ cbor .Add (o );
167168 } else if (tag == 30 ) {
168169 cbor = CBORObject .NewArray ();
169170 Object o = RandomObjects .RandomSmallIntegral (rand );
170- cbor .Add (ToObjectTest . TestToFromObjectRoundTrip ( o ) );
171+ cbor .Add (o );
171172 o = RandomObjects .RandomEInteger (rand );
172- cbor .Add (ToObjectTest . TestToFromObjectRoundTrip ( o ) );
173+ cbor .Add (o );
173174 } else {
174175 cbor = RandomCBORObject (rand , depth + 1 );
175176 }
176177 return CBORObject .FromObjectAndTag (cbor , tag );
177178 }
178179 }
179180
180- public static CBORObject RandomCBORArray (IRandomGenExtended rand , int depth ) {
181+ public static CBORObject RandomCBORArray (IRandomGenExtended rand , int
182+ depth ) {
181183 int x = rand .GetInt32 (100 );
182184 int count = (x < 80 ) ? 2 : ((x < 93 ) ? 1 : ((x < 98 ) ? 0 : 10 ));
183185 CBORObject cborRet = CBORObject .NewArray ();
@@ -206,10 +208,10 @@ public static CBORObject RandomCBORObject(IRandomGenExtended rand, int
206208 return rand .GetInt32 (2 ) == 0 ? CBORObject .Null :
207209 CBORObject .Undefined ;
208210 case 6 :
209- return ToObjectTest . TestToFromObjectRoundTrip (
211+ return CBORObject . FromObject (
210212 RandomObjects .RandomTextString (rand ));
211213 case 7 :
212- return ToObjectTest . TestToFromObjectRoundTrip (
214+ return CBORObject . FromObject (
213215 RandomObjects .RandomByteString (rand ));
214216 case 8 :
215217 return RandomCBORArray (rand , depth );
0 commit comments