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
8c849c58
Commit
8c849c58
authored
Sep 13, 2018
by
Jonny007-MKD
Browse files
Try to fix gcc and clang issues
parent
0354ccb0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
googletest/include/gtest/internal/gtest-internal.h
googletest/include/gtest/internal/gtest-internal.h
+1
-1
googletest/test/gtest_unittest.cc
googletest/test/gtest_unittest.cc
+13
-0
No files found.
googletest/include/gtest/internal/gtest-internal.h
View file @
8c849c58
...
@@ -1192,7 +1192,7 @@ class NativeArray {
...
@@ -1192,7 +1192,7 @@ class NativeArray {
class
AdditionalMessage
class
AdditionalMessage
{
{
public:
public:
AdditionalMessage
(
const
std
::
string
&
message
)
:
value
(
message
)
{}
AdditionalMessage
(
const
char
*
message
)
:
value
(
message
)
{}
AdditionalMessage
&
operator
=
(
const
std
::
string
&
message
)
{
value
=
message
;
return
*
this
;
}
AdditionalMessage
&
operator
=
(
const
std
::
string
&
message
)
{
value
=
message
;
return
*
this
;
}
operator
bool
()
const
{
return
::
testing
::
internal
::
AlwaysTrue
();
}
operator
bool
()
const
{
return
::
testing
::
internal
::
AlwaysTrue
();
}
...
...
googletest/test/gtest_unittest.cc
View file @
8c849c58
...
@@ -3748,6 +3748,19 @@ TEST(ExpectTest, ASSERT_EQ_0) {
...
@@ -3748,6 +3748,19 @@ TEST(ExpectTest, ASSERT_EQ_0) {
" 0
\n
5.6"
);
" 0
\n
5.6"
);
}
}
TEST
(
AssertionTest
,
AdditionalMessage
)
{
::
testing
::
internal
::
AdditionalMessage
m
=
"servus"
;
EXPECT_EQ
(
m
.
get
(),
"servus"
);
const
char
*
cc
=
"hello"
;
m
=
cc
;
EXPECT_EQ
(
m
.
get
(),
cc
);
std
::
string
s
=
"hi"
;
m
=
s
;
EXPECT_EQ
(
m
.
get
(),
s
);
}
// Tests ASSERT_NE.
// Tests ASSERT_NE.
TEST
(
AssertionTest
,
ASSERT_NE
)
{
TEST
(
AssertionTest
,
ASSERT_NE
)
{
ASSERT_NE
(
6
,
7
);
ASSERT_NE
(
6
,
7
);
...
...
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