diff options
author | vslashg <gfalcon@google.com> | 2019-10-23 17:35:26 (GMT) |
---|---|---|
committer | vslashg <gfalcon@google.com> | 2019-10-23 17:35:26 (GMT) |
commit | 8bab7883a676ee439801b22d0fdbe328ea021f9a (patch) | |
tree | e6a2da8ee0ceacf26421eb95cce6f7c567fe58e7 /googlemock/test | |
parent | aa1146da816954a87bdd6ad745d6281a529e0d90 (diff) | |
parent | e1b67b07f7bde8398b540e2edf154404cc5a9904 (diff) | |
download | googletest-8bab7883a676ee439801b22d0fdbe328ea021f9a.zip googletest-8bab7883a676ee439801b22d0fdbe328ea021f9a.tar.gz googletest-8bab7883a676ee439801b22d0fdbe328ea021f9a.tar.bz2 |
Merge pull request #2514 from thejcannon:msvc_macro_issue
PiperOrigin-RevId: 276134684
Diffstat (limited to 'googlemock/test')
-rw-r--r-- | googlemock/test/gmock-pp_test.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/googlemock/test/gmock-pp_test.cc b/googlemock/test/gmock-pp_test.cc index 7387d39..5d1566e 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,11 @@ 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_IS_EMPTY(, ), ""); static_assert(!GMOCK_PP_IS_EMPTY(a), ""); static_assert(!GMOCK_PP_IS_EMPTY(()), ""); |