summaryrefslogtreecommitdiff
path: root/tests/conform/test-fixed.c
blob: 78c3445314fa674d7a13e08c9eeee291063fa38a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stdio.h>
#include <clutter/clutter.h>

#include "test-conform-common.h"

void
test_cogl_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);
}