Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
07bba78a
Commit
07bba78a
authored
Aug 09, 2017
by
drgler
Browse files
Merge branch 'master' of github.com:Dani-Hub/googletest
parents
71ca4bae
484ec91c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
googletest/test/gtest-printers_test.cc
googletest/test/gtest-printers_test.cc
+28
-0
No files found.
googletest/test/gtest-printers_test.cc
View file @
07bba78a
...
...
@@ -187,6 +187,27 @@ inline ::std::ostream& operator<<(::std::ostream& os,
return
os
<<
"StreamableTemplateInFoo: "
<<
x
.
value
();
}
// A user-defined streamable but recursivly-defined container type in
// a user namespace, it mimics therefore std::filesystem::path or
// boost::filesystem::path.
class
PathLike
{
public:
struct
iterator
{
typedef
PathLike
value_type
;
};
typedef
iterator
const_iterator
;
iterator
begin
()
const
{
return
iterator
();
}
iterator
end
()
const
{
return
iterator
();
}
friend
::
std
::
ostream
&
operator
<<
(
::
std
::
ostream
&
os
,
const
PathLike
&
p
)
{
return
os
<<
"Streamable-PathLike"
;
}
};
}
// namespace foo
namespace
testing
{
...
...
@@ -1161,6 +1182,13 @@ TEST(PrintStreamableTypeTest, TemplateTypeInUserNamespace) {
Print
(
::
foo
::
StreamableTemplateInFoo
<
int
>
()));
}
// Tests printing a user-defined recursive container type that has a <<
// operator.
TEST
(
PrintStreamableTypeTest
,
PathLikeInUserNamespace
)
{
::
foo
::
PathLike
x
;
EXPECT_EQ
(
"Streamable-PathLike"
,
Print
(
x
));
}
// Tests printing user-defined types that have a PrintTo() function.
TEST
(
PrintPrintableTypeTest
,
InUserNamespace
)
{
EXPECT_EQ
(
"PrintableViaPrintTo: 0"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment