Fix ASTC Decode_astc_8x8_unorm_array_7 testcase segfault#1176
Conversation
*Running tests without using git-lfs (e.g., `GIT_LFS_SKIP_SMUDGE=1 git clone <repo>`) causes a single segfault test failure for ASTC Decode_astc_8x8_unorm_array_7 test case. Ideally, all checks with KTX_SUCCESS should be changed from EXCEPT_XX to ASSERT_XX so that tests exit early and properly and not via a segfault. Signed-off-by: Walid Chtioui <walid.chtioui.main@gmail.com>
Only the KTX_SUCCESS checks on functions that will return a Please make these changes, if you have time. |
Signed-off-by: Walid Chtioui <walid.chtioui.main@gmail.com>
|
So I looked at other KTX_SUCCESS checks, and they all seem to make sense. Some are: EXPECT_EQ(result, KTX_SUCCESS);
ASSERT_TRUE(texture != NULL) << "ktxTexture?_Create failed: " << ktxErrorString(result);While others: ASSERT_TRUE(result == KTX_SUCCESS);
ASSERT_TRUE(texture != NULL) << "ktxTexture_CreateFromMemory failed: " << ktxErrorString(result);Some others do not assert on if (texture) { /* other stuff/tests */ }So I just changed the single check that is causing the issue without touching anything else.
Finally, yes. |
IIUC, in this case the test will stop if result != KTX_SUCCESS which means the error string for |
Signed-off-by: Walid Chtioui <walid.chtioui.main@gmail.com>
|
Please merge the latest main which fixes the cloudflare-related Windows CI failure. |
|
Please merge latest main here and in PR #1167. |
|
I'll come back in an hour and if you've done it, I'll run the builds. |
As partially discussed here: #1173.
I skimmed through some tests and by grepping for "KTX_SUCCESS" all checks almost always use EXPECT_XX which should, probably, be changed to ASSERT_XX (because why proceed to a segfault/other failure when a core Ktx function returned an exit error code?).