[mutter] tests/cogl: Migrate pixel buffer tests



commit 6c8b12c4deed34847cc9bbef247fbfe5e5de1d76
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Thu Aug 4 19:47:53 2022 +0200

    tests/cogl: Migrate pixel buffer tests
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>

 cogl/tests/conform/meson.build                            |  1 -
 cogl/tests/conform/test-conform-main.c                    |  3 ---
 cogl/tests/conform/test-declarations.h                    |  3 ---
 src/tests/cogl/conform/meson.build                        |  1 +
 .../tests => src/tests/cogl}/conform/test-pixel-buffer.c  | 15 ++++++++++-----
 5 files changed, 11 insertions(+), 12 deletions(-)
---
diff --git a/cogl/tests/conform/meson.build b/cogl/tests/conform/meson.build
index 40d122fcca..8a2b36e89c 100644
--- a/cogl/tests/conform/meson.build
+++ b/cogl/tests/conform/meson.build
@@ -1,6 +1,5 @@
 cogl_test_conformance_sources = [
   'test-conform-main.c',
-  'test-pixel-buffer.c',
   'test-premult.c',
   'test-snippets.c',
   'test-wrap-modes.c',
diff --git a/cogl/tests/conform/test-conform-main.c b/cogl/tests/conform/test-conform-main.c
index a19b9d873a..259658b116 100644
--- a/cogl/tests/conform/test-conform-main.c
+++ b/cogl/tests/conform/test-conform-main.c
@@ -69,9 +69,6 @@ main (int argc, char **argv)
   UNPORTED_TEST (test_multitexture);
   UNPORTED_TEST (test_texture_mipmaps);
   ADD_TEST (test_sub_texture, 0, 0);
-  ADD_TEST (test_pixel_buffer_map, 0, 0);
-  ADD_TEST (test_pixel_buffer_set_data, 0, 0);
-  ADD_TEST (test_pixel_buffer_sub_region, 0, 0);
   UNPORTED_TEST (test_texture_rectangle);
   ADD_TEST (test_wrap_modes, 0, 0);
   UNPORTED_TEST (test_texture_pixmap_x11);
diff --git a/cogl/tests/conform/test-declarations.h b/cogl/tests/conform/test-declarations.h
index fefc553c45..782d05c7d8 100644
--- a/cogl/tests/conform/test-declarations.h
+++ b/cogl/tests/conform/test-declarations.h
@@ -10,9 +10,6 @@ void test_layer_remove (void);
 void test_sparse_pipeline (void);
 void test_npot_texture (void);
 void test_sub_texture (void);
-void test_pixel_buffer_map (void);
-void test_pixel_buffer_set_data (void);
-void test_pixel_buffer_sub_region (void);
 void test_wrap_modes (void);
 void test_texture_get_set_data (void);
 void test_read_texture_formats (void);
diff --git a/src/tests/cogl/conform/meson.build b/src/tests/cogl/conform/meson.build
index be9c94e7e4..6540d84c33 100644
--- a/src/tests/cogl/conform/meson.build
+++ b/src/tests/cogl/conform/meson.build
@@ -8,6 +8,7 @@ cogl_tests = [
   'test-just-vertex-shader',
   'test-pipeline-user-matrix',
   'test-pipeline-uniforms',
+  'test-pixel-buffer',
 ]
 
 cogl_test_conformance_includes = [
diff --git a/cogl/tests/conform/test-pixel-buffer.c b/src/tests/cogl/conform/test-pixel-buffer.c
similarity index 96%
rename from cogl/tests/conform/test-pixel-buffer.c
rename to src/tests/cogl/conform/test-pixel-buffer.c
index fab66cab39..53799b1f0a 100644
--- a/cogl/tests/conform/test-pixel-buffer.c
+++ b/src/tests/cogl/conform/test-pixel-buffer.c
@@ -1,8 +1,7 @@
 #include <cogl/cogl.h>
 #include <string.h>
 
-#include "test-declarations.h"
-#include "test-utils.h"
+#include "tests/cogl-test-utils.h"
 
 #define BITMAP_SIZE 256
 
@@ -135,7 +134,7 @@ check_colours (uint32_t color0,
                            color3);
 }
 
-void
+static void
 test_pixel_buffer_map (void)
 {
   CoglBitmap *bitmap = create_and_fill_bitmap ();
@@ -163,7 +162,7 @@ test_pixel_buffer_map (void)
     g_print ("OK\n");
 }
 
-void
+static void
 test_pixel_buffer_set_data (void)
 {
   CoglBitmap *bitmap = create_bitmap ();
@@ -229,7 +228,7 @@ create_white_texture (void)
   return texture;
 }
 
-void
+static void
 test_pixel_buffer_sub_region (void)
 {
   CoglBitmap *bitmap = create_and_fill_bitmap ();
@@ -268,3 +267,9 @@ test_pixel_buffer_sub_region (void)
   if (cogl_test_verbose ())
     g_print ("OK\n");
 }
+
+COGL_TEST_SUITE (
+  g_test_add_func ("/pixel-buffer/map", test_pixel_buffer_map);
+  g_test_add_func ("/pixel-buffer/set-data", test_pixel_buffer_set_data);
+  g_test_add_func ("/pixel-buffer/sub-region", test_pixel_buffer_sub_region);
+)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]