8 let make_bits i n j m k = (
9 let pad1 = ones_bitstring (n-8) in
10 let pad2 = ones_bitstring (m-n-8) in
13 pad1 : n-8 : bitstring;
14 j : 8; (* this should be at offset(n) *)
15 pad2 : m-n-8 : bitstring;
16 k : 8 (* this should be at offset(m) *)
20 let test_bits bits i n j m k =
24 k' : 8 : offset(m) } when i = i' && j = j' && k = k' -> () (* ok *)
26 failwith (sprintf "60_simple_offset: test_bits: failed %d %d %d %d %d"
32 List.iter (fun (i,j,k) -> test_bits (make_bits i n j m k) i n j m k)
33 [0x55, 0xaa, 0x33; 0x33, 0xaa, 0x55; 0x12, 0x34, 0x56]