cogl/pipeline-state: Move out failing test to its own file

This test is a known failure, so mark it as such. It's stored in its own
file since keeping it in the same as the passing test isn't markable
using meson.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
This commit is contained in:
Jonas Ådahl 2022-08-05 11:02:25 +02:00 committed by Marge Bot
parent 57382b6aff
commit ae0f6c549f
3 changed files with 46 additions and 35 deletions

View File

@ -1624,38 +1624,3 @@ UNIT_TEST (check_blend_constant_ancestry,
cogl_object_unref (pipeline);
}
UNIT_TEST (check_uniform_ancestry,
0 /* no requirements */,
TEST_KNOWN_FAILURE)
{
CoglPipeline *pipeline = cogl_pipeline_new (test_ctx);
CoglNode *node;
int pipeline_length = 0;
int i;
/* Repeatedly making a copy of a pipeline and changing a uniform
* shouldn't cause a long chain of pipelines to be created */
for (i = 0; i < 20; i++)
{
CoglPipeline *tmp_pipeline;
int uniform_location;
tmp_pipeline = cogl_pipeline_copy (pipeline);
cogl_object_unref (pipeline);
pipeline = tmp_pipeline;
uniform_location =
cogl_pipeline_get_uniform_location (pipeline, "a_uniform");
cogl_pipeline_set_uniform_1i (pipeline, uniform_location, i);
}
for (node = (CoglNode *) pipeline; node; node = node->parent)
pipeline_length++;
g_assert_cmpint (pipeline_length, <=, 2);
cogl_object_unref (pipeline);
}

View File

@ -1,6 +1,7 @@
cogl_unit_tests = [
['test-bitmask', true],
['test-pipeline-cache', true],
['test-pipeline-state-known-failure', false],
]
test_env = environment()

View File

@ -0,0 +1,45 @@
#include "cogl-config.h"
#include "cogl/cogl.h"
#include "cogl/cogl-pipeline-state.h"
#include "tests/cogl-test-utils.h"
static void
test_pipeline_state_uniform_ancestry (void)
{
CoglPipeline *pipeline;
CoglNode *node;
int pipeline_length = 0;
int i;
pipeline = cogl_pipeline_new (test_ctx);
/* Repeatedly making a copy of a pipeline and changing a uniform
* shouldn't cause a long chain of pipelines to be created */
for (i = 0; i < 20; i++)
{
CoglPipeline *tmp_pipeline;
int uniform_location;
tmp_pipeline = cogl_pipeline_copy (pipeline);
cogl_object_unref (pipeline);
pipeline = tmp_pipeline;
uniform_location =
cogl_pipeline_get_uniform_location (pipeline, "a_uniform");
cogl_pipeline_set_uniform_1i (pipeline, uniform_location, i);
}
for (node = (CoglNode *) pipeline; node; node = node->parent)
pipeline_length++;
g_assert_cmpint (pipeline_length, <=, 2);
cogl_object_unref (pipeline);
}
COGL_TEST_SUITE (
g_test_add_func ("/pipeline-state/uniform-ancestry", test_pipeline_state_uniform_ancestry);
)