File tree 2 files changed +34
-0
lines changed
2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -915,6 +915,21 @@ static REBCNT EncodedU32_Size(u32 value) {
915
915
}
916
916
n ++ ;
917
917
break ;
918
+ case SYM_BITSET8 :
919
+ n = 1 ;
920
+ goto readBitsetN ;
921
+ case SYM_BITSET16 :
922
+ n = 2 ;
923
+ goto readBitsetN ;
924
+ case SYM_BITSET32 :
925
+ n = 4 ;
926
+ readBitsetN :
927
+ ASSERT_READ_SIZE (value , cp , ep , n );
928
+ VAL_SET (temp , REB_BITSET );
929
+ bin_new = Copy_Series_Part (bin , VAL_INDEX (buffer_read ), n );
930
+ VAL_SERIES (temp ) = bin_new ;
931
+ VAL_INDEX (temp ) = 0 ;
932
+ break ;
918
933
case SYM_ENCODEDU32 :
919
934
ASSERT_READ_SIZE (value , cp , ep , 1 );
920
935
u = (u64 )cp [0 ];
Original file line number Diff line number Diff line change @@ -244,6 +244,25 @@ is-protected-error?: func[code][
244
244
--assert [0 1 128 129 130 2214768806 ] = binary/read b [
245
245
EncodedU32 EncodedU32 EncodedU32 EncodedU32 EncodedU32 EncodedU32]
246
246
247
+ --test-- "BinCode - BITSET8, BITSET16, BITSET32 (read)"
248
+ binary/read #{ 81800180000001 } [
249
+ f8: BITSET8
250
+ f16: BITSET16
251
+ f32: BITSET32
252
+ ]
253
+ --assert all [
254
+ all [f8/0 f8/7 ]
255
+ not any [f8/1 f8/2 f8/3 f8/4 f8/5 f8/6 ]
256
+ ]
257
+ --assert all [
258
+ all [f16/0 f16/15 ]
259
+ not any [f16/1 f16/2 f16/3 f16/4 f16/5 f16/6 f16/7 ]
260
+ ]
261
+ --assert all [
262
+ all [f32/0 f32/31 ]
263
+ not any [f32/1 f32/2 f32/3 f32/4 f32/5 f32/6 f32/7 f32/15 ]
264
+ ]
265
+
247
266
===end-group===
248
267
249
268
You can’t perform that action at this time.
0 commit comments