Skip to content

Commit

Permalink
Compare error value != 0
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Sep 5, 2022
1 parent a1cddb9 commit 15b5330
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nano/test_common/testutil.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@
GTEST_NONFATAL_FAILURE_)

/** Extends gtest with a std::error_code assert that expects an error */
#define ASSERT_IS_ERROR(condition) \
GTEST_TEST_ERROR_CODE ((condition.value () > 0), #condition, "An error was expected", "", \
#define ASSERT_IS_ERROR(condition) \
GTEST_TEST_ERROR_CODE ((condition.value () != 0), #condition, "An error was expected", "", \
GTEST_FATAL_FAILURE_)

/** Extends gtest with a std::error_code assert that expects an error */
#define EXPECT_IS_ERROR(condition) \
GTEST_TEST_ERROR_CODE ((condition.value () > 0), #condition, "An error was expected", "", \
#define EXPECT_IS_ERROR(condition) \
GTEST_TEST_ERROR_CODE ((condition.value () != 0), #condition, "An error was expected", "", \
GTEST_NONFATAL_FAILURE_)

/** Asserts that the condition becomes true within the deadline */
Expand Down

0 comments on commit 15b5330

Please sign in to comment.