From a58ef1135a570a3ea8d10efc70c9057b4c03ea01 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 6 Jan 2020 13:39:23 +0100 Subject: [PATCH] libtest: fix doesnotexist spawn test --- libtest/unittest.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libtest/unittest.cc b/libtest/unittest.cc index a2843d27..fafe032a 100644 --- a/libtest/unittest.cc +++ b/libtest/unittest.cc @@ -623,8 +623,12 @@ static test_return_t application_doesnotexist_BINARY(void *) #elif defined(__FreeBSD__) && __FreeBSD__ ASSERT_EQ(Application::INVALID_POSIX_SPAWN, true_app.run(args)); #else - ASSERT_EQ(Application::SUCCESS, true_app.run(args)); - ASSERT_EQ(Application::INVALID_POSIX_SPAWN, true_app.join()); + Application::error_t rc = true_app.run(args); + if (Application::SUCCESS == rc) { + ASSERT_EQ(Application::INVALID_POSIX_SPAWN, true_app.join()); + } else { + ASSERT_EQ(Application::INVALID_POSIX_SPAWN, rc); + } #endif test_zero(true_app.stdout_result().size()); -- 2.30.2