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
ffea2d60
Commit
ffea2d60
authored
Mar 12, 2014
by
kosak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add annotations to suppress ThreadSanitizer failures due to gunit/gmock printer.
parent
c8228281
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
gtest-port.h
include/gtest/internal/gtest-port.h
+12
-0
gtest-printers.cc
src/gtest-printers.cc
+3
-0
No files found.
include/gtest/internal/gtest-port.h
View file @
ffea2d60
...
@@ -926,6 +926,18 @@ using ::std::tuple_size;
...
@@ -926,6 +926,18 @@ using ::std::tuple_size;
# define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
# define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
#endif // __clang__
#endif // __clang__
// A function level attribute to disable ThreadSanitizer instrumentation.
#if defined(__clang__)
# if __has_feature(thread_sanitizer)
# define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ \
__attribute__((no_sanitize_thread))
# else
# define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
# endif // __has_feature(thread_sanitizer)
#else
# define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
#endif // __clang__
namespace
testing
{
namespace
testing
{
class
Message
;
class
Message
;
...
...
src/gtest-printers.cc
View file @
ffea2d60
...
@@ -59,6 +59,7 @@ using ::std::ostream;
...
@@ -59,6 +59,7 @@ using ::std::ostream;
// Prints a segment of bytes in the given object.
// Prints a segment of bytes in the given object.
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
void
PrintByteSegmentInObjectTo
(
const
unsigned
char
*
obj_bytes
,
size_t
start
,
void
PrintByteSegmentInObjectTo
(
const
unsigned
char
*
obj_bytes
,
size_t
start
,
size_t
count
,
ostream
*
os
)
{
size_t
count
,
ostream
*
os
)
{
char
text
[
5
]
=
""
;
char
text
[
5
]
=
""
;
...
@@ -257,6 +258,7 @@ void PrintTo(wchar_t wc, ostream* os) {
...
@@ -257,6 +258,7 @@ void PrintTo(wchar_t wc, ostream* os) {
template
<
typename
CharType
>
template
<
typename
CharType
>
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
static
void
PrintCharsAsStringTo
(
static
void
PrintCharsAsStringTo
(
const
CharType
*
begin
,
size_t
len
,
ostream
*
os
)
{
const
CharType
*
begin
,
size_t
len
,
ostream
*
os
)
{
const
char
*
const
kQuoteBegin
=
sizeof
(
CharType
)
==
1
?
"
\"
"
:
"L
\"
"
;
const
char
*
const
kQuoteBegin
=
sizeof
(
CharType
)
==
1
?
"
\"
"
:
"L
\"
"
;
...
@@ -280,6 +282,7 @@ static void PrintCharsAsStringTo(
...
@@ -280,6 +282,7 @@ static void PrintCharsAsStringTo(
template
<
typename
CharType
>
template
<
typename
CharType
>
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
static
void
UniversalPrintCharArray
(
static
void
UniversalPrintCharArray
(
const
CharType
*
begin
,
size_t
len
,
ostream
*
os
)
{
const
CharType
*
begin
,
size_t
len
,
ostream
*
os
)
{
// The code
// The code
...
...
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