mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 17:33:38 +00:00
Add expected outputs for big endian.
tests/hard_coded/read_binary_int16.exp2:
tests/hard_coded/read_binary_int32.exp2:
tests/hard_coded/read_binary_int64.exp2:
tests/hard_coded/read_binary_uint16.exp2:
tests/hard_coded/read_binary_uint32.exp2:
tests/hard_coded/read_binary_uint64.exp2:
Add expected outputs on big endian architectures.
tests/hard_coded/read_binary_int16.m:
tests/hard_coded/read_binary_int32.m:
tests/hard_coded/read_binary_int64.m:
tests/hard_coded/read_binary_uint16.m:
tests/hard_coded/read_binary_uint32.m:
tests/hard_coded/read_binary_uint64.m:
Document expected outputs.
This commit is contained in:
36
tests/hard_coded/read_binary_int16.exp2
Normal file
36
tests/hard_coded/read_binary_int16.exp2
Normal file
@@ -0,0 +1,36 @@
|
||||
================
|
||||
Input: []
|
||||
Result: EOF (read big-endian)
|
||||
================
|
||||
Input: [0u8]
|
||||
Result: Incomplete ([0u8]) (read big-endian)
|
||||
================
|
||||
Input: [1u8, 0u8] (LE: 1) (BE: 256)
|
||||
Result: 256i16 (read big-endian)
|
||||
================
|
||||
Input: [255u8, 0u8] (LE: 255) (BE: -256)
|
||||
Result: -256i16 (read big-endian)
|
||||
================
|
||||
Input: []
|
||||
Result: EOF (read little-endian)
|
||||
================
|
||||
Input: [0u8]
|
||||
Result: Incomplete ([0u8]) (read little-endian)
|
||||
================
|
||||
Input: [1u8, 0u8] (LE: 1) (BE: 256)
|
||||
Result: 1i16 (read little-endian)
|
||||
================
|
||||
Input: [255u8, 0u8] (LE: 255) (BE: -256)
|
||||
Result: 255i16 (read little-endian)
|
||||
================
|
||||
Input: []
|
||||
Result: EOF (read native byte order)
|
||||
================
|
||||
Input: [0u8]
|
||||
Result: Incomplete ([0u8]) (read native byte order)
|
||||
================
|
||||
Input: [1u8, 0u8] (LE: 1) (BE: 256)
|
||||
Result: 256i16 (read native byte order)
|
||||
================
|
||||
Input: [255u8, 0u8] (LE: 255) (BE: -256)
|
||||
Result: -256i16 (read native byte order)
|
||||
@@ -4,6 +4,9 @@
|
||||
%
|
||||
% Test reading of binary int16s.
|
||||
%
|
||||
% The .exp file is for little endian architectures.
|
||||
% The .exp2 file is for big endian architectures.
|
||||
%
|
||||
%---------------------------------------------------------------------------%
|
||||
|
||||
:- module read_binary_int16.
|
||||
|
||||
63
tests/hard_coded/read_binary_int32.exp2
Normal file
63
tests/hard_coded/read_binary_int32.exp2
Normal file
@@ -0,0 +1,63 @@
|
||||
================
|
||||
Input: []
|
||||
Result: EOF (read big-endian)
|
||||
================
|
||||
Input: [1u8]
|
||||
Result: Incomplete ([1u8]) (read big-endian)
|
||||
================
|
||||
Input: [1u8, 2u8]
|
||||
Result: Incomplete ([1u8, 2u8]) (read big-endian)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8]) (read big-endian)
|
||||
================
|
||||
Input: [0u8, 0u8, 0u8, 1u8] (LE: 16777216) (BE: 1)
|
||||
Result: 1i32 (read big-endian)
|
||||
================
|
||||
Input: [255u8, 0u8, 0u8, 0u8] (LE: 255) (BE: -16777216)
|
||||
Result: -16777216i32 (read big-endian)
|
||||
================
|
||||
Input: [1u8, 1u8, 0u8, 0u8] (LE: 257) (BE: 16842752)
|
||||
Result: 16842752i32 (read big-endian)
|
||||
================
|
||||
Input: []
|
||||
Result: EOF (read little-endian)
|
||||
================
|
||||
Input: [1u8]
|
||||
Result: Incomplete ([1u8]) (read little-endian)
|
||||
================
|
||||
Input: [1u8, 2u8]
|
||||
Result: Incomplete ([1u8, 2u8]) (read little-endian)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8]) (read little-endian)
|
||||
================
|
||||
Input: [0u8, 0u8, 0u8, 1u8] (LE: 16777216) (BE: 1)
|
||||
Result: 16777216i32 (read little-endian)
|
||||
================
|
||||
Input: [255u8, 0u8, 0u8, 0u8] (LE: 255) (BE: -16777216)
|
||||
Result: 255i32 (read little-endian)
|
||||
================
|
||||
Input: [1u8, 1u8, 0u8, 0u8] (LE: 257) (BE: 16842752)
|
||||
Result: 257i32 (read little-endian)
|
||||
================
|
||||
Input: []
|
||||
Result: EOF (read native byte order)
|
||||
================
|
||||
Input: [1u8]
|
||||
Result: Incomplete ([1u8]) (read native byte order)
|
||||
================
|
||||
Input: [1u8, 2u8]
|
||||
Result: Incomplete ([1u8, 2u8]) (read native byte order)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8]) (read native byte order)
|
||||
================
|
||||
Input: [0u8, 0u8, 0u8, 1u8] (LE: 16777216) (BE: 1)
|
||||
Result: 1i32 (read native byte order)
|
||||
================
|
||||
Input: [255u8, 0u8, 0u8, 0u8] (LE: 255) (BE: -16777216)
|
||||
Result: -16777216i32 (read native byte order)
|
||||
================
|
||||
Input: [1u8, 1u8, 0u8, 0u8] (LE: 257) (BE: 16842752)
|
||||
Result: 16842752i32 (read native byte order)
|
||||
@@ -4,6 +4,9 @@
|
||||
%
|
||||
% Test reading of binary int32s.
|
||||
%
|
||||
% The .exp file is for little endian architectures.
|
||||
% The .exp2 file is for big endian architectures.
|
||||
%
|
||||
%---------------------------------------------------------------------------%
|
||||
|
||||
:- module read_binary_int32.
|
||||
|
||||
108
tests/hard_coded/read_binary_int64.exp2
Normal file
108
tests/hard_coded/read_binary_int64.exp2
Normal file
@@ -0,0 +1,108 @@
|
||||
================
|
||||
Input: []
|
||||
Result: EOF (read big-endian)
|
||||
================
|
||||
Input: [1u8]
|
||||
Result: Incomplete ([1u8]) (read big-endian)
|
||||
================
|
||||
Input: [1u8, 2u8]
|
||||
Result: Incomplete ([1u8, 2u8]) (read big-endian)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8]) (read big-endian)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8, 4u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8, 4u8]) (read big-endian)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8, 4u8, 5u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8, 4u8, 5u8]) (read big-endian)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8, 4u8, 5u8, 6u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8, 4u8, 5u8, 6u8]) (read big-endian)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8, 4u8, 5u8, 7u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8, 4u8, 5u8, 7u8]) (read big-endian)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8, 4u8, 5u8, 7u8, 8u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8, 4u8, 5u8, 7u8, 8u8]) (read big-endian)
|
||||
================
|
||||
Input: [0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8] (LE: 72057594037927936) (BE: 1)
|
||||
Result: 1i64 (read big-endian)
|
||||
================
|
||||
Input: [255u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8] (LE: 255) (BE: -72057594037927936)
|
||||
Result: -72057594037927936i64 (read big-endian)
|
||||
================
|
||||
Input: [1u8, 1u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8] (LE: 257) (BE: 72339069014638592)
|
||||
Result: 72339069014638592i64 (read big-endian)
|
||||
================
|
||||
Input: []
|
||||
Result: EOF (read little-endian)
|
||||
================
|
||||
Input: [1u8]
|
||||
Result: Incomplete ([1u8]) (read little-endian)
|
||||
================
|
||||
Input: [1u8, 2u8]
|
||||
Result: Incomplete ([1u8, 2u8]) (read little-endian)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8]) (read little-endian)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8, 4u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8, 4u8]) (read little-endian)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8, 4u8, 5u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8, 4u8, 5u8]) (read little-endian)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8, 4u8, 5u8, 6u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8, 4u8, 5u8, 6u8]) (read little-endian)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8, 4u8, 5u8, 7u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8, 4u8, 5u8, 7u8]) (read little-endian)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8, 4u8, 5u8, 7u8, 8u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8, 4u8, 5u8, 7u8, 8u8]) (read little-endian)
|
||||
================
|
||||
Input: [0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8] (LE: 72057594037927936) (BE: 1)
|
||||
Result: 72057594037927936i64 (read little-endian)
|
||||
================
|
||||
Input: [255u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8] (LE: 255) (BE: -72057594037927936)
|
||||
Result: 255i64 (read little-endian)
|
||||
================
|
||||
Input: [1u8, 1u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8] (LE: 257) (BE: 72339069014638592)
|
||||
Result: 257i64 (read little-endian)
|
||||
================
|
||||
Input: []
|
||||
Result: EOF (read native byte order)
|
||||
================
|
||||
Input: [1u8]
|
||||
Result: Incomplete ([1u8]) (read native byte order)
|
||||
================
|
||||
Input: [1u8, 2u8]
|
||||
Result: Incomplete ([1u8, 2u8]) (read native byte order)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8]) (read native byte order)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8, 4u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8, 4u8]) (read native byte order)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8, 4u8, 5u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8, 4u8, 5u8]) (read native byte order)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8, 4u8, 5u8, 6u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8, 4u8, 5u8, 6u8]) (read native byte order)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8, 4u8, 5u8, 7u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8, 4u8, 5u8, 7u8]) (read native byte order)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8, 4u8, 5u8, 7u8, 8u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8, 4u8, 5u8, 7u8, 8u8]) (read native byte order)
|
||||
================
|
||||
Input: [0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8] (LE: 72057594037927936) (BE: 1)
|
||||
Result: 1i64 (read native byte order)
|
||||
================
|
||||
Input: [255u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8] (LE: 255) (BE: -72057594037927936)
|
||||
Result: -72057594037927936i64 (read native byte order)
|
||||
================
|
||||
Input: [1u8, 1u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8] (LE: 257) (BE: 72339069014638592)
|
||||
Result: 72339069014638592i64 (read native byte order)
|
||||
@@ -4,6 +4,9 @@
|
||||
%
|
||||
% Test reading of binary int64s.
|
||||
%
|
||||
% The .exp file is for little endian architectures.
|
||||
% The .exp2 file is for big endian architectures.
|
||||
%
|
||||
%---------------------------------------------------------------------------%
|
||||
|
||||
:- module read_binary_int64.
|
||||
|
||||
36
tests/hard_coded/read_binary_uint16.exp2
Normal file
36
tests/hard_coded/read_binary_uint16.exp2
Normal file
@@ -0,0 +1,36 @@
|
||||
================
|
||||
Input: []
|
||||
Result: EOF (read big-endian)
|
||||
================
|
||||
Input: [0u8]
|
||||
Result: Incomplete ([0u8]) (read big-endian)
|
||||
================
|
||||
Input: [1u8, 0u8] (LE: 1) (BE: 256)
|
||||
Result: 256u16 (read big-endian)
|
||||
================
|
||||
Input: [255u8, 0u8] (LE: 255) (BE: 65280)
|
||||
Result: 65280u16 (read big-endian)
|
||||
================
|
||||
Input: []
|
||||
Result: EOF (read little-endian)
|
||||
================
|
||||
Input: [0u8]
|
||||
Result: Incomplete ([0u8]) (read little-endian)
|
||||
================
|
||||
Input: [1u8, 0u8] (LE: 1) (BE: 256)
|
||||
Result: 1u16 (read little-endian)
|
||||
================
|
||||
Input: [255u8, 0u8] (LE: 255) (BE: 65280)
|
||||
Result: 255u16 (read little-endian)
|
||||
================
|
||||
Input: []
|
||||
Result: EOF (read native byte order)
|
||||
================
|
||||
Input: [0u8]
|
||||
Result: Incomplete ([0u8]) (read native byte order)
|
||||
================
|
||||
Input: [1u8, 0u8] (LE: 1) (BE: 256)
|
||||
Result: 256u16 (read native byte order)
|
||||
================
|
||||
Input: [255u8, 0u8] (LE: 255) (BE: 65280)
|
||||
Result: 65280u16 (read native byte order)
|
||||
@@ -4,6 +4,9 @@
|
||||
%
|
||||
% Test reading of binary uint16s.
|
||||
%
|
||||
% The .exp file is for little endian architectures.
|
||||
% The .exp2 file is for big endian architectures.
|
||||
%
|
||||
%---------------------------------------------------------------------------%
|
||||
|
||||
:- module read_binary_uint16.
|
||||
|
||||
63
tests/hard_coded/read_binary_uint32.exp2
Normal file
63
tests/hard_coded/read_binary_uint32.exp2
Normal file
@@ -0,0 +1,63 @@
|
||||
================
|
||||
Input: []
|
||||
Result: EOF (read big-endian)
|
||||
================
|
||||
Input: [1u8]
|
||||
Result: Incomplete ([1u8]) (read big-endian)
|
||||
================
|
||||
Input: [1u8, 2u8]
|
||||
Result: Incomplete ([1u8, 2u8]) (read big-endian)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8]) (read big-endian)
|
||||
================
|
||||
Input: [0u8, 0u8, 0u8, 1u8] (LE: 16777216) (BE: 1)
|
||||
Result: 1u32 (read big-endian)
|
||||
================
|
||||
Input: [255u8, 0u8, 0u8, 0u8] (LE: 255) (BE: 4278190080)
|
||||
Result: 4278190080u32 (read big-endian)
|
||||
================
|
||||
Input: [1u8, 1u8, 0u8, 0u8] (LE: 257) (BE: 16842752)
|
||||
Result: 16842752u32 (read big-endian)
|
||||
================
|
||||
Input: []
|
||||
Result: EOF (read little-endian)
|
||||
================
|
||||
Input: [1u8]
|
||||
Result: Incomplete ([1u8]) (read little-endian)
|
||||
================
|
||||
Input: [1u8, 2u8]
|
||||
Result: Incomplete ([1u8, 2u8]) (read little-endian)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8]) (read little-endian)
|
||||
================
|
||||
Input: [0u8, 0u8, 0u8, 1u8] (LE: 16777216) (BE: 1)
|
||||
Result: 16777216u32 (read little-endian)
|
||||
================
|
||||
Input: [255u8, 0u8, 0u8, 0u8] (LE: 255) (BE: 4278190080)
|
||||
Result: 255u32 (read little-endian)
|
||||
================
|
||||
Input: [1u8, 1u8, 0u8, 0u8] (LE: 257) (BE: 16842752)
|
||||
Result: 257u32 (read little-endian)
|
||||
================
|
||||
Input: []
|
||||
Result: EOF (read native byte order)
|
||||
================
|
||||
Input: [1u8]
|
||||
Result: Incomplete ([1u8]) (read native byte order)
|
||||
================
|
||||
Input: [1u8, 2u8]
|
||||
Result: Incomplete ([1u8, 2u8]) (read native byte order)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8]) (read native byte order)
|
||||
================
|
||||
Input: [0u8, 0u8, 0u8, 1u8] (LE: 16777216) (BE: 1)
|
||||
Result: 1u32 (read native byte order)
|
||||
================
|
||||
Input: [255u8, 0u8, 0u8, 0u8] (LE: 255) (BE: 4278190080)
|
||||
Result: 4278190080u32 (read native byte order)
|
||||
================
|
||||
Input: [1u8, 1u8, 0u8, 0u8] (LE: 257) (BE: 16842752)
|
||||
Result: 16842752u32 (read native byte order)
|
||||
@@ -4,6 +4,9 @@
|
||||
%
|
||||
% Test reading of binary uint32s.
|
||||
%
|
||||
% The .exp file is for little endian architectures.
|
||||
% The .exp2 file is for big endian architectures.
|
||||
%
|
||||
%---------------------------------------------------------------------------%
|
||||
|
||||
:- module read_binary_uint32.
|
||||
|
||||
108
tests/hard_coded/read_binary_uint64.exp2
Normal file
108
tests/hard_coded/read_binary_uint64.exp2
Normal file
@@ -0,0 +1,108 @@
|
||||
================
|
||||
Input: []
|
||||
Result: EOF (read big-endian)
|
||||
================
|
||||
Input: [1u8]
|
||||
Result: Incomplete ([1u8]) (read big-endian)
|
||||
================
|
||||
Input: [1u8, 2u8]
|
||||
Result: Incomplete ([1u8, 2u8]) (read big-endian)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8]) (read big-endian)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8, 4u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8, 4u8]) (read big-endian)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8, 4u8, 5u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8, 4u8, 5u8]) (read big-endian)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8, 4u8, 5u8, 6u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8, 4u8, 5u8, 6u8]) (read big-endian)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8, 4u8, 5u8, 7u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8, 4u8, 5u8, 7u8]) (read big-endian)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8, 4u8, 5u8, 7u8, 8u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8, 4u8, 5u8, 7u8, 8u8]) (read big-endian)
|
||||
================
|
||||
Input: [0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8] (LE: 72057594037927936) (BE: 1)
|
||||
Result: 1u64 (read big-endian)
|
||||
================
|
||||
Input: [255u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8] (LE: 255) (BE: 18374686479671623680)
|
||||
Result: 18374686479671623680u64 (read big-endian)
|
||||
================
|
||||
Input: [1u8, 1u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8] (LE: 257) (BE: 72339069014638592)
|
||||
Result: 72339069014638592u64 (read big-endian)
|
||||
================
|
||||
Input: []
|
||||
Result: EOF (read little-endian)
|
||||
================
|
||||
Input: [1u8]
|
||||
Result: Incomplete ([1u8]) (read little-endian)
|
||||
================
|
||||
Input: [1u8, 2u8]
|
||||
Result: Incomplete ([1u8, 2u8]) (read little-endian)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8]) (read little-endian)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8, 4u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8, 4u8]) (read little-endian)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8, 4u8, 5u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8, 4u8, 5u8]) (read little-endian)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8, 4u8, 5u8, 6u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8, 4u8, 5u8, 6u8]) (read little-endian)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8, 4u8, 5u8, 7u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8, 4u8, 5u8, 7u8]) (read little-endian)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8, 4u8, 5u8, 7u8, 8u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8, 4u8, 5u8, 7u8, 8u8]) (read little-endian)
|
||||
================
|
||||
Input: [0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8] (LE: 72057594037927936) (BE: 1)
|
||||
Result: 72057594037927936u64 (read little-endian)
|
||||
================
|
||||
Input: [255u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8] (LE: 255) (BE: 18374686479671623680)
|
||||
Result: 255u64 (read little-endian)
|
||||
================
|
||||
Input: [1u8, 1u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8] (LE: 257) (BE: 72339069014638592)
|
||||
Result: 257u64 (read little-endian)
|
||||
================
|
||||
Input: []
|
||||
Result: EOF (read native byte order)
|
||||
================
|
||||
Input: [1u8]
|
||||
Result: Incomplete ([1u8]) (read native byte order)
|
||||
================
|
||||
Input: [1u8, 2u8]
|
||||
Result: Incomplete ([1u8, 2u8]) (read native byte order)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8]) (read native byte order)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8, 4u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8, 4u8]) (read native byte order)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8, 4u8, 5u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8, 4u8, 5u8]) (read native byte order)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8, 4u8, 5u8, 6u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8, 4u8, 5u8, 6u8]) (read native byte order)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8, 4u8, 5u8, 7u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8, 4u8, 5u8, 7u8]) (read native byte order)
|
||||
================
|
||||
Input: [1u8, 2u8, 3u8, 4u8, 5u8, 7u8, 8u8]
|
||||
Result: Incomplete ([1u8, 2u8, 3u8, 4u8, 5u8, 7u8, 8u8]) (read native byte order)
|
||||
================
|
||||
Input: [0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8] (LE: 72057594037927936) (BE: 1)
|
||||
Result: 1u64 (read native byte order)
|
||||
================
|
||||
Input: [255u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8] (LE: 255) (BE: 18374686479671623680)
|
||||
Result: 18374686479671623680u64 (read native byte order)
|
||||
================
|
||||
Input: [1u8, 1u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8] (LE: 257) (BE: 72339069014638592)
|
||||
Result: 72339069014638592u64 (read native byte order)
|
||||
@@ -4,6 +4,9 @@
|
||||
%
|
||||
% Test reading of binary uint64s.
|
||||
%
|
||||
% The .exp file is for little endian architectures.
|
||||
% The .exp2 file is for big endian architectures.
|
||||
%
|
||||
%---------------------------------------------------------------------------%
|
||||
|
||||
:- module read_binary_uint64.
|
||||
|
||||
Reference in New Issue
Block a user