From 1f0e8fb23c037fe686b286318ea254eeba71efe3 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Tue, 22 Sep 2020 09:58:11 -0300 Subject: [PATCH] cogl/tests: Remove euler test Next commits, and this patchset in general, will make this patchset obsolete, since it'll only test graphene types against each other. If at all useful, the Euler test should be moved to graphene. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439 --- cogl/tests/conform/meson.build | 1 - cogl/tests/conform/test-conform-main.c | 1 - cogl/tests/conform/test-declarations.h | 1 - cogl/tests/conform/test-euler.c | 63 -------------------------- 4 files changed, 66 deletions(-) delete mode 100644 cogl/tests/conform/test-euler.c diff --git a/cogl/tests/conform/meson.build b/cogl/tests/conform/meson.build index eb4e4b599..b278dfd9c 100644 --- a/cogl/tests/conform/meson.build +++ b/cogl/tests/conform/meson.build @@ -25,7 +25,6 @@ cogl_test_conformance_sources = [ 'test-point-sprite.c', 'test-no-gl-header.c', 'test-version.c', - 'test-euler.c', 'test-layer-remove.c', 'test-alpha-test.c', 'test-map-buffer-range.c', diff --git a/cogl/tests/conform/test-conform-main.c b/cogl/tests/conform/test-conform-main.c index e1f32c5e2..c3619aa3c 100644 --- a/cogl/tests/conform/test-conform-main.c +++ b/cogl/tests/conform/test-conform-main.c @@ -132,7 +132,6 @@ main (int argc, char **argv) UNPORTED_TEST (test_viewport); - ADD_TEST (test_euler, 0, 0); ADD_TEST (test_color_hsl, 0, 0); ADD_TEST (test_fence, TEST_REQUIREMENT_FENCE, 0); diff --git a/cogl/tests/conform/test-declarations.h b/cogl/tests/conform/test-declarations.h index 850d59f0f..50052cd1e 100644 --- a/cogl/tests/conform/test-declarations.h +++ b/cogl/tests/conform/test-declarations.h @@ -44,7 +44,6 @@ void test_pipeline_shader_state (void); void test_gles2_context (void); void test_gles2_context_fbo (void); void test_gles2_context_copy_tex_image (void); -void test_euler (void); void test_color_hsl (void); void test_fence (void); void test_texture_no_allocate (void); diff --git a/cogl/tests/conform/test-euler.c b/cogl/tests/conform/test-euler.c deleted file mode 100644 index a99576abe..000000000 --- a/cogl/tests/conform/test-euler.c +++ /dev/null @@ -1,63 +0,0 @@ -#include -#include -#include - -#include "test-declarations.h" -#include "test-utils.h" - -/* Macros are used here instead of functions so that the - * g_assert_cmpfloat will give a more interesting message when it - * fails */ - -#define COMPARE_FLOATS(a, b) \ - do { \ - if (fabsf ((a) - (b)) >= 0.0001f) \ - g_assert_cmpfloat ((a), ==, (b)); \ - } while (0) - -#define COMPARE_ELEMENT(a, b, idx) \ - do { \ - COMPARE_FLOATS (a[idx], b[idx]); \ - } while (0) - -#define COMPARE_MATRICES(a, b) \ - do { \ - const float *af = cogl_matrix_get_array (a);\ - const float *bf = cogl_matrix_get_array (b);\ - int i; \ - \ - for (i = 0; i < 16; i++) \ - COMPARE_ELEMENT (af, bf, i); \ - } while (0) - -void -test_euler (void) -{ - graphene_euler_t euler; - CoglMatrix matrix_a, matrix_b; - - /* Try doing the rotation with three separate rotations */ - cogl_matrix_init_identity (&matrix_a); - cogl_matrix_rotate (&matrix_a, -30.0f, 0.0f, 1.0f, 0.0f); - cogl_matrix_rotate (&matrix_a, 40.0f, 1.0f, 0.0f, 0.0f); - cogl_matrix_rotate (&matrix_a, 50.0f, 0.0f, 0.0f, 1.0f); - - /* And try the same rotation with a euler */ - graphene_euler_init_with_order (&euler, 40, -30, 50, GRAPHENE_EULER_ORDER_RYXZ); - cogl_matrix_init_from_euler (&matrix_b, &euler); - - /* Verify that the matrices are approximately the same */ - COMPARE_MATRICES (&matrix_a, &matrix_b); - - /* Try applying the rotation from a euler to a framebuffer */ - cogl_framebuffer_identity_matrix (test_fb); - cogl_framebuffer_rotate_euler (test_fb, &euler); - memset (&matrix_b, 0, sizeof (matrix_b)); - cogl_framebuffer_get_modelview_matrix (test_fb, &matrix_b); - COMPARE_MATRICES (&matrix_a, &matrix_b); - - /* FIXME: This needs a lot more tests! */ - - if (cogl_test_verbose ()) - g_print ("OK\n"); -}