Files
mercury/tests/hard_coded/bitmap_bytes.exp
Julien Fischer 85a1eb5cf2 Access bytes in bitmaps as uint8s.
library/bitmap.m:
     Add functions for accessing bytes in bitmaps as uint8 values.

     Add predicates for setting bytes in bitmaps as uint8 values.

     Add a det version of from_string/1.

     Fix a typo in the description of is_empty/1.

tests/hard_coded/bitmap_bytes.{m,exp}:
     Extend this test to cover uint8 access to bitmaps.

NEWS:
     Announce the new predicates and functions.
2018-01-02 18:49:06 -05:00

56 lines
2.1 KiB
Plaintext

Bitmap:
^ byte(-1): bitmap.byte: byte index -1 is out of bounds [0, 0).
get_uint(-1): bitmap.get_uint8: byte index -1 is out of bounds [0, 0).
^ byte(0): bitmap.byte: byte index 0 is out of bounds [0, 0).
get_uint(0): bitmap.get_uint8: byte index 0 is out of bounds [0, 0).
^ byte(1): bitmap.byte: byte index 1 is out of bounds [0, 0).
get_uint(1): bitmap.get_uint8: byte index 1 is out of bounds [0, 0).
Bitmap: 00000000.00000000.00000000
^ byte(-1): bitmap.byte: byte index -1 is out of bounds [0, 3).
get_uint(-1): bitmap.get_uint8: byte index -1 is out of bounds [0, 3).
^ byte(0): 0
get_uint(0): 0
^ byte(1): 0
get_uint(1): 0
^ byte(2): 0
get_uint(2): 0
^ byte(3): bitmap.byte: byte index 3 is out of bounds [0, 3).
get_uint(3): bitmap.get_uint8: byte index 3 is out of bounds [0, 3).
^ byte(4): bitmap.byte: byte index 4 is out of bounds [0, 3).
get_uint(4): bitmap.get_uint8: byte index 4 is out of bounds [0, 3).
Bitmap: 00000000.00000000.0
^ byte(-1): bitmap.byte: byte index -1 is out of bounds [0, 2).
get_uint(-1): bitmap.get_uint8: byte index -1 is out of bounds [0, 2).
^ byte(0): 0
get_uint(0): 0
^ byte(1): 0
get_uint(1): 0
^ byte(2): bitmap.byte: byte index 2 is out of bounds [0, 2).
get_uint(2): bitmap.get_uint8: byte index 2 is out of bounds [0, 2).
^ byte(3): bitmap.byte: byte index 3 is out of bounds [0, 2).
get_uint(3): bitmap.get_uint8: byte index 3 is out of bounds [0, 2).
Bitmap: 11111111.00000000.11111111
^ byte(-1): bitmap.byte: byte index -1 is out of bounds [0, 3).
get_uint(-1): bitmap.get_uint8: byte index -1 is out of bounds [0, 3).
^ byte(0): 255
get_uint(0): 255
^ byte(1): 0
get_uint(1): 0
^ byte(2): 255
get_uint(2): 255
^ byte(3): bitmap.byte: byte index 3 is out of bounds [0, 3).
get_uint(3): bitmap.get_uint8: byte index 3 is out of bounds [0, 3).
Bitmap: 11110000.00001111
^ byte(-1): bitmap.byte: byte index -1 is out of bounds [0, 2).
get_uint(-1): bitmap.get_uint8: byte index -1 is out of bounds [0, 2).
^ byte(0): 240
get_uint(0): 240
^ byte(1): 15
get_uint(1): 15
^ byte(2): bitmap.byte: byte index 2 is out of bounds [0, 2).
get_uint(2): bitmap.get_uint8: byte index 2 is out of bounds [0, 2).