From 74d2433d606356c981ba54c013048b4de49f04a7 Mon Sep 17 00:00:00 2001 From: Onha Choe Date: Tue, 14 Apr 2015 13:57:54 -0700 Subject: [PATCH] change ASMutableAttributedStringBuilderTests so that it is safe against different MAX macro when MAX macro is defined in such a way in "sys/params.h", this test will become flaky, fix so that it doesn't happen --- AsyncDisplayKitTests/ASMutableAttributedStringBuilderTests.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AsyncDisplayKitTests/ASMutableAttributedStringBuilderTests.m b/AsyncDisplayKitTests/ASMutableAttributedStringBuilderTests.m index 0d6cfbe269..9a43f5f434 100644 --- a/AsyncDisplayKitTests/ASMutableAttributedStringBuilderTests.m +++ b/AsyncDisplayKitTests/ASMutableAttributedStringBuilderTests.m @@ -29,7 +29,8 @@ - (NSRange)_randomizedRangeForStringBuilder:(ASMutableAttributedStringBuilder *)builder { NSUInteger loc = arc4random() % (builder.length - 1); - NSUInteger len = MAX(arc4random() % (builder.length - loc), 1); + NSUInteger len = arc4random() % (builder.length - loc); + len = ((len > 0) ? len : 1); return NSMakeRange(loc, len); }