aboutsummaryrefslogtreecommitdiffstats
path: root/googlemock/src/gmock-internal-utils.cc
diff options
context:
space:
mode:
authorTanzinul Islam <t_17_7@hotmail.com>2018-03-05 09:02:59 +0000
committerTanzinul Islam <t_17_7@hotmail.com>2018-03-05 09:02:59 +0000
commit6d089311ca2a6fd83dff9ed68c1d3eb00c1443d0 (patch)
treec6f8f6067f957eb6d49656278f79c93353bb039c /googlemock/src/gmock-internal-utils.cc
parent555e6e79485151cf8c8ada55d57d9ed872591dc5 (diff)
parenta7a7f51d355081a7f1e8ab295d5df5f9bb4612c8 (diff)
downloadgoogletest-6d089311ca2a6fd83dff9ed68c1d3eb00c1443d0.tar.gz
googletest-6d089311ca2a6fd83dff9ed68c1d3eb00c1443d0.tar.bz2
googletest-6d089311ca2a6fd83dff9ed68c1d3eb00c1443d0.zip
Merge branch 'fix_death_test_child_mingw_wer_issue1116' of https://github.com/tanzislam/googletest into fix_death_test_child_mingw_wer_issue1116
Diffstat (limited to 'googlemock/src/gmock-internal-utils.cc')
-rw-r--r--googlemock/src/gmock-internal-utils.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/googlemock/src/gmock-internal-utils.cc b/googlemock/src/gmock-internal-utils.cc
index 91bf3fd9..658fa62d 100644
--- a/googlemock/src/gmock-internal-utils.cc
+++ b/googlemock/src/gmock-internal-utils.cc
@@ -47,6 +47,25 @@
namespace testing {
namespace internal {
+// Joins a vector of strings as if they are fields of a tuple; returns
+// the joined string.
+GTEST_API_ std::string JoinAsTuple(const Strings& fields) {
+ switch (fields.size()) {
+ case 0:
+ return "";
+ case 1:
+ return fields[0];
+ default:
+ std::string result = "(" + fields[0];
+ for (size_t i = 1; i < fields.size(); i++) {
+ result += ", ";
+ result += fields[i];
+ }
+ result += ")";
+ return result;
+ }
+}
+
// Converts an identifier name to a space-separated list of lower-case
// words. Each maximum substring of the form [A-Za-z][a-z]*|\d+ is
// treated as one word. For example, both "FooBar123" and