]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/futex: Fix incorrect result reporting of futex_requeue test item
authorYuwen Chen <ywen.chen@foxmail.com>
Wed, 28 Jan 2026 02:03:10 +0000 (10:03 +0800)
committerThomas Gleixner <tglx@kernel.org>
Wed, 4 Feb 2026 09:51:46 +0000 (10:51 +0100)
commitd317e2ef9dcf673c9f37cda784284af7c6812757
tree6d61d3577463606b53d0fdd69924a37274eba319
parent24d479d26b25bce5faea3ddd9fa8f3a6c3129ea7
selftests/futex: Fix incorrect result reporting of futex_requeue test item

When using the TEST_HARNESS_MAIN macro definition to declare the main
function, it is required to use the EXPECT*() and ASSERT*() macros in
conjunction and not ksft_test_result_*(). Otherwise, even if a test item
fails, the test will still return a success result because
ksft_test_result_*() does not affect the test harness state.

Convert the code to use EXPECT/ASSERT() variants, which ensures that the
overall test result is fail if one of the EXPECT()s fails.

[ tglx: Massaged change log to explain _why_ ksft_test_result*() is the wrong
   choice ]

Fixes: f341a20f6d7e ("selftests/futex: Refactor futex_requeue with kselftest_harness.h")
Signed-off-by: Yuwen Chen <ywen.chen@foxmail.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/tencent_51851B741CC4B5EC9C22AFF70BA82BB60805@qq.com
tools/testing/selftests/futex/functional/futex_requeue.c