Commit 4e636c3e authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[master] [1299] (unrelated but necessary fix) corrected Serial::operator>= logic

parent 73721a97
......@@ -77,9 +77,11 @@ class SerialTest(unittest.TestCase):
self.assertLessEqual(self.one, self.one)
self.assertLessEqual(self.one, self.one_2)
self.assertLess(self.one, self.two)
self.assertLessEqual(self.one, self.one)
self.assertLessEqual(self.one, self.two)
self.assertGreater(self.two, self.one)
self.assertGreaterEqual(self.two, self.two)
self.assertGreaterEqual(self.two, self.one)
self.assertLess(self.one, self.number_low)
self.assertLess(self.number_low, self.number_medium)
self.assertLess(self.number_medium, self.number_high)
......
......@@ -51,7 +51,7 @@ Serial::operator>(const Serial& other) const {
bool
Serial::operator>=(const Serial& other) const {
return (operator==(other) || !operator>(other));
return (!operator<(other));
}
Serial
......
......@@ -48,7 +48,6 @@ TEST_F(SerialTest, get_value) {
}
TEST_F(SerialTest, equals) {
EXPECT_EQ(one, one);
EXPECT_EQ(one, one);
EXPECT_EQ(one, one_2);
EXPECT_NE(one, two);
......@@ -65,6 +64,7 @@ TEST_F(SerialTest, comparison) {
EXPECT_LE(one, two);
EXPECT_GE(two, two);
EXPECT_GT(two, one);
EXPECT_GE(two, one);
EXPECT_LT(one, number_low);
EXPECT_LT(number_low, number_medium);
EXPECT_LT(number_medium, number_high);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment