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

Assertion fails during nlohmann/json tests #1241

Closed
yurivict opened this issue Apr 4, 2018 · 7 comments
Closed

Assertion fails during nlohmann/json tests #1241

yurivict opened this issue Apr 4, 2018 · 7 comments

Comments

@yurivict
Copy link

yurivict commented Apr 4, 2018

Tests in https://github.com/nlohmann/json version 3.1.2 fail on FreeBSD due to assertions in catch2: nlohmann/json#1032 (comment)

@nlohmann
Copy link

nlohmann commented Apr 5, 2018

We haven't seen a Catch assertion fail in years - this seems to be an issue related to FreeBSD.

For reference:

Assertion failed: (m_parent), function moveToParent, file /usr/ports/devel/nlohmann-json/work/json-3.1.2/test/thirdparty/catch/catch.hpp, line 6222.

That's this line.

Note we are still using Catch v1.9.7 as porting all tests to Catch 2 is still an issue. Nevertheless, it would be interesting to understand what the reported assertion means and if there is a bug somewhere.

@horenmar
Copy link
Member

horenmar commented Apr 5, 2018

@yurivict Can you check what happens when you run Catch's self-test on FreeBSD?

@yurivict
Copy link
Author

yurivict commented Apr 5, 2018

Yes, there are assertions:

loose text artifact
===============================================================================
All tests passed (854 assertions in 142 test cases)

Version 2.2.1

@yurivict
Copy link
Author

yurivict commented May 17, 2018

Now I am trying to update the FreeBSD port devel/nlohmann-json and Catch is still failing in tests.

Any hope to resolve this?

grembo pushed a commit to grembo/json that referenced this issue Jul 29, 2018
sections, see also catchorg/Catch2#816 (comment)

As a result, when built with gcc, loop iterations were skipped. When
built with clang, the test aborted with an assertion in catch.hpp
line 6222.

This also addresses the issues discussed here:
nlohmann#1032 (comment)

and here:
catchorg/Catch2#1241

Please note that this introduces new problems, as some of
the unit tests fail now - the library stores keys in
lexographical order, while the cbor/msgpack/ubjson examples
store them in original order.
@grembo
Copy link

grembo commented Jul 29, 2018

This is caused by nlohmann-json using duplicate section names in loops, basically the problem described here: #816 (comment)

You can probably close this issue, as this is not caused by catch, but by an invalid use of it.

@grembo
Copy link

grembo commented Sep 19, 2018

The fix in nlohmann-json has been merged. This is neither a catch2 nor a FreeBSD issue, you can really close it now.

@horenmar
Copy link
Member

horenmar commented Sep 20, 2018

I have been a bit busy so I didn't notice that it has been resolved since. I am going to tag this with a "Revisit" label, to check if we can report this to the user somehow.

Thank you for reporting back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants