@@ -11035,6 +11035,145 @@ public void TestFromJsonStringLongKindIntOrFloat2() {
1103511035 }
1103611036 }
1103711037
11038+ @ Test
11039+ public void TestRoundTripRegressions () {
11040+ {
11041+ CBOREncodeOptions options = new CBOREncodeOptions ("allowduplicatekeys=1;keepkeyorder=1" );
11042+ byte [] bytes = new byte [] {
11043+ (byte )0xba , 0x00 , 0x00 , 0x00 , 0x03 ,
11044+ (byte )0xf9 ,
11045+ (byte )0x83 , 0x1d ,
11046+ (byte )0xda ,
11047+ (byte )0xb6 ,
11048+ (byte )0xda , 0x50 , 0x56 , 0x1a , 0x50 ,
11049+ (byte )0xe3 , 0x2c , 0x7a , 0x16 ,
11050+ (byte )0xfa , 0x50 , 0x32 , 0x73 , 0x07 ,
11051+ (byte )0xfa , (byte )0xb9 , 0x2d , 0x73 , (byte )0xce , 0x38 , (byte )0xd0 ,
11052+ };
11053+ CBORTestCommon .AssertRoundTrip (CBORObject .DecodeFromBytes (bytes , options ));
11054+ }
11055+ {
11056+ CBOREncodeOptions options = new CBOREncodeOptions ("allowduplicatekeys=1;keepkeyorder=1" );
11057+ byte [] bytes = new byte [] {
11058+ (byte )0xbf ,
11059+ (byte )0x9f ,
11060+ (byte )0xbf , 0x39 , 0x20 ,
11061+ (byte )0x8f , 0x4a , 0x1f , 0x46 , 0x26 , 0x0b , 0x3e , 0x72 , 0x2c , 0x7f , 0x11 ,
11062+ 0x2e , 0x39 ,
11063+ (byte )0x9d ,
11064+ (byte )0xba , 0x1a , 0x11 ,
11065+ (byte )0x8d ,
11066+ (byte )0xc0 ,
11067+ (byte )0xb4 , 0x38 ,
11068+ (byte )0xb6 ,
11069+ (byte )0x9b , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x01 ,
11070+ (byte )0xd8 , 0x3b ,
11071+ (byte )0x99 , 0x00 , 0x02 , 0x3b , 0x05 ,
11072+ (byte )0xbb ,
11073+ (byte )0xea ,
11074+ (byte )0x8e , 0x4b ,
11075+ (byte )0xd3 , 0x5e , 0x22 ,
11076+ (byte )0x9f , 0x59 , 0x00 , 0x00 ,
11077+ (byte )0xbb , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x01 , 0x41 , 0x20 ,
11078+ (byte )0xbf , 0x1a , 0x00 , 0x00 , 0x00 , 0x61 ,
11079+ (byte )0xb9 , 0x00 , 0x01 , 0x1a , 0x00 , 0x00 , 0x00 , 0x0e ,
11080+ (byte )0xba , 0x00 , 0x00 , 0x00 , 0x00 ,
11081+ (byte )0xff ,
11082+ (byte )0xff ,
11083+ (byte )0xff ,
11084+ (byte )0xd8 , 0x22 ,
11085+ (byte )0xf8 ,
11086+ (byte )0x93 ,
11087+ (byte )0xd9 ,
11088+ (byte )0xaf , 0x33 , 0x19 ,
11089+ (byte )0xf0 ,
11090+ (byte )0xf0 ,
11091+ (byte )0xf9 ,
11092+ (byte )0x85 ,
11093+ (byte )0x93 ,
11094+ (byte )0x99 , 0x00 , 0x01 , 0x3a ,
11095+ (byte )0xb5 ,
11096+ (byte )0xfb , 0x4d , 0x43 ,
11097+ (byte )0x98 , 0x00 ,
11098+ (byte )0xff , (byte )0xfa , (byte )0xb0 , (byte )0xb4 , (byte )0xdc , 0x6d ,
11099+ (byte )0xff ,
11100+ };
11101+ CBORTestCommon .AssertRoundTrip (CBORObject .DecodeFromBytes (bytes , options ));
11102+ }
11103+ {
11104+ CBOREncodeOptions options = new CBOREncodeOptions ("allowduplicatekeys=1;keepkeyorder=1" );
11105+ byte [] bytes = new byte [] {
11106+ (byte )0xdb , 0x0d ,
11107+ (byte )0xcb , 0x5d , 0x78 ,
11108+ (byte )0x92 ,
11109+ (byte )0xc2 ,
11110+ (byte )0xc7 , 0x2b ,
11111+ (byte )0xb9 , 0x00 , 0x02 , 0x39 ,
11112+ (byte )0xee ,
11113+ (byte )0xa0 , (byte )0xa0 , 0x1a , 0x0e , (byte )0xd9 , (byte )0xec , (byte )0xca ,
11114+ (byte )0xf2 ,
11115+ };
11116+ CBORTestCommon .AssertRoundTrip (CBORObject .DecodeFromBytes (bytes , options ));
11117+ }
11118+ {
11119+ CBOREncodeOptions options = new CBOREncodeOptions ("allowduplicatekeys=1;keepkeyorder=1" );
11120+ byte [] bytes = new byte [] {
11121+ (byte )0xbf ,
11122+ (byte )0xfb ,
11123+ (byte )0xb1 , 0x21 ,
11124+ (byte )0x93 ,
11125+ (byte )0x8c ,
11126+ (byte )0xc6 ,
11127+ (byte )0xf3 ,
11128+ (byte )0xcf ,
11129+ (byte )0xb7 , (byte )0xf8 , 0x76 , 0x18 , (byte )0xda , 0x39 , 0x60 , (byte )0xf4 ,
11130+ (byte )0xff ,
11131+ };
11132+ CBORTestCommon .AssertRoundTrip (CBORObject .DecodeFromBytes (bytes , options ));
11133+ }
11134+ {
11135+ CBOREncodeOptions options = new CBOREncodeOptions ("allowduplicatekeys=1;keepkeyorder=1" );
11136+ byte [] bytes = new byte [] {
11137+ (byte )0xbb , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
11138+ 0x00 , 0x02 , (byte )0xf0 , 0x0d , 0x2a , 0x21 ,
11139+ };
11140+ CBORTestCommon .AssertRoundTrip (CBORObject .DecodeFromBytes (bytes , options ));
11141+ }
11142+ {
11143+ CBOREncodeOptions options = new CBOREncodeOptions ("allowduplicatekeys=1;keepkeyorder=1" );
11144+ byte [] bytes = new byte [] {
11145+ (byte )0xba , 0x00 , 0x00 , 0x00 , 0x02 ,
11146+ (byte )0xf9 , 0x48 , 0x37 ,
11147+ (byte )0xda ,
11148+ (byte )0xb5 , 0x72 ,
11149+ (byte )0xcf ,
11150+ (byte )0xf8 , 0x31 , 0x3b , 0x06 , 0x78 ,
11151+ (byte )0xdb , 0x44 , 0x7d , (byte )0xba , (byte )0xbd , 0x7d , 0x39 , (byte )0x98 ,
11152+ (byte )0xb9 ,
11153+ };
11154+ CBORTestCommon .AssertRoundTrip (CBORObject .DecodeFromBytes (bytes , options ));
11155+ }
11156+ }
11157+ @ Test
11158+ public void TestMapCompareRegressions () {
11159+ CBORObject m1 , m2 ;
11160+ m1 = CBORObject .NewMap ().Add (3 , 4 ).Add (1 , 2 );
11161+ m2 = CBORObject .NewOrderedMap ().Add (3 , 4 ).Add (1 , 2 );
11162+ Assert .assertEquals (0 , m1 .compareTo (m2 ));
11163+ TestCommon .CompareTestEqualAndConsistent (m1 , m2 );
11164+ m1 = CBORObject .NewMap ().Add (3 , 2 ).Add (1 , 2 );
11165+ m2 = CBORObject .NewOrderedMap ().Add (3 , 4 ).Add (1 , 2 );
11166+ TestCommon .CompareTestLess (m1 , m2 );
11167+ m1 = CBORObject .NewMap ().Add (3 , 7 ).Add (1 , 2 );
11168+ m2 = CBORObject .NewOrderedMap ().Add (3 , 4 ).Add (1 , 2 );
11169+ TestCommon .CompareTestGreater (m1 , m2 );
11170+ m1 = CBORObject .NewMap ().Add (3 , 4 ).Add (1 , 0 );
11171+ m2 = CBORObject .NewOrderedMap ().Add (3 , 4 ).Add (1 , 2 );
11172+ TestCommon .CompareTestLess (m1 , m2 );
11173+ m1 = CBORObject .NewMap ().Add (3 , 4 ).Add (1 , 7 );
11174+ m2 = CBORObject .NewOrderedMap ().Add (3 , 4 ).Add (1 , 2 );
11175+ TestCommon .CompareTestGreater (m1 , m2 );
11176+ }
1103811177 @ Test
1103911178 public void TestToObject_TypeMapper () {
1104011179 CBORTypeMapper mapper = new CBORTypeMapper ()
0 commit comments