diff options
author | Andy Soffer <asoffer@google.com> | 2020-01-02 21:48:50 (GMT) |
---|---|---|
committer | Andy Soffer <asoffer@google.com> | 2020-01-02 21:48:50 (GMT) |
commit | 008629ae2163035dabd428d581379fa5aac4b7bb (patch) | |
tree | dd2ee66318da4f6de2249361a328edd9654e3a91 /googletest/include/gtest/internal | |
parent | d0a521255eb59ec6ff6e30fdf53c4f05f3fd3270 (diff) | |
parent | 1800a38fb7d8d4f923fc450875afa3bc16f01151 (diff) | |
download | googletest-008629ae2163035dabd428d581379fa5aac4b7bb.zip googletest-008629ae2163035dabd428d581379fa5aac4b7bb.tar.gz googletest-008629ae2163035dabd428d581379fa5aac4b7bb.tar.bz2 |
Merge pull request #2624 from ShabbyX:master
PiperOrigin-RevId: 286397298
Diffstat (limited to 'googletest/include/gtest/internal')
-rw-r--r-- | googletest/include/gtest/internal/gtest-internal.h | 11 | ||||
-rw-r--r-- | googletest/include/gtest/internal/gtest-param-util.h | 5 |
2 files changed, 14 insertions, 2 deletions
diff --git a/googletest/include/gtest/internal/gtest-internal.h b/googletest/include/gtest/internal/gtest-internal.h index eac831a..59d2a83 100644 --- a/googletest/include/gtest/internal/gtest-internal.h +++ b/googletest/include/gtest/internal/gtest-internal.h @@ -79,7 +79,16 @@ #define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar // Stringifies its argument. -#define GTEST_STRINGIFY_(name) #name +// Work around a bug in visual studio which doesn't accept code like this: +// +// #define GTEST_STRINGIFY_(name) #name +// #define MACRO(a, b, c) ... GTEST_STRINGIFY_(a) ... +// MACRO(, x, y) +// +// Complaining about the argument to GTEST_STRINGIFY_ being empty. +// This is allowed by the spec. +#define GTEST_STRINGIFY_HELPER_(name, ...) #name +#define GTEST_STRINGIFY_(...) GTEST_STRINGIFY_HELPER_(__VA_ARGS__, ) namespace proto2 { class Message; } diff --git a/googletest/include/gtest/internal/gtest-param-util.h b/googletest/include/gtest/internal/gtest-param-util.h index 70c4335..3f2495b 100644 --- a/googletest/include/gtest/internal/gtest-param-util.h +++ b/googletest/include/gtest/internal/gtest-param-util.h @@ -574,7 +574,10 @@ class ParameterizedTestSuiteInfo : public ParameterizedTestSuiteInfoBase { test_param_names.insert(param_name); - test_name_stream << test_info->test_base_name << "/" << param_name; + if (!test_info->test_base_name.empty()) { + test_name_stream << test_info->test_base_name << "/"; + } + test_name_stream << param_name; MakeAndRegisterTestInfo( test_suite_name.c_str(), test_name_stream.GetString().c_str(), nullptr, // No type parameter. |