[gegl/wip/rishi/node-connect: 1/2] tests: Re-connecting connected nodes should not cause invalidation



commit 040300f7a162fea2f714329ff27f2d0447ade5cc
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Mar 4 18:55:20 2016 +0100

    tests: Re-connecting connected nodes should not cause invalidation
    
    https://bugzilla.gnome.org/show_bug.cgi?id=762987

 tests/simple/test-node-connections.c |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)
---
diff --git a/tests/simple/test-node-connections.c b/tests/simple/test-node-connections.c
index 7ff41ee..79085c8 100644
--- a/tests/simple/test-node-connections.c
+++ b/tests/simple/test-node-connections.c
@@ -13,6 +13,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright (C) 2013 Daniel Sabo
+ * Copyright (C) 2016 Red Hat, Inc.
  */
 
 #include "config.h"
@@ -21,6 +22,35 @@
 
 #include "gegl.h"
 
+static void
+already_connected_invalidated (gpointer user_data)
+{
+  gboolean *result = (gboolean *) user_data;
+  *result = FALSE;
+}
+
+static gboolean
+test_node_already_connected (void)
+{
+  gboolean result = TRUE;
+  GeglNode *ptn, *sink, *src;
+
+  ptn  = gegl_node_new ();
+  src  = gegl_node_new_child (ptn,
+                              "operation", "gegl:color",
+                              NULL);
+  sink = gegl_node_new_child (ptn,
+                              "operation", "gegl:nop",
+                              NULL);
+  gegl_node_link (src, sink);
+
+  g_signal_connect_swapped (sink, "invalidated", G_CALLBACK (already_connected_invalidated), &result);
+  gegl_node_link (src, sink);
+
+  g_object_unref (ptn);
+  return result;
+}
+
 static gboolean
 test_node_reconnect_many (void)
 {
@@ -100,6 +130,7 @@ int main(int argc, char **argv)
                "use-opencl", FALSE,
                NULL);
 
+  RUN_TEST (test_node_already_connected)
   RUN_TEST (test_node_reconnect_many)
 
   gegl_exit ();


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