From c55a29b4c0929342166f88bda46e35e817ad46db Mon Sep 17 00:00:00 2001 From: Nicholas Ormrod Date: Fri, 31 Oct 2014 10:52:41 -0700 Subject: [PATCH] Comparing the same tokens Summary: Avoid comparing-the-same-tokens error by parenthesizing one side. This diff only touches folly tests Test Plan: run unit tests Reviewed By: robbert@fb.com Subscribers: sdwilsh, njormrod, folly-diffs@ FB internal diff: D1650386 Tasks: 5486739 Signature: t1:1650386:1414713837:cbb578d23f759aa049f4246113d9da6d40504da4 --- folly/test/MacAddressTest.cpp | 2 +- folly/test/OptionalTest.cpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/folly/test/MacAddressTest.cpp b/folly/test/MacAddressTest.cpp index d40f795a..3f00011b 100644 --- a/folly/test/MacAddressTest.cpp +++ b/folly/test/MacAddressTest.cpp @@ -149,7 +149,7 @@ void testCmp(const char* str1, const char* str2) { EXPECT_TRUE(m2 > m1); EXPECT_TRUE(m2 >= m1); EXPECT_TRUE(m1 != m2); - EXPECT_TRUE(m1 == m1); + EXPECT_TRUE(m1 == (m1)); EXPECT_FALSE(m1 == m2); // Also test the copy constructor and assignment operator diff --git a/folly/test/OptionalTest.cpp b/folly/test/OptionalTest.cpp index 58a20685..4699f615 100644 --- a/folly/test/OptionalTest.cpp +++ b/folly/test/OptionalTest.cpp @@ -282,16 +282,16 @@ TEST(Optional, Comparisons) { Optional o1(1); Optional o2(2); - EXPECT_TRUE(o_ <= o_); - EXPECT_TRUE(o_ == o_); - EXPECT_TRUE(o_ >= o_); + EXPECT_TRUE(o_ <= (o_)); + EXPECT_TRUE(o_ == (o_)); + EXPECT_TRUE(o_ >= (o_)); EXPECT_TRUE(o1 < o2); EXPECT_TRUE(o1 <= o2); - EXPECT_TRUE(o1 <= o1); - EXPECT_TRUE(o1 == o1); + EXPECT_TRUE(o1 <= (o1)); + EXPECT_TRUE(o1 == (o1)); EXPECT_TRUE(o1 != o2); - EXPECT_TRUE(o1 >= o1); + EXPECT_TRUE(o1 >= (o1)); EXPECT_TRUE(o2 >= o1); EXPECT_TRUE(o2 > o1); @@ -299,7 +299,7 @@ TEST(Optional, Comparisons) { EXPECT_FALSE(o2 <= o1); EXPECT_FALSE(o2 <= o1); EXPECT_FALSE(o2 == o1); - EXPECT_FALSE(o1 != o1); + EXPECT_FALSE(o1 != (o1)); EXPECT_FALSE(o1 >= o2); EXPECT_FALSE(o1 >= o2); EXPECT_FALSE(o1 > o2); -- 2.34.1