I am testing a function that returns an integer error code. I am using BOOST_CHECK_EQUAL
to compare the functions return to the error code. Similar to this:
BOOST_CHECK_EQUAL( foo(a), 12 ) // where 12 is an error code
The function foo
has a cerr
statement in it that will be triggered before the error code is returned. Is there any way to hide the error message? Currently my output reads something like this:
Running 7 test cases...
Error in foo()
*** No errors detected
but I want:
Running 7 test cases...
*** No Errors detected
Is there a way to run this test with the equivalent of a 2>/dev/null
on just that one test? Thanks ahead of time.