tests/cogl: Migrate pixel buffer tests

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
This commit is contained in:
Jonas Ådahl 2022-08-04 19:47:53 +02:00 committed by Marge Bot
parent 9305f8d9d8
commit 6c8b12c4de
5 changed files with 11 additions and 12 deletions

View File

@ -1,6 +1,5 @@
cogl_test_conformance_sources = [ cogl_test_conformance_sources = [
'test-conform-main.c', 'test-conform-main.c',
'test-pixel-buffer.c',
'test-premult.c', 'test-premult.c',
'test-snippets.c', 'test-snippets.c',
'test-wrap-modes.c', 'test-wrap-modes.c',

View File

@ -69,9 +69,6 @@ main (int argc, char **argv)
UNPORTED_TEST (test_multitexture); UNPORTED_TEST (test_multitexture);
UNPORTED_TEST (test_texture_mipmaps); UNPORTED_TEST (test_texture_mipmaps);
ADD_TEST (test_sub_texture, 0, 0); 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); UNPORTED_TEST (test_texture_rectangle);
ADD_TEST (test_wrap_modes, 0, 0); ADD_TEST (test_wrap_modes, 0, 0);
UNPORTED_TEST (test_texture_pixmap_x11); UNPORTED_TEST (test_texture_pixmap_x11);

View File

@ -10,9 +10,6 @@ void test_layer_remove (void);
void test_sparse_pipeline (void); void test_sparse_pipeline (void);
void test_npot_texture (void); void test_npot_texture (void);
void test_sub_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_wrap_modes (void);
void test_texture_get_set_data (void); void test_texture_get_set_data (void);
void test_read_texture_formats (void); void test_read_texture_formats (void);

View File

@ -8,6 +8,7 @@ cogl_tests = [
'test-just-vertex-shader', 'test-just-vertex-shader',
'test-pipeline-user-matrix', 'test-pipeline-user-matrix',
'test-pipeline-uniforms', 'test-pipeline-uniforms',
'test-pixel-buffer',
] ]
cogl_test_conformance_includes = [ cogl_test_conformance_includes = [

View File

@ -1,8 +1,7 @@
#include <cogl/cogl.h> #include <cogl/cogl.h>
#include <string.h> #include <string.h>
#include "test-declarations.h" #include "tests/cogl-test-utils.h"
#include "test-utils.h"
#define BITMAP_SIZE 256 #define BITMAP_SIZE 256
@ -135,7 +134,7 @@ check_colours (uint32_t color0,
color3); color3);
} }
void static void
test_pixel_buffer_map (void) test_pixel_buffer_map (void)
{ {
CoglBitmap *bitmap = create_and_fill_bitmap (); CoglBitmap *bitmap = create_and_fill_bitmap ();
@ -163,7 +162,7 @@ test_pixel_buffer_map (void)
g_print ("OK\n"); g_print ("OK\n");
} }
void static void
test_pixel_buffer_set_data (void) test_pixel_buffer_set_data (void)
{ {
CoglBitmap *bitmap = create_bitmap (); CoglBitmap *bitmap = create_bitmap ();
@ -229,7 +228,7 @@ create_white_texture (void)
return texture; return texture;
} }
void static void
test_pixel_buffer_sub_region (void) test_pixel_buffer_sub_region (void)
{ {
CoglBitmap *bitmap = create_and_fill_bitmap (); CoglBitmap *bitmap = create_and_fill_bitmap ();
@ -268,3 +267,9 @@ test_pixel_buffer_sub_region (void)
if (cogl_test_verbose ()) if (cogl_test_verbose ())
g_print ("OK\n"); 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);
)