Problem: errno not output on test failure

Solution: use appropriate test assertion macro
This commit is contained in:
Simon Giesecke 2019-03-20 13:34:21 +01:00
parent 669fc4df5a
commit 6e0724609a

View File

@ -19,6 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <unity.h>
#include "../tests/testutil.hpp"
#include "../tests/testutil_unity.hpp"
#include "../unittests/unittest_resolver_common.hpp"
#include <ip_resolver.hpp>
@ -150,10 +151,11 @@ static void test_resolve (zmq::ip_resolver_options_t opts_,
int rc = resolver.resolve (&addr, name_);
if (expected_addr_ == NULL) {
// TODO also check the expected errno
TEST_ASSERT_EQUAL (-1, rc);
return;
} else {
TEST_ASSERT_EQUAL (0, rc);
TEST_ASSERT_SUCCESS_ERRNO (rc);
}
validate_address (family, &addr, expected_addr_, expected_port_,