Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

as-self-test fails since 0.8.0 #445

Closed
heftig opened this issue Jul 15, 2022 · 5 comments · Fixed by #446
Closed

as-self-test fails since 0.8.0 #445

heftig opened this issue Jul 15, 2022 · 5 comments · Fixed by #446

Comments

@heftig
Copy link
Contributor

heftig commented Jul 15, 2022

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 f939f14 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
Copy link
Contributor Author

heftig commented Jul 15, 2022

Looking at the test that f939f14 added, I think even if it did pass, the code is broken.

The source markup is:

const gchar *valid_em_code = "<description>"
"<p>"
"It now also supports <em>em</em> and <code>code</code> tags."
"</p>"
"</description>";

And the expected data is:

g_assert_cmpstr (as_node_get_data (n2), ==, "It now also supports<em>em</em> and <code>code</code> tags.");

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

@hughsie
Copy link
Owner

hughsie commented Jul 15, 2022

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

@heftig
Copy link
Contributor Author

heftig commented Jul 15, 2022

Any idea what could affect this? Some dependency?

@heftig
Copy link
Contributor Author

heftig commented Jul 15, 2022

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

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

@hughsie
Copy link
Owner

hughsie commented Jul 15, 2022

Can you do a pr please?

heftig added a commit to heftig/appstream-glib that referenced this issue Jul 15, 2022
heftig added a commit to heftig/appstream-glib that referenced this issue Jul 18, 2022
hughsie pushed a commit that referenced this issue Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants