Index: webrtc/base/safe_compare_unittest.cc |
diff --git a/webrtc/base/safe_compare_unittest.cc b/webrtc/base/safe_compare_unittest.cc |
index 12ab4696efc44f80c58522dcb9d36a2e76394c64..f52c7eedcc3d9a50ef4220ad225bb979690f3c54 100644 |
--- a/webrtc/base/safe_compare_unittest.cc |
+++ b/webrtc/base/safe_compare_unittest.cc |
@@ -376,4 +376,19 @@ TEST(SafeCmpTest, Ge) { |
EXPECT_TRUE(safe_cmp::Ge(p2, p2)); |
} |
+TEST(SafeCmpTest, Enum) { |
+ enum E1 { e1 = 13 }; |
+ enum { e2 = 13 }; |
+ enum E3 : unsigned { e3 = 13 }; |
+ enum : unsigned { e4 = 13 }; |
+ EXPECT_TRUE(safe_cmp::Eq(13, e1)); |
+ EXPECT_TRUE(safe_cmp::Eq(13u, e1)); |
+ EXPECT_TRUE(safe_cmp::Eq(13, e2)); |
+ EXPECT_TRUE(safe_cmp::Eq(13u, e2)); |
+ EXPECT_TRUE(safe_cmp::Eq(13, e3)); |
+ EXPECT_TRUE(safe_cmp::Eq(13u, e3)); |
+ EXPECT_TRUE(safe_cmp::Eq(13, e4)); |
+ EXPECT_TRUE(safe_cmp::Eq(13u, e4)); |
+} |
+ |
} // namespace rtc |