aboutsummaryrefslogtreecommitdiffstats
path: root/unpack_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'unpack_test.c')
-rw-r--r--unpack_test.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/unpack_test.c b/unpack_test.c
index 66d2117..1d7ea4c 100644
--- a/unpack_test.c
+++ b/unpack_test.c
@@ -50,6 +50,20 @@ TEST(simple0_float, "simple unpack float")
return true;
}
+TEST(simple0_double, "simple unpack double")
+{
+ double v[1] = { __LINE__ };
+
+ CHECK_UNPACK(DATA(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00), "d", &v);
+ CHECK_EQUAL("f", v[0], 0.0f);
+ CHECK_UNPACK(DATA(0x3f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00), "d", &v);
+ CHECK_EQUAL("f", v[0], 1.0f);
+ CHECK_UNPACK(DATA(0x40, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00), "d", &v);
+ CHECK_EQUAL("f", v[0], 8.0f);
+
+ return true;
+}
+
int main(void)
{
extern struct test __start_tests, __stop_tests;