aboutsummaryrefslogtreecommitdiffstats
path: root/googlemock/test
diff options
context:
space:
mode:
authorJoshua Cannon <joshdcannon@gmail.com>2019-10-11 10:58:59 -0500
committerJoshua Cannon <joshdcannon@gmail.com>2019-10-11 10:58:59 -0500
commitfe112cfee7e772fc94eb7c64abd86b0b9e937e70 (patch)
tree81fdc08e0c525952f7881849dc03b8ce03137f1f /googlemock/test
parentd935e8e3edaf0987ee8a0a664593e17771587393 (diff)
downloadgoogletest-fe112cfee7e772fc94eb7c64abd86b0b9e937e70.tar.gz
googletest-fe112cfee7e772fc94eb7c64abd86b0b9e937e70.tar.bz2
googletest-fe112cfee7e772fc94eb7c64abd86b0b9e937e70.zip
Replace compile-test with preprocessor test
Diffstat (limited to 'googlemock/test')
-rw-r--r--googlemock/test/gmock-function-mocker_test.cc7
-rw-r--r--googlemock/test/gmock-pp_test.cc11
2 files changed, 11 insertions, 7 deletions
diff --git a/googlemock/test/gmock-function-mocker_test.cc b/googlemock/test/gmock-function-mocker_test.cc
index e99ede53..fbc5d5b2 100644
--- a/googlemock/test/gmock-function-mocker_test.cc
+++ b/googlemock/test/gmock-function-mocker_test.cc
@@ -656,12 +656,5 @@ TEST(MockMethodMockFunctionTest, MockMethodSizeOverhead) {
EXPECT_EQ(sizeof(MockMethodSizes0), sizeof(MockMethodSizes4));
}
-// TODO(thejcannon): This just tests that this will compile, as gmock repeating the
-// noexcept specifier isn't supported yet
-struct MockUsesNoexceptWithParenthesis
-{
- MOCK_METHOD(void, func, (), (noexcept(false)));
-};
-
} // namespace gmock_function_mocker_test
} // namespace testing
diff --git a/googlemock/test/gmock-pp_test.cc b/googlemock/test/gmock-pp_test.cc
index 7387d398..aa3f2dd4 100644
--- a/googlemock/test/gmock-pp_test.cc
+++ b/googlemock/test/gmock-pp_test.cc
@@ -1,5 +1,10 @@
#include "gmock/internal/gmock-pp.h"
+// Used to test MSVC treating __VA_ARGS__ with a comma in it as one value
+#define GMOCK_TEST_REPLACE_comma_WITH_COMMA_I_comma ,
+#define GMOCK_TEST_REPLACE_comma_WITH_COMMA(x) \
+ GMOCK_PP_CAT(GMOCK_TEST_REPLACE_comma_WITH_COMMA_I_, x)
+
// Static assertions.
namespace testing {
namespace internal {
@@ -17,6 +22,12 @@ static_assert(GMOCK_PP_NARG(x, y, z, w) == 4, "");
static_assert(!GMOCK_PP_HAS_COMMA(), "");
static_assert(GMOCK_PP_HAS_COMMA(b, ), "");
static_assert(!GMOCK_PP_HAS_COMMA((, )), "");
+static_assert(
+ GMOCK_PP_HAS_COMMA(GMOCK_TEST_REPLACE_comma_WITH_COMMA(comma)), "");
+static_assert(
+ GMOCK_PP_HAS_COMMA(GMOCK_TEST_REPLACE_comma_WITH_COMMA(comma(unrelated))),
+ "");
+static_assert(GMOCK_PP_HAS_COMMA((, )), "");
static_assert(!GMOCK_PP_IS_EMPTY(, ), "");
static_assert(!GMOCK_PP_IS_EMPTY(a), "");
static_assert(!GMOCK_PP_IS_EMPTY(()), "");