aboutsummaryrefslogtreecommitdiffstats
path: root/googletest/include/gtest/internal
diff options
context:
space:
mode:
authorAndy Soffer <asoffer@google.com>2020-01-02 16:48:50 -0500
committerAndy Soffer <asoffer@google.com>2020-01-02 16:48:50 -0500
commit008629ae2163035dabd428d581379fa5aac4b7bb (patch)
treedd2ee66318da4f6de2249361a328edd9654e3a91 /googletest/include/gtest/internal
parentd0a521255eb59ec6ff6e30fdf53c4f05f3fd3270 (diff)
parent1800a38fb7d8d4f923fc450875afa3bc16f01151 (diff)
downloadgoogletest-008629ae2163035dabd428d581379fa5aac4b7bb.tar.gz
googletest-008629ae2163035dabd428d581379fa5aac4b7bb.tar.bz2
googletest-008629ae2163035dabd428d581379fa5aac4b7bb.zip
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.h11
-rw-r--r--googletest/include/gtest/internal/gtest-param-util.h5
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 eac831a8..59d2a833 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 70c43354..3f2495bf 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.