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

Fix macOS test failures. #398

Merged
merged 3 commits into from
Nov 29, 2021
Merged

Fix macOS test failures. #398

merged 3 commits into from
Nov 29, 2021

Conversation

kring
Copy link
Member

@kring kring commented Nov 18, 2021

Fixes #394

I think the problem is that operator[] for std::vector<bool> doesn't return an actual bool on this platform, but rather something that can be implicitly converted to bool. When we pass that thing to RapidJSON's PushBack, it still doesn't get implicitly converted to a bool. So the JSON ends up incorrect. Fixed by explicitly casting return return value of operator[] to the right type.

@kring
Copy link
Member Author

kring commented Nov 18, 2021

The caching accessor tests are still segfaulting on macOS, needs investigation.

@kring
Copy link
Member Author

kring commented Nov 25, 2021

Ok this is ready now! The segfaults on macOS were caused by a conflicting definition of MockTaskProcessor (and possibly other types). MockTaskProcessor was defined in two source files, TestCacheAssetAccessor.cpp and TestAsyncSystem.cpp. In neither case were these in the unnamed namespace, so they were the "same" class. Yet the definitions were slightly different. I guess it wasn't a multiply-defined linker error because all of the method implementations were also inlined. So I put both definitions into the unnamed namespace and the segfault went away.

It took ages to track this down. What eventually gave it away was when I tried to add some debug code to MockTaskProcessor and it had no effect!

@kring kring added this to the Cesium for Unreal v1.8.0 milestone Nov 29, 2021
@nithinp7
Copy link
Contributor

Good work hunting this one down @kring, thanks!

@nithinp7 nithinp7 merged commit 67e73c6 into main Nov 29, 2021
@nithinp7 nithinp7 deleted the mac-test-failures branch November 29, 2021 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants