From: Brian Aker Date: Mon, 5 Mar 2012 01:28:24 +0000 (-0800) Subject: Valgrind returns a different error for invalid binary. X-Git-Tag: 1.0.5~11 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=77c987b7f93f71d3cca198e60538c7a75d7d11ab;p=m6w6%2Flibmemcached Valgrind returns a different error for invalid binary. --- diff --git a/libtest/unittest.cc b/libtest/unittest.cc index bffa4ecb..9945e386 100644 --- a/libtest/unittest.cc +++ b/libtest/unittest.cc @@ -363,7 +363,15 @@ static test_return_t application_doesnotexist_BINARY(void *) const char *args[]= { "--fubar", 0 }; test_compare(Application::SUCCESS, true_app.run(args)); - test_compare(Application::INVALID, true_app.wait()); + // Behavior is different if we are running under valgrind + if (getenv("TESTS_ENVIRONMENT") and strstr(getenv("TESTS_ENVIRONMENT"), "valgrind")) + { + test_compare(Application::FAILURE, true_app.wait()); + } + else + { + test_compare(Application::INVALID, true_app.wait()); + } test_compare(0, true_app.stdout_result().size()); return TEST_SUCCESS;