Index: webrtc/rtc_base/mod_ops_unittest.cc |
diff --git a/webrtc/rtc_base/mod_ops_unittest.cc b/webrtc/rtc_base/mod_ops_unittest.cc |
index c375305e2d3c15e1821f342c5a701db0dc5b6c23..d39ea061b6f5724af88e055641b6d1bf249f3155 100644 |
--- a/webrtc/rtc_base/mod_ops_unittest.cc |
+++ b/webrtc/rtc_base/mod_ops_unittest.cc |
@@ -87,6 +87,14 @@ TEST_F(TestModOps, ForwardDiff) { |
} |
} |
+TEST_F(TestModOps, ForwardDiffWithDivisor) { |
+ ASSERT_EQ(122, (ForwardDiff<uint8_t, 123>(0, 122))); |
+ ASSERT_EQ(0, (ForwardDiff<uint8_t, 123>(122, 122))); |
+ ASSERT_EQ(122, (ForwardDiff<uint8_t, 123>(1, 0))); |
+ ASSERT_EQ(0, (ForwardDiff<uint8_t, 123>(0, 0))); |
+ ASSERT_EQ(1, (ForwardDiff<uint8_t, 123>(122, 0))); |
+} |
+ |
TEST_F(TestModOps, ReverseDiff) { |
ASSERT_EQ(0u, ReverseDiff(4711u, 4711u)); |
@@ -106,6 +114,14 @@ TEST_F(TestModOps, ReverseDiff) { |
} |
} |
+TEST_F(TestModOps, ReverseDiffWithDivisor) { |
+ ASSERT_EQ(1, (ReverseDiff<uint8_t, 123>(0, 122))); |
+ ASSERT_EQ(0, (ReverseDiff<uint8_t, 123>(122, 122))); |
+ ASSERT_EQ(1, (ReverseDiff<uint8_t, 123>(1, 0))); |
+ ASSERT_EQ(0, (ReverseDiff<uint8_t, 123>(0, 0))); |
+ ASSERT_EQ(122, (ReverseDiff<uint8_t, 123>(122, 0))); |
+} |
+ |
TEST_F(TestModOps, MinDiff) { |
for (uint16_t i = 0; i < 256; ++i) { |
ASSERT_EQ(0, MinDiff<uint8_t>(i, i)); |