aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorvladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925>2010-05-18 21:13:48 +0000
committervladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925>2010-05-18 21:13:48 +0000
commit1097b54dcf1cd393e64ec0adf54301a575bbbc1c (patch)
treef05da91adcf46a58df848555809eb74929096bab /include
parentc828e171752e67ebba33197ba758a4f24188efcf (diff)
downloadgoogletest-1097b54dcf1cd393e64ec0adf54301a575bbbc1c.tar.gz
googletest-1097b54dcf1cd393e64ec0adf54301a575bbbc1c.tar.bz2
googletest-1097b54dcf1cd393e64ec0adf54301a575bbbc1c.zip
Implements printing parameters of failed parameterized tests (issue 71).
Diffstat (limited to 'include')
-rw-r--r--include/gtest/internal/gtest-param-util.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/include/gtest/internal/gtest-param-util.h b/include/gtest/internal/gtest-param-util.h
index 0cbb58c2..98bcca7d 100644
--- a/include/gtest/internal/gtest-param-util.h
+++ b/include/gtest/internal/gtest-param-util.h
@@ -44,6 +44,7 @@
#include <gtest/internal/gtest-internal.h>
#include <gtest/internal/gtest-linked_ptr.h>
#include <gtest/internal/gtest-port.h>
+#include <gtest/gtest-printers.h>
#if GTEST_HAS_PARAM_TEST
@@ -171,7 +172,7 @@ class ParamGenerator {
iterator end() const { return iterator(impl_->End()); }
private:
- ::testing::internal::linked_ptr<const ParamGeneratorInterface<T> > impl_;
+ linked_ptr<const ParamGeneratorInterface<T> > impl_;
};
// Generates values from a range of two comparable values. Can be used to
@@ -285,7 +286,7 @@ class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
public:
Iterator(const ParamGeneratorInterface<T>* base,
typename ContainerType::const_iterator iterator)
- : base_(base), iterator_(iterator) {}
+ : base_(base), iterator_(iterator) {}
virtual ~Iterator() {}
virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
@@ -504,12 +505,12 @@ class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
param_it != generator.end(); ++param_it, ++i) {
Message test_name_stream;
test_name_stream << test_info->test_base_name.c_str() << "/" << i;
- ::testing::internal::MakeAndRegisterTestInfo(
+ std::string comment = "GetParam() = " + PrintToString(*param_it);
+ MakeAndRegisterTestInfo(
test_case_name_stream.GetString().c_str(),
test_name_stream.GetString().c_str(),
"", // test_case_comment
- "", // comment; TODO(vladl@google.com): provide parameter value
- // representation.
+ comment.c_str(),
GetTestCaseTypeId(),
TestCase::SetUpTestCase,
TestCase::TearDownTestCase,