summaryrefslogtreecommitdiff
path: root/cogl/tests/conform/test-fixed.c
diff options
context:
space:
mode:
Diffstat (limited to 'cogl/tests/conform/test-fixed.c')
-rw-r--r--cogl/tests/conform/test-fixed.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/cogl/tests/conform/test-fixed.c b/cogl/tests/conform/test-fixed.c
new file mode 100644
index 000000000..175b2d195
--- /dev/null
+++ b/cogl/tests/conform/test-fixed.c
@@ -0,0 +1,18 @@
+#include <stdio.h>
+#include <clutter/clutter.h>
+
+#include "test-conform-common.h"
+
+void
+test_fixed (TestUtilsGTestFixture *fixture,
+ void *data)
+{
+ g_assert_cmpint (COGL_FIXED_1, ==, COGL_FIXED_FROM_FLOAT (1.0));
+ g_assert_cmpint (COGL_FIXED_1, ==, COGL_FIXED_FROM_INT (1));
+
+ g_assert_cmpint (COGL_FIXED_0_5, ==, COGL_FIXED_FROM_FLOAT (0.5));
+
+ g_assert_cmpfloat (COGL_FIXED_TO_FLOAT (COGL_FIXED_1), ==, 1.0);
+ g_assert_cmpfloat (COGL_FIXED_TO_FLOAT (COGL_FIXED_0_5), ==, 0.5);
+}
+