Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(992)

Unified Diff: mac/foundation_util_unittest.mm

Issue 2050803003: Update to Chromium //base at Chromium commit e3a753f17bac62738b0dbf0b36510f767b081e4b. (Closed) Base URL: https://github.com/domokit/base.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mac/foundation_util.mm ('k') | memory/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mac/foundation_util_unittest.mm
diff --git a/mac/foundation_util_unittest.mm b/mac/foundation_util_unittest.mm
index e60a0f6b6495c6cbe04331f741c15ff3c07b4496..c688442a6885f28dc58391783e3209220f75c9e9 100644
--- a/mac/foundation_util_unittest.mm
+++ b/mac/foundation_util_unittest.mm
@@ -317,6 +317,18 @@ TEST(FoundationUtilTest, NSStringToFilePath) {
EXPECT_EQ(FilePath("/a/b"), NSStringToFilePath(@"/a/b"));
}
+TEST(FoundationUtilTest, CFRangeToNSRange) {
+ NSRange range_out;
+ EXPECT_TRUE(CFRangeToNSRange(CFRangeMake(10, 5), &range_out));
+ EXPECT_EQ(10UL, range_out.location);
+ EXPECT_EQ(5UL, range_out.length);
+ EXPECT_FALSE(CFRangeToNSRange(CFRangeMake(-1, 5), &range_out));
+ EXPECT_FALSE(CFRangeToNSRange(CFRangeMake(5, -1), &range_out));
+ EXPECT_FALSE(CFRangeToNSRange(CFRangeMake(-1, -1), &range_out));
+ EXPECT_FALSE(CFRangeToNSRange(CFRangeMake(LONG_MAX, LONG_MAX), &range_out));
+ EXPECT_FALSE(CFRangeToNSRange(CFRangeMake(LONG_MIN, LONG_MAX), &range_out));
+}
+
TEST(StringNumberConversionsTest, FormatNSInteger) {
// The PRI[dxu]NS macro assumes that NSInteger is a typedef to "int" on
// 32-bit architecture and a typedef to "long" on 64-bit architecture
« no previous file with comments | « mac/foundation_util.mm ('k') | memory/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698