tests/cogl: Migrate texture rg test

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
This commit is contained in:
Jonas Ådahl 2022-08-04 22:27:47 +02:00 committed by Marge Bot
parent e7f535a21d
commit 2b43ff5963
5 changed files with 13 additions and 7 deletions

View File

@ -1,6 +1,5 @@
cogl_test_conformance_sources = [
'test-conform-main.c',
'test-texture-rg.c',
'test-fence.c',
]

View File

@ -74,8 +74,6 @@ main (int argc, char **argv)
ADD_TEST (test_fence, TEST_REQUIREMENT_FENCE, 0);
ADD_TEST (test_texture_rg, TEST_REQUIREMENT_TEXTURE_RG, 0);
g_printerr ("Unknown test name \"%s\"\n", argv[1]);
return 1;

View File

@ -9,6 +9,5 @@ void test_gles2_context (void);
void test_gles2_context_fbo (void);
void test_gles2_context_copy_tex_image (void);
void test_fence (void);
void test_texture_rg (void);
#endif /* COGL_TEST_DECLARATIONS_H */

View File

@ -37,6 +37,7 @@ cogl_tests = [
[ 'test-pipeline-cache-unrefs-texture', [] ],
[ 'test-texture-no-allocate', [] ],
[ 'test-pipeline-shader-state', [] ],
[ 'test-texture-rg', [] ],
]
cogl_test_conformance_includes = [

View File

@ -2,8 +2,7 @@
#include <string.h>
#include "test-declarations.h"
#include "test-utils.h"
#include "tests/cogl-test-utils.h"
#define TEX_WIDTH 8
#define TEX_HEIGHT 8
@ -29,7 +28,7 @@ make_texture (void)
NULL);
}
void
static void
test_texture_rg (void)
{
CoglPipeline *pipeline;
@ -37,6 +36,12 @@ test_texture_rg (void)
int fb_width, fb_height;
int x, y;
if (!cogl_has_feature (test_ctx, COGL_FEATURE_ID_TEXTURE_RG))
{
g_test_skip ("Missing TEXTURE_RG feature");
return;
}
fb_width = cogl_framebuffer_get_width (test_fb);
fb_height = cogl_framebuffer_get_height (test_fb);
@ -73,3 +78,7 @@ test_texture_rg (void)
cogl_object_unref (pipeline);
cogl_object_unref (tex);
}
COGL_TEST_SUITE (
g_test_add_func ("/texture/rg", test_texture_rg);
)