Fix return value and r_valid value in Variant::iter_init and Variant::iter_next#1253
Conversation
dsnopek
left a comment
There was a problem hiding this comment.
Thanks! The changes look good to me, and seem to work in my testing!
Attached is a patch that adds some automated tests to ensure that at least iter_init() is working correctly. (It's tricky to test iter_next(), because you shouldn't even be able to get to that point, if you're correctly checking r_valid on iter_init() - but your changes look correct anyway!) Unfortunately, the tests won't pass until PR godotengine/godot#83681 is fixed in Godot. So, I'll make a follow up PR later that adds these tests.
|
Thanks! Congrats on your first merged PR! 🎉 |
|
Thanks for making up some tests to it! I had some trouble running tests on my machine (can't remember exactly what they were now), so I opened the PR without any and left them for later. Aaaand totally forgot about it 😅 |
|
Cherry-picked for 4.1 in PR #1281 |
Variant iteration methods were returning wrong values from GDExtension API call, never reporting that iterations were valid.
This PR makes
r_validbe set, as well as return the result from the call instead of returningvalid.