File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1604,6 +1604,31 @@ mod tests {
16041604 ) ;
16051605 }
16061606
1607+ #[ test]
1608+ fn bitfields_u128 ( ) {
1609+ let bytes = [
1610+ 0 , // index
1611+ 2 , // timestamp
1612+ 0b1110_0101 , // 120..127
1613+ 0b1110_0101 , // 112..119
1614+ 0b0000_0000 , // 104..111
1615+ 0b0000_0000 , // 96..103
1616+ 0b0000_0000 , // 88..95
1617+ 0b0000_0000 , // 80..87
1618+ 0b0000_0000 , // 72..79
1619+ 0b0000_0000 , // 64..71
1620+ 0b0000_0000 , // 56..63
1621+ 0b0000_0000 , // 48..55
1622+ 0b0000_0000 , // 40..47
1623+ 0b0000_0000 , // 32..39
1624+ 0b0000_0000 , // 24..31
1625+ 0b0000_0000 , // 16..23
1626+ 0b0000_0000 , // 8..15
1627+ 0b0000_0000 , // 0..7
1628+ ] ;
1629+ decode_and_expect ( "x: {0=119..124:b}" , & bytes, "0.000002 INFO x: 0b1011" ) ;
1630+ }
1631+
16071632 #[ test]
16081633 fn slice ( ) {
16091634 let bytes = [
Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ fn parse_range(mut s: &str) -> Option<(Range<u8>, usize /* consumed */)> {
127127 return None ;
128128 }
129129
130- if start >= 32 || end >= 32 {
130+ if start >= 128 || end >= 128 {
131131 return None ;
132132 }
133133
@@ -886,10 +886,10 @@ mod tests {
886886 assert ! ( parse( "{=0..0}" , ParserMode :: Strict ) . is_err( ) ) ;
887887 // start > end
888888 assert ! ( parse( "{=1..0}" , ParserMode :: Strict ) . is_err( ) ) ;
889- // out of 32 -bit range
890- assert ! ( parse( "{=0..32 }" , ParserMode :: Strict ) . is_err( ) ) ;
891- // just inside 32 -bit range
892- assert ! ( parse( "{=0..31 }" , ParserMode :: Strict ) . is_ok( ) ) ;
889+ // out of 128 -bit range
890+ assert ! ( parse( "{=0..128 }" , ParserMode :: Strict ) . is_err( ) ) ;
891+ // just inside 128 -bit range
892+ assert ! ( parse( "{=0..127 }" , ParserMode :: Strict ) . is_ok( ) ) ;
893893
894894 // missing parts
895895 assert ! ( parse( "{=0..4" , ParserMode :: Strict ) . is_err( ) ) ;
You can’t perform that action at this time.
0 commit comments