mirror of
https://github.com/brl/mutter.git
synced 2024-11-29 19:40:43 -05:00
b5a7657076
This makes a start on porting the Cogl conformance tests that currently still live in the Clutter repository to be standalone Cogl tests that no longer require a ClutterStage. The main thing is that this commit brings in is the basic testing infrastructure we need, so now we can port more and more tests incrementally. Since the test suite wants a way to synchronize X requests/replies and we can't simply call XSynchronize in the test-utils code before we know if we are really running on X this adds a check for an environment variable named "COGL_X11_SYNC" in cogl-xlib-renderer.c and if it's set it forces XSynchronize (dpy, TRUE) to be called. By default the conformance tests are run off screen. This makes the tests run much faster and they also don't interfere with other work you may want to do by constantly stealing focus. CoglOnscreen framebuffers obviously don't get tested this way so it's important that the tests also get run on screen every once in a while, especially if changes are being made to CoglFramebuffer related code. On screen testing can be enabled by setting COGL_TEST_ONSCREEN=1 in your environment.
19 lines
494 B
C
19 lines
494 B
C
#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);
|
|
}
|
|
|