From d6d019aa12d38225df25876d52e4101b18de0e6d Mon Sep 17 00:00:00 2001 From: vitaut Date: Wed, 11 Nov 2015 06:44:57 -0800 Subject: [PATCH] Don't assume that StringRef::compare returns +/-1 --- test/util-test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/util-test.cc b/test/util-test.cc index 07b10cd0..a36feefe 100644 --- a/test/util-test.cc +++ b/test/util-test.cc @@ -726,8 +726,8 @@ TEST(UtilTest, StringRefCompare) { EXPECT_EQ(0, StringRef("foo").compare(StringRef("foo"))); EXPECT_GT(StringRef("fop").compare(StringRef("foo")), 0); EXPECT_LT(StringRef("foo").compare(StringRef("fop")), 0); - EXPECT_EQ(1, StringRef("foo").compare(StringRef("fo"))); - EXPECT_EQ(-1, StringRef("fo").compare(StringRef("foo"))); + EXPECT_GT(StringRef("foo").compare(StringRef("fo")), 0); + EXPECT_LT(StringRef("fo").compare(StringRef("foo")), 0); CheckOp(); CheckOp(); CheckOp();