From 0bfd7482c9af44928e884340f4d06e2162933337 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 9 Mar 2015 11:28:23 -0500 Subject: This commit might be evil --- tests/indicator-fixture.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'tests') diff --git a/tests/indicator-fixture.h b/tests/indicator-fixture.h index 0747842..d5aa570 100644 --- a/tests/indicator-fixture.h +++ b/tests/indicator-fixture.h @@ -510,6 +510,22 @@ class IndicatorFixture : public ::testing::Test }; return expectEventually(func); } + + /* Eventually Helpers */ + #define _EVENTUALLY_HELPER(oper) \ + template testing::AssertionResult expectEventually##oper (Args&& ... args) { \ + std::function func = [&]() { \ + return testing::internal::CmpHelper##oper(std::forward(args)...); \ + }; \ + return expectEventually(func); \ + } + + _EVENTUALLY_HELPER(EQ); + _EVENTUALLY_HELPER(NE); + _EVENTUALLY_HELPER(LT); + _EVENTUALLY_HELPER(GT); + _EVENTUALLY_HELPER(STREQ); + _EVENTUALLY_HELPER(STRNE); }; /* Menu Attrib */ @@ -562,3 +578,22 @@ class IndicatorFixture : public ::testing::Test #define EXPECT_EVENTUALLY_ACTION_ACTIVATION_TYPE(action, type) \ EXPECT_PRED_FORMAT2(IndicatorFixture::expectEventuallyActionActivationType, action, type) +/* Helpers */ + +#define EXPECT_EVENTUALLY_EQ(expected, actual) \ + EXPECT_PRED_FORMAT2(IndicatorFixture::expectEventuallyEQ, expected, actual) + +#define EXPECT_EVENTUALLY_NE(expected, actual) \ + EXPECT_PRED_FORMAT2(IndicatorFixture::expectEventuallyNE, expected, actual) + +#define EXPECT_EVENTUALLY_LT(expected, actual) \ + EXPECT_PRED_FORMAT2(IndicatorFixture::expectEventuallyLT, expected, actual) + +#define EXPECT_EVENTUALLY_GT(expected, actual) \ + EXPECT_PRED_FORMAT2(IndicatorFixture::expectEventuallyGT, expected, actual) + +#define EXPECT_EVENTUALLY_STREQ(expected, actual) \ + EXPECT_PRED_FORMAT2(IndicatorFixture::expectEventuallySTREQ, expected, actual) + +#define EXPECT_EVENTUALLY_STRNE(expected, actual) \ + EXPECT_PRED_FORMAT2(IndicatorFixture::expectEventuallySTRNE, expected, actual) -- cgit v1.2.3