diff options
| author | Robert Norton | 2017-07-19 18:08:02 +0100 |
|---|---|---|
| committer | Robert Norton | 2017-07-19 18:08:02 +0100 |
| commit | 632b10c0d4b01dc1af8593b8ae1f088fbfd9e342 (patch) | |
| tree | ac566808213125670da5f4dc3d702fe663333f7e /src/test/lib/tests/test_oddments.sail | |
| parent | d8969b1f9631dc15d5fb6b3b33a4a69dbfb7358a (diff) | |
split library tests into separate files to avoid risk of sail compiler stack overflow.
Diffstat (limited to 'src/test/lib/tests/test_oddments.sail')
| -rw-r--r-- | src/test/lib/tests/test_oddments.sail | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/lib/tests/test_oddments.sail b/src/test/lib/tests/test_oddments.sail new file mode 100644 index 00000000..4c8fd086 --- /dev/null +++ b/src/test/lib/tests/test_oddments.sail @@ -0,0 +1,14 @@ +function unit test () = { + (* XXX this is weird, wrong type? + test_assert("is_one0", not(is_one(bitzero))); + test_assert("is_one1", is_one(bitone)); *) + + test_assert("signed-1", signed(0xf) == -1); + test_assert("signed0", signed(0x0) == 0); + test_assert("signed1", signed(0x1) == 1); + + test_assert("unsigned-1", unsigned(0xf) == 15); + test_assert("unsigned0", unsigned(0x0) == 0); + test_assert("unsigned1", unsigned(0x1) == 1); +} + |
