From a9dd855894d426ecc1e32b1b8b72a9db7f8ed913 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 27 Jul 2017 14:37:24 -0400 Subject: [PATCH] cc-wrapper-test: Don't use assert --- pkgs/test/macos-sierra-shared/default.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkgs/test/macos-sierra-shared/default.nix b/pkgs/test/macos-sierra-shared/default.nix index 2d52a02affa0..e96fdb34c05f 100644 --- a/pkgs/test/macos-sierra-shared/default.nix +++ b/pkgs/test/macos-sierra-shared/default.nix @@ -30,7 +30,8 @@ let src=$PWD cat << 'EOF' > main.cxx - #include + #include + #include ${toString (lib.genList (i: "extern \"C\" unsigned int asdf_${toString i}(void); ") count)} @@ -39,11 +40,15 @@ let }; int main(int argc, char **argv) { + bool ret; unsigned int i = 0; for (auto f : funs) { - assert(f() == i++); + if (f() != i++) { + std::cerr << "Failed to get expected response from function #" << i << std::endl; + return EXIT_FAILURE; + } } - return 0; + return EXIT_SUCCESS; } EOF '';