diff options
author | Knut Omang <knut.omang@oracle.com> | 2018-01-29 13:09:34 (GMT) |
---|---|---|
committer | Knut Omang <knut.omang@oracle.com> | 2019-04-26 04:33:41 (GMT) |
commit | b953e05bcfca445de42ce14a010798a594bbaf6b (patch) | |
tree | 9d6f96c6370f75658bca11142a88b1f118ec9a3d /googletest/include | |
parent | 84d986531e8df9fb6ea4a7bae8fb130c05b3782c (diff) | |
download | googletest-b953e05bcfca445de42ce14a010798a594bbaf6b.zip googletest-b953e05bcfca445de42ce14a010798a594bbaf6b.tar.gz googletest-b953e05bcfca445de42ce14a010798a594bbaf6b.tar.bz2 |
Remove / from parameterized test names if base test name is emptyrefs/pull/2111/head
This is useful to let a subsystem generate test names based on parameterized tests
without exposing them as such to the user.
Signed-off-by: Knut Omang <knut.omang@oracle.com>
Diffstat (limited to 'googletest/include')
-rw-r--r-- | googletest/include/gtest/internal/gtest-param-util.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/googletest/include/gtest/internal/gtest-param-util.h b/googletest/include/gtest/internal/gtest-param-util.h index e900b3f..aca706f 100644 --- a/googletest/include/gtest/internal/gtest-param-util.h +++ b/googletest/include/gtest/internal/gtest-param-util.h @@ -565,7 +565,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. |