Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
f5e592d8
Commit
f5e592d8
authored
Apr 28, 2021
by
Abseil Team
Committed by
Derek Mauro
Apr 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Googletest export
Revert
https://github.com/google/googletest/commit/ac3c2a8d0496893787015014a5abd397b766cce2
-- it seems to break some gcc users (#3384) PiperOrigin-RevId: 370834917
parent
065a0c81
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
72 deletions
+0
-72
gtest-printers.h
googletest/include/gtest/gtest-printers.h
+0
-17
googletest-printers-test.cc
googletest/test/googletest-printers-test.cc
+0
-55
No files found.
googletest/include/gtest/gtest-printers.h
View file @
f5e592d8
...
...
@@ -113,11 +113,6 @@
#include "gtest/internal/gtest-internal.h"
#include "gtest/internal/gtest-port.h"
#if GTEST_HAS_RTTI
#include <typeindex>
#include <typeinfo>
#endif // GTEST_HAS_RTTI
namespace
testing
{
// Definitions in the internal* namespaces are subject to change without notice.
...
...
@@ -672,18 +667,6 @@ void PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) {
*
os
<<
')'
;
}
#if GTEST_HAS_RTTI
inline
void
PrintTo
(
const
::
std
::
type_info
&
value
,
::
std
::
ostream
*
os
)
{
internal
::
PrintTo
<::
std
::
type_info
>
(
value
,
os
);
*
os
<<
" (
\"
"
<<
value
.
name
()
<<
"
\"
)"
;
}
inline
void
PrintTo
(
const
::
std
::
type_index
&
value
,
::
std
::
ostream
*
os
)
{
internal
::
PrintTo
<::
std
::
type_index
>
(
value
,
os
);
*
os
<<
" (
\"
"
<<
value
.
name
()
<<
"
\"
)"
;
}
#endif // GTEST_HAS_RTTI
// Implements printing a non-reference type T by letting the compiler
// pick the right overload of PrintTo() for T.
template
<
typename
T
>
...
...
googletest/test/googletest-printers-test.cc
View file @
f5e592d8
...
...
@@ -1612,61 +1612,6 @@ TEST(PrintToStringTest, WorksForCharArrayWithEmbeddedNul) {
"
\n
As Text:
\"
From ä — ẑ
\"
"
);
}
#if GTEST_HAS_RTTI
template
<
typename
T
>
class
PrintToStringTest
:
public
testing
::
Test
{
public
:
using
TestType
=
T
;
};
struct
PrintBase
{
virtual
~
PrintBase
()
=
default
;
};
struct
PrintDerived
:
PrintBase
{};
using
PrintToStringTestTypes
=
testing
::
Types
<
void
,
int
,
const
volatile
int
*
,
PrintBase
,
PrintDerived
>
;
TYPED_TEST_SUITE
(
PrintToStringTest
,
PrintToStringTestTypes
);
// Returns `true` if `haystack` contains `needle`.
//
// FIXME: Replace with `EXPECT_THAT(haystack, HasSubstr(needle))` once
// GoogleTest starts depending on GoogleMock.
bool
ContainsSubstr
(
const
std
::
string
&
haystack
,
const
std
::
string
&
needle
)
{
return
haystack
.
find
(
needle
)
!=
std
::
string
::
npos
;
}
TYPED_TEST
(
PrintToStringTest
,
IncludesNameWithTypeInfoAndTypeIndex
)
{
const
::
std
::
type_info
&
info
=
typeid
(
typename
TestFixture
::
TestType
);
SCOPED_TRACE
(
info
.
name
());
EXPECT_TRUE
(
ContainsSubstr
(
PrintToString
(
info
),
info
.
name
()));
EXPECT_TRUE
(
ContainsSubstr
(
PrintToString
(
::
std
::
type_index
{
info
}),
info
.
name
()));
}
TEST
(
PrintToStringTest
,
IncludesNameWithTypeInfoAndTypeIndexViaBaseRef
)
{
PrintDerived
derived
;
PrintBase
&
base
=
derived
;
{
const
::
std
::
type_info
&
derived_info
=
typeid
(
derived
);
SCOPED_TRACE
(
derived_info
.
name
());
EXPECT_TRUE
(
ContainsSubstr
(
PrintToString
(
derived_info
),
derived_info
.
name
()));
EXPECT_TRUE
(
ContainsSubstr
(
PrintToString
(
::
std
::
type_index
{
derived_info
}),
derived_info
.
name
()));
}
{
const
::
std
::
type_info
&
base_ref_info
=
typeid
(
base
);
SCOPED_TRACE
(
base_ref_info
.
name
());
EXPECT_TRUE
(
ContainsSubstr
(
PrintToString
(
base_ref_info
),
base_ref_info
.
name
()));
EXPECT_TRUE
(
ContainsSubstr
(
PrintToString
(
::
std
::
type_index
{
base_ref_info
}),
base_ref_info
.
name
()));
}
}
#endif // GTEST_HAS_RTTI
TEST
(
IsValidUTF8Test
,
IllFormedUTF8
)
{
// The following test strings are ill-formed UTF-8 and are printed
// as hex only (or ASCII, in case of ASCII bytes) because IsValidUTF8() is
...
...
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