Skip to content

Commit

Permalink
[test_util] ASSERT_OK should work outside kudu ns
Browse files Browse the repository at this point in the history
This patch makes ASSERT_OK work when called from outside the Kudu
namespace by replacing bare const Status& with const auto&.
(::kudu::Status would have also worked but auto is already used here)
  • Loading branch information
mpercy committed Jan 23, 2020
1 parent 605ac5d commit f99b96c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/kudu/util/test_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
if (testing::Test::HasFatalFailure()) { return; }

#define ASSERT_OK(status) do { \
const Status& _s = status; \
const auto& _s = status; \
if (_s.ok()) { \
SUCCEED(); \
} else { \
Expand All @@ -39,7 +39,7 @@
} while (0);

#define EXPECT_OK(status) do { \
const Status& _s = status; \
const auto& _s = status; \
if (_s.ok()) { \
SUCCEED(); \
} else { \
Expand All @@ -50,7 +50,7 @@
// Like the above, but doesn't record successful
// tests.
#define ASSERT_OK_FAST(status) do { \
const Status& _s = status; \
const auto& _s = status; \
if (!_s.ok()) { \
FAIL() << "Bad status: " << _s.ToString(); \
} \
Expand Down

0 comments on commit f99b96c

Please sign in to comment.