GNOME Bugzilla – Bug 760161
gegl-xml: Cannot serialize a node that is a graph but not a meta-op
Last modified: 2016-01-16 16:18:47 UTC
gegl_node_to_xml intends to handle GeglNodes that are "empty" graphs by using their output proxy. Unfortunately, the check for detecting such nodes is wrong. gegl_node_get_operation will return "GraphNode", not NULL, for nodes that are graphs but don't have an operation associated with them.
Created attachment 318255 [details] [review] gegl-xml: Fix serialization of graph nodes that are not meta-ops
Comment on attachment 318255 [details] [review] gegl-xml: Fix serialization of graph nodes that are not meta-ops Pushed to master after pippin's approval in #gegl.
commit 6a791c1f74c90c6d34e57edc32d026f3a4d244b8 Author: Debarshi Ray <debarshir@gnome.org> Date: Tue Jan 5 14:44:39 2016 +0100 gegl-xml: Fix serialization of graph nodes that are not meta-ops https://bugzilla.gnome.org/show_bug.cgi?id=760161
(In reply to Debarshi Ray from comment #3) > commit 6a791c1f74c90c6d34e57edc32d026f3a4d244b8 > Author: Debarshi Ray <debarshir@gnome.org> > Date: Tue Jan 5 14:44:39 2016 +0100 > > gegl-xml: Fix serialization of graph nodes that are not meta-ops > > https://bugzilla.gnome.org/show_bug.cgi?id=760161 This commit broke make check: https://build.gimp.org/job/gegl-master/ In tests/xml/test-save.c there is already a test commented out as expected to fail, perhaps it is the case to add one that would fail without this commit and an explanation of why /xml/save/empty_graph is now failing. Btw this commit is sortof reverting part of https://git.gnome.org/browse/gegl/commit/gegl/gegl-xml.c?id=00431fb8a23af8a68009330d00e34674a347291d
(In reply to Massimo from comment #4) > This commit broke make check: > > https://build.gimp.org/job/gegl-master/ > > In tests/xml/test-save.c there is already a > test commented out as expected to fail, perhaps > it is the case to add one that would fail without > this commit and an explanation of why > /xml/save/empty_graph is now failing. I will take a look.
Created attachment 319182 [details] [review] gegl-xml: Unbreak serialization of empty graphs
(In reply to Massimo from comment #4) > This commit broke make check: > > https://build.gimp.org/job/gegl-master/ > > [...] > > Btw this commit is sortof reverting part of > > https://git.gnome.org/browse/gegl/commit/gegl/gegl-xml. > c?id=00431fb8a23af8a68009330d00e34674a347291d Killed two birds with one stone. I am sorry about breaking the tests. My only excuse is that 8 of the compositions tests always fail on this particular laptop, and this particular laptop only. That prevented the XML tests from running.
Created attachment 319183 [details] [review] tests: Enable test for serialization of sub-graphs
Created attachment 319184 [details] [review] tests: Test multiple serializations of an empty graph
commit 09993e3bf24a42c20c4f67285514adbbd53bef27 Author: Debarshi Ray <debarshir@gnome.org> Date: Sat Jan 16 16:20:32 2016 +0100 gegl-xml: Unbreak serialization of empty graphs Nodes without any children at all (or empty graphs) have is_graph set to FALSE. Therefore, the condition to handle non-meta-op graphs was excluding such nodes. Trying to serialize such a node would lead to: CRITICAL **: gegl_node_get: assertion 'self->is_graph || GEGL_IS_OPERATION (self->operation)' failed Checking for the absence of a GeglOperation object covers both cases. This is unlike gegl_node_get_operation which returns NULL for one and "GraphNode" for another. As a nice side-effect, this reverts to using only public API in gegl_xml functions. Fall out from 6a791c1f74c90c6d34e57edc32d026f3a4d244b8 https://bugzilla.gnome.org/show_bug.cgi?id=760161
commit 3a835d569763094d9494a95f801a4ebcad77067b Author: Debarshi Ray <debarshir@gnome.org> Date: Sat Jan 16 16:53:31 2016 +0100 tests: Test multiple serializations of an empty graph https://bugzilla.gnome.org/show_bug.cgi?id=760161 commit d8d0bbc4adfd3c8c4f75676e831153e4a13da857 Author: Debarshi Ray <debarshir@gnome.org> Date: Sat Jan 16 16:43:06 2016 +0100 tests: Enable test for serialization of sub-graphs For serialization to work, the nodes inside the sub-graph should be connected to the proxies. https://bugzilla.gnome.org/show_bug.cgi?id=760161