aboutsummaryrefslogtreecommitdiff
path: root/test/common
diff options
context:
space:
mode:
authorAdrian Astley2014-12-19 11:49:42 -0600
committerAdrian Astley2014-12-19 11:53:32 -0600
commita4685796ce2e876ec4025a1a084f8c3f4500af4e (patch)
tree393b1409b5e6109e4ee327525943ab0a4796f598 /test/common
parentc58f7146102be3aac2cef5d69bdceb109da3f09f (diff)
downloadscummvm-rg350-a4685796ce2e876ec4025a1a084f8c3f4500af4e.tar.gz
scummvm-rg350-a4685796ce2e876ec4025a1a084f8c3f4500af4e.tar.bz2
scummvm-rg350-a4685796ce2e876ec4025a1a084f8c3f4500af4e.zip
TEST: Add unit tests for uint64 reading
Diffstat (limited to 'test/common')
-rw-r--r--test/common/endian.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/common/endian.h b/test/common/endian.h
index cba7618c43..f083d1248c 100644
--- a/test/common/endian.h
+++ b/test/common/endian.h
@@ -10,6 +10,18 @@ class EndianTestSuite : public CxxTest::TestSuite
TS_ASSERT_EQUALS(MKTAG('A','B','C','D'), tag);
}
+ void test_READ_BE_UINT64() {
+ const char data[8] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF};
+ uint64 value = READ_BE_UINT64(data);
+ TS_ASSERT_EQUALS(value, 0x123456789ABCDEFFULL);
+ }
+
+ void test_READ_LE_UINT64() {
+ const char data[8] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF};
+ uint64 value = READ_LE_UINT64(data);
+ TS_ASSERT_EQUALS(value, 0xFFEDCBA978563412ULL);
+ }
+
void test_READ_BE_UINT32() {
const char data[4] = { 0x12, 0x34, 0x56, 0x78 };
uint32 value = READ_BE_UINT32(data);