hughsie / appstream-glib

This library provides objects and helper methods to help reading and writing AppStream metadata.
GNU Lesser General Public License v2.1
65 stars 103 forks source link

as-self-test fails since 0.8.0 #445

Closed heftig closed 2 years ago

heftig commented 2 years ago

The as-self-test fails since 0.8.0:

<It now also supports<em>em</em><code> and </code><code>code</code> tags.>
Bail out! As:ERROR:../appstream-glib/libappstream-glib/as-self-test.c:2944:as_test_node_xml_func: assertion failed (as_node_get_data (n2) == "It now also supports<em>em</em> and <code>code</code> tags."): ("It now also supports<em>em</em><code> and </code><code>code</code> tags." == "It now also supports<em>em</em> and <code>code</code> tags.")
stderr:
**
As:ERROR:../appstream-glib/libappstream-glib/as-self-test.c:2944:as_test_node_xml_func: assertion failed (as_node_get_data (n2) == "It now also supports<em>em</em> and <code>code</code> tags."): ("It now also supports<em>em</em><code> and </code><code>code</code> tags." == "It now also supports<em>em</em> and <code>code</code> tags.")

Bisection identified f939f14774618fd07d7019e9d0c86e1e1ae5642a as the first broken commit.

meson setup + compile log: appstream-glib-0.8.0-1-x86_64-build.log meson test log: appstream-glib-0.8.0-1-x86_64-check.log

heftig commented 2 years ago

Looking at the test that https://github.com/hughsie/appstream-glib/commit/f939f14774618fd07d7019e9d0c86e1e1ae5642a added, I think even if it did pass, the code is broken.

The source markup is:

https://github.com/hughsie/appstream-glib/blob/2415ed7f48aba0f210445ab83e8278ca4ec47945/libappstream-glib/as-self-test.c#L2868-L2872

And the expected data is:

https://github.com/hughsie/appstream-glib/blob/2415ed7f48aba0f210445ab83e8278ca4ec47945/libappstream-glib/as-self-test.c#L2944

The space between supports and <em>em</em> is gone.

hughsie commented 2 years ago

It worked here (and continues to work); can you debug a bit please?

heftig commented 2 years ago

Any idea what could affect this? Some dependency?

heftig commented 2 years ago

The new fields in the AsNodeToXmlHelper struct aren't being initialized.

(Also, they should probably be bitfields for consistency.)

hughsie commented 2 years ago

Can you do a pr please?