summaryrefslogtreecommitdiffstats
path: root/googlemock/test
diff options
context:
space:
mode:
authorCopybara-Service <copybara-worker@google.com>2023-05-02 14:52:02 (GMT)
committerCopybara-Service <copybara-worker@google.com>2023-05-02 14:52:02 (GMT)
commita3580180d16923d6d5f488e20b3814608a892f17 (patch)
treeebfcea4239151da81e75af15f539242ea26b62b1 /googlemock/test
parentf345b2ca6adb1b505049190867eedf24d3b5eaa3 (diff)
parent76bce79a3493aa157b3baca833fec1e3934d3512 (diff)
downloadgoogletest-a3580180d16923d6d5f488e20b3814608a892f17.zip
googletest-a3580180d16923d6d5f488e20b3814608a892f17.tar.gz
googletest-a3580180d16923d6d5f488e20b3814608a892f17.tar.bz2
Merge pull request #4146 from lygstate:fixes_std_pair_diff
PiperOrigin-RevId: 528781910 Change-Id: I4038332a6255921792bfb4a8098aa84243d48e15
Diffstat (limited to 'googlemock/test')
-rw-r--r--googlemock/test/gmock_output_test_.cc9
-rw-r--r--googlemock/test/gmock_output_test_golden.txt4
2 files changed, 4 insertions, 9 deletions
diff --git a/googlemock/test/gmock_output_test_.cc b/googlemock/test/gmock_output_test_.cc
index 04a6e8b..03d8421 100644
--- a/googlemock/test/gmock_output_test_.cc
+++ b/googlemock/test/gmock_output_test_.cc
@@ -33,7 +33,6 @@
#include <stdio.h>
#include <string>
-#include <tuple>
#include "gmock/gmock.h"
#include "gtest/gtest.h"
@@ -255,16 +254,12 @@ TEST_F(GMockOutputTest, CatchesLeakedMocks) {
}
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) {
const testing::Matcher<int> m1 = Ge(48);
- // Explicitly using std::tuple instead of std::pair due to differences between
- // 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));
+ EXPECT_THAT((std::pair<int, bool>(42, true)), IsPair(m1, true));
}
void TestCatchesLeakedMocksInAdHocTests() {
diff --git a/googlemock/test/gmock_output_test_golden.txt b/googlemock/test/gmock_output_test_golden.txt
index a225644..ca88af0 100644
--- a/googlemock/test/gmock_output_test_golden.txt
+++ b/googlemock/test/gmock_output_test_golden.txt
@@ -307,9 +307,9 @@ Stack trace:
[ OK ] GMockOutputTest.CatchesLeakedMocks
[ RUN ] GMockOutputTest.PrintsMatcher
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)
- Actual: (42, true)
+ Actual: (42, true) (of type std::pair<int,bool>)
[ FAILED ] GMockOutputTest.PrintsMatcher
[ FAILED ] GMockOutputTest.UnexpectedCall