summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@google.com>2023-01-30 20:57:54 (GMT)
committerCopybara-Service <copybara-worker@google.com>2023-01-30 20:58:34 (GMT)
commitf1c05d4544964b060460a683c1cf31e02f0ba094 (patch)
tree7d434c0e0bb70bfb5c30c1aa41786e0f01e7c6ad
parente3dbee4b355180b87c48254205122c20e97f2f07 (diff)
downloadgoogletest-f1c05d4544964b060460a683c1cf31e02f0ba094.zip
googletest-f1c05d4544964b060460a683c1cf31e02f0ba094.tar.gz
googletest-f1c05d4544964b060460a683c1cf31e02f0ba094.tar.bz2
Use explicit short to fix MSVC compiler warning
warning C4244: 'initializing': conversion from 'int' to 'short', possible loss of data PiperOrigin-RevId: 505774670 Change-Id: I3524040334a4b265bae12cfacdd2b615cbb1cfc8
-rw-r--r--googlemock/test/gmock-matchers-misc_test.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/googlemock/test/gmock-matchers-misc_test.cc b/googlemock/test/gmock-matchers-misc_test.cc
index f99bbf4..1d1bfb9 100644
--- a/googlemock/test/gmock-matchers-misc_test.cc
+++ b/googlemock/test/gmock-matchers-misc_test.cc
@@ -863,7 +863,7 @@ TEST(ArgsTest, AcceptsOneTemplateArg) {
}
TEST(ArgsTest, AcceptsTwoTemplateArgs) {
- const std::tuple<short, int, long> t(4, 5, 6L); // NOLINT
+ const std::tuple<short, int, long> t(short{4}, 5, 6L); // NOLINT
EXPECT_THAT(t, (Args<0, 1>(Lt())));
EXPECT_THAT(t, (Args<1, 2>(Lt())));
@@ -871,13 +871,13 @@ TEST(ArgsTest, AcceptsTwoTemplateArgs) {
}
TEST(ArgsTest, AcceptsRepeatedTemplateArgs) {
- const std::tuple<short, int, long> t(4, 5, 6L); // NOLINT
+ const std::tuple<short, int, long> t(short{4}, 5, 6L); // NOLINT
EXPECT_THAT(t, (Args<0, 0>(Eq())));
EXPECT_THAT(t, Not(Args<1, 1>(Ne())));
}
TEST(ArgsTest, AcceptsDecreasingTemplateArgs) {
- const std::tuple<short, int, long> t(4, 5, 6L); // NOLINT
+ const std::tuple<short, int, long> t(short{4}, 5, 6L); // NOLINT
EXPECT_THAT(t, (Args<2, 0>(Gt())));
EXPECT_THAT(t, Not(Args<2, 1>(Lt())));
}
@@ -892,7 +892,7 @@ TEST(ArgsTest, AcceptsMoreTemplateArgsThanArityOfOriginalTuple) {
}
TEST(ArgsTest, CanBeNested) {
- const std::tuple<short, int, long, int> t(4, 5, 6L, 6); // NOLINT
+ const std::tuple<short, int, long, int> t(short{4}, 5, 6L, 6); // NOLINT
EXPECT_THAT(t, (Args<1, 2, 3>(Args<1, 2>(Eq()))));
EXPECT_THAT(t, (Args<0, 1, 3>(Args<0, 2>(Lt()))));
}