summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorljfa-ag <ljfa-ag@web.de>2015-07-28 20:03:40 +0200
committerljfa-ag <ljfa-ag@web.de>2015-07-28 20:27:02 +0200
commit9d4d2455a4a562f0883c73ec8e87c469d38069e5 (patch)
treed49e23043c3dcf731202b0be9f8b01c96d62dc3a /test
parent1d51c9a541361693e5d7113f8bef47c63a246436 (diff)
downloadProject-Tick-9d4d2455a4a562f0883c73ec8e87c469d38069e5.tar.gz
Project-Tick-9d4d2455a4a562f0883c73ec8e87c469d38069e5.zip
Implement endian stream i/o for double
Diffstat (limited to 'test')
-rw-r--r--test/endian_str_test.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/endian_str_test.cpp b/test/endian_str_test.cpp
index 37cee685a5..873cf0276d 100644
--- a/test/endian_str_test.cpp
+++ b/test/endian_str_test.cpp
@@ -140,12 +140,16 @@ void test_float()
//We will be assuming IEEE 754 here
write_little(str, fconst);
+ write_little(str, dconst);
write_big (str, fconst);
+ write_big (str, dconst);
const char expected[] = {
'\x01', '\xEF', '\xCD', '\xAB',
+ '\x05', '\x04', '\x03', '\x02', '\x01', '\xEF', '\xCD', '\xAB',
'\xAB', '\xCD', '\xEF', '\x01',
+ '\xAB', '\xCD', '\xEF', '\x01', '\x02', '\x03', '\x04', '\x05',
0}; //Null terminator
ASSERT(str.str() == expected);
@@ -154,9 +158,13 @@ void test_float()
read_little(str, f);
ASSERT(f == fconst);
+ read_little(str, d);
+ ASSERT(d == dconst);
read_big(str, f);
ASSERT(f == fconst);
+ read_big(str, d);
+ ASSERT(d == dconst);
ASSERT(str); //Check if stream has failed
}