cc-wrapper-test: Don't use assert

This commit is contained in:
John Ericson 2017-07-27 14:37:24 -04:00 committed by John Ericson
parent 539dcb8e27
commit a9dd855894

View File

@ -30,7 +30,8 @@ let
src=$PWD src=$PWD
cat << 'EOF' > main.cxx cat << 'EOF' > main.cxx
#include <assert.h> #include <cstdlib>
#include <iostream>
${toString (lib.genList (i: "extern \"C\" unsigned int asdf_${toString i}(void); ") count)} ${toString (lib.genList (i: "extern \"C\" unsigned int asdf_${toString i}(void); ") count)}
@ -39,11 +40,15 @@ let
}; };
int main(int argc, char **argv) { int main(int argc, char **argv) {
bool ret;
unsigned int i = 0; unsigned int i = 0;
for (auto f : funs) { 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 EOF
''; '';