-
-
Notifications
You must be signed in to change notification settings - Fork 631
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
No assert ? #555
Comments
Godot prints error and warning messages (printed using Also, I don't see the relationship between an assert function and stdout/stderr. Are you referring to the Godot process' exit codes instead? Godot tries to be as well-behaved as possible in this regard, but it's not perfect. Feel free to open pull requests on the main Godot repository to improve this 🙂 |
I ended up finding the macro CRASH_COND that seems to have a similar behaviour to assert (except that it takes the crash condition rather than the assertion condition) |
what i meant was that the problem caused by asset is that as it outputs to stdout, when it does crash because of an assert it won't output the assert output to the godot log, now that i found CRASH_COND Now though it's fine |
in fact seems like CRASH_COND only stops the current function though it doesn't stop the execution of the rest of the program |
I was able to make an ASSERT macro that works the same as CRASH_COND but reverses the condition and calls abort rather than return
it might be a good addition to godot-cpp |
This is supposed to be covered by |
Hi, I'm sending this message because as far as I can see I find no way to actually do an assert using godot-cpp which is a problem as the standard c++ assert function only prints to stdout and godot (god knows why) doesn't use the standard stdout making assert useless
is there anything like Godot::assert or something that serves the same purpose ? I expected to find a Godot::assert the same way as the Godot class has the printing methods but no...
The text was updated successfully, but these errors were encountered: