libtest: fix doesnotexist spawn test
authorMichael Wallner <mike@php.net>
Mon, 6 Jan 2020 12:39:23 +0000 (13:39 +0100)
committerMichael Wallner <mike@php.net>
Mon, 6 Jan 2020 12:45:01 +0000 (13:45 +0100)
libtest/unittest.cc

index a2843d27fc324f9c4de5076104cce1ef8f751b20..fafe032a047a90e8b66b04f43b2adb40cf45c67d 100644 (file)
@@ -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());