[gegl] tests: Sources shouldn't be invalidated when connecting & disconnecting



commit 889d0fd8f8c8bea47c93a1c24cd4964483c98e79
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Mar 4 19:14:20 2016 +0100

    tests: Sources shouldn't be invalidated when connecting & disconnecting
    
    https://bugzilla.gnome.org/show_bug.cgi?id=761495

 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 79085c8..f8fe674 100644
--- a/tests/simple/test-node-connections.c
+++ b/tests/simple/test-node-connections.c
@@ -51,6 +51,36 @@ test_node_already_connected (void)
   return result;
 }
 
+static void
+dont_invalidate_source_invalidated (gpointer user_data)
+{
+  gboolean *result = (gboolean *) user_data;
+  *result = FALSE;
+}
+
+static gboolean
+test_node_dont_invalidate_source (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);
+
+  g_signal_connect_swapped (src, "invalidated", G_CALLBACK (dont_invalidate_source_invalidated), &result);
+
+  gegl_node_link (src, sink);
+  gegl_node_disconnect (sink, "input");
+
+  g_object_unref (ptn);
+  return result;
+}
+
 static gboolean
 test_node_reconnect_many (void)
 {
@@ -131,6 +161,7 @@ int main(int argc, char **argv)
                NULL);
 
   RUN_TEST (test_node_already_connected)
+  RUN_TEST (test_node_dont_invalidate_source)
   RUN_TEST (test_node_reconnect_many)
 
   gegl_exit ();


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