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



commit ae0f6c549fc5f5fe0da96d0e367c3cd2507cc533
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Fri Aug 5 11:02:25 2022 +0200

    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>

 cogl/cogl/cogl-pipeline-state.c                    | 35 -----------------
 src/tests/cogl/unit/meson.build                    |  1 +
 .../cogl/unit/test-pipeline-state-known-failure.c  | 45 ++++++++++++++++++++++
 3 files changed, 46 insertions(+), 35 deletions(-)
---
diff --git a/cogl/cogl/cogl-pipeline-state.c b/cogl/cogl/cogl-pipeline-state.c
index ecfc4cd3bb..8408a4af9e 100644
--- a/cogl/cogl/cogl-pipeline-state.c
+++ b/cogl/cogl/cogl-pipeline-state.c
@@ -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);
-}
diff --git a/src/tests/cogl/unit/meson.build b/src/tests/cogl/unit/meson.build
index b5571b7ade..1158c33497 100644
--- a/src/tests/cogl/unit/meson.build
+++ b/src/tests/cogl/unit/meson.build
@@ -1,6 +1,7 @@
 cogl_unit_tests = [
   ['test-bitmask', true],
   ['test-pipeline-cache', true],
+  ['test-pipeline-state-known-failure', false],
 ]
 
 test_env = environment()
diff --git a/src/tests/cogl/unit/test-pipeline-state-known-failure.c 
b/src/tests/cogl/unit/test-pipeline-state-known-failure.c
new file mode 100644
index 0000000000..593d8b98c2
--- /dev/null
+++ b/src/tests/cogl/unit/test-pipeline-state-known-failure.c
@@ -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);
+)


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