From 1299fe883ce2d9e950bb944fb9acda124f53e408 Mon Sep 17 00:00:00 2001 From: Fred Gylys-Colwell Date: Sun, 1 Jul 2018 20:19:43 -0700 Subject: [PATCH] GTest compiler warnings Merge from Widevine repo of http://go/wvgerrit/50560 There were some compiler warnings about converting true and false to integers in EXPECT_EQ which were solved by using EXPECT_TRUE and EXPECT_FALSE. Test: tested as part of http://go/ag/4674759 Change-Id: Ie55b53ce48301af64ee2dff04642cbda02c1c41e --- .../cdm/metrics/test/event_metric_unittest.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/libwvdrmengine/cdm/metrics/test/event_metric_unittest.cpp b/libwvdrmengine/cdm/metrics/test/event_metric_unittest.cpp index b0fedf83..09e6c889 100644 --- a/libwvdrmengine/cdm/metrics/test/event_metric_unittest.cpp +++ b/libwvdrmengine/cdm/metrics/test/event_metric_unittest.cpp @@ -128,16 +128,14 @@ TEST_F(EventMetricTest, ThreeFieldsSuccess) { EXPECT_FALSE(metric_proto.test_distributions(0).has_variance()); EXPECT_EQ(7, metric_proto.test_distributions(0).attributes().error_code()); EXPECT_EQ(8u, metric_proto.test_distributions(0).attributes().length()); - EXPECT_EQ(false, - metric_proto.test_distributions(0).attributes().error_code_bool()); + EXPECT_FALSE(metric_proto.test_distributions(0).attributes().error_code_bool()); EXPECT_EQ(1u, metric_proto.test_distributions(1).operation_count()); EXPECT_EQ(11LL, metric_proto.test_distributions(1).mean()); EXPECT_FALSE(metric_proto.test_distributions(1).has_variance()); EXPECT_EQ(8, metric_proto.test_distributions(1).attributes().error_code()); EXPECT_EQ(16u, metric_proto.test_distributions(1).attributes().length()); - EXPECT_EQ(true, - metric_proto.test_distributions(1).attributes().error_code_bool()); + EXPECT_TRUE(metric_proto.test_distributions(1).attributes().error_code_bool()); } TEST_F(EventMetricTest, FourFieldsSuccess) { @@ -158,8 +156,7 @@ TEST_F(EventMetricTest, FourFieldsSuccess) { EXPECT_FALSE(metric_proto.test_distributions(0).has_variance()); EXPECT_EQ(7, metric_proto.test_distributions(0).attributes().error_code()); EXPECT_EQ(8u, metric_proto.test_distributions(0).attributes().length()); - EXPECT_EQ(true, - metric_proto.test_distributions(0).attributes().error_code_bool()); + EXPECT_TRUE(metric_proto.test_distributions(0).attributes().error_code_bool()); EXPECT_EQ( 3u, metric_proto.test_distributions(0).attributes().cdm_security_level()); }