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
097f64e9
Commit
097f64e9
authored
Feb 09, 2023
by
Yonggang Luo
Browse files
Revert "Fix gmock_output_test when using MSVC"
This reverts commit
0a3b403f
.
parent
b73f27fd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
9 deletions
+4
-9
googlemock/test/gmock_output_test_.cc
googlemock/test/gmock_output_test_.cc
+2
-7
googlemock/test/gmock_output_test_golden.txt
googlemock/test/gmock_output_test_golden.txt
+2
-2
No files found.
googlemock/test/gmock_output_test_.cc
View file @
097f64e9
...
@@ -33,7 +33,6 @@
...
@@ -33,7 +33,6 @@
#include <stdio.h>
#include <stdio.h>
#include <string>
#include <string>
#include <tuple>
#include "gmock/gmock.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "gtest/gtest.h"
...
@@ -255,16 +254,12 @@ TEST_F(GMockOutputTest, CatchesLeakedMocks) {
...
@@ -255,16 +254,12 @@ TEST_F(GMockOutputTest, CatchesLeakedMocks) {
}
}
MATCHER_P2
(
IsPair
,
first
,
second
,
""
)
{
MATCHER_P2
(
IsPair
,
first
,
second
,
""
)
{
return
Value
(
std
::
get
<
0
>
(
arg
)
,
first
)
&&
Value
(
std
::
get
<
1
>
(
arg
)
,
second
);
return
Value
(
arg
.
first
,
first
)
&&
Value
(
arg
.
second
,
second
);
}
}
TEST_F
(
GMockOutputTest
,
PrintsMatcher
)
{
TEST_F
(
GMockOutputTest
,
PrintsMatcher
)
{
const
testing
::
Matcher
<
int
>
m1
=
Ge
(
48
);
const
testing
::
Matcher
<
int
>
m1
=
Ge
(
48
);
// Explicitly using std::tuple instead of std::pair due to differences between
EXPECT_THAT
((
std
::
pair
<
int
,
bool
>
(
42
,
true
)),
IsPair
(
m1
,
true
));
// MSVC and other compilers. std::pair is printed as
// "struct std::pair<int,bool>" when using MSVC vs "std::pair<int,bool>" with
// other compilers.
EXPECT_THAT
((
std
::
tuple
<
int
,
bool
>
(
42
,
true
)),
IsPair
(
m1
,
true
));
}
}
void
TestCatchesLeakedMocksInAdHocTests
()
{
void
TestCatchesLeakedMocksInAdHocTests
()
{
...
...
googlemock/test/gmock_output_test_golden.txt
View file @
097f64e9
...
@@ -290,9 +290,9 @@ Stack trace:
...
@@ -290,9 +290,9 @@ Stack trace:
[ OK ] GMockOutputTest.CatchesLeakedMocks
[ OK ] GMockOutputTest.CatchesLeakedMocks
[ RUN ] GMockOutputTest.PrintsMatcher
[ RUN ] GMockOutputTest.PrintsMatcher
FILE:#: Failure
FILE:#: Failure
Value of: (std::
tuple
<int, bool>(42, true))
Value of: (std::
pair
<int, bool>(42, true))
Expected: is pair (first: is >= 48, second: true)
Expected: is pair (first: is >= 48, second: true)
Actual: (42, true)
Actual: (42, true)
(of type std::pair<int, bool>)
[ FAILED ] GMockOutputTest.PrintsMatcher
[ FAILED ] GMockOutputTest.PrintsMatcher
[ FAILED ] GMockOutputTest.UnexpectedCall
[ FAILED ] GMockOutputTest.UnexpectedCall
[ FAILED ] GMockOutputTest.UnexpectedCallToVoidFunction
[ FAILED ] GMockOutputTest.UnexpectedCallToVoidFunction
...
...
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