Permalink
Browse files

minor ARC related optimizations

  • Loading branch information...
1 parent 2e02f25 commit 19926545b4e54cac731c6f8b36f0eb07f8ef3467 @dodikk committed Aug 6, 2012
Showing with 9 additions and 12 deletions.
  1. +8 −9 ESLocaleTests/ESDatesCalculatorTest.m
  2. +1 −3 ESLocaleTests/HalfYearNumberTest.m
@@ -26,8 +26,8 @@ -(void)testDatesCalcRequiresDatesRangeAndStep
{
result_ = [ [ ESDatesCalculator alloc ] initWithResolution: 1
- startDate: [ NSDate date ]
- endDate: [ NSDate date ] ];
+ startDate: [ NSDate new ]
+ endDate: [ NSDate new ] ];
STAssertNotNil( result_, @"valid object expected" );
}
@@ -39,7 +39,7 @@ -(void)testDatesCalcRequiresDatesRangeAndStep
(
[ [ ESDatesCalculator alloc ] initWithResolution: 1
startDate: nil
- endDate: [ NSDate date ] ],
+ endDate: [ NSDate new ] ],
@"Assert nil expected"
);
}
@@ -48,7 +48,7 @@ -(void)testDatesCalcRequiresDatesRangeAndStep
STAssertThrows
(
[ [ ESDatesCalculator alloc ] initWithResolution: 1
- startDate: [ NSDate date ]
+ startDate: [ NSDate new ]
endDate: nil ],
@"Assert nil expected"
);
@@ -63,8 +63,8 @@ -(void)testDatesCalcZeroResolutionIsForbidden
STAssertThrows
(
[ [ ESDatesCalculator alloc ] initWithResolution: 0
- startDate: [ NSDate date ]
- endDate: [ NSDate date ] ],
+ startDate: [ NSDate new ]
+ endDate: [ NSDate new ] ],
@"Zero resolution is undefined. ESDatesCalculator can't stand it"
);
#pragma clang diagnostic pop
@@ -112,11 +112,10 @@ -(void)testStartDateShouldBeLessThanEndDate
{
NSDate* beg_ = nil;
NSDate* fin_ = nil;
-
-
+
NSDateFormatter* df_ = [ ESLocaleFactory posixDateFormatter ];
df_.dateFormat = @"yyyy-MM-dd";
-
+
{
beg_ = [ df_ dateFromString: @"1648-04-29" ];
fin_ = [ df_ dateFromString: @"2011-10-23" ];
@@ -14,8 +14,6 @@ @implementation HalfYearNumberTest
NSDateFormatter* _ansiFormatter;
}
-@synthesize ansiDateFormatter = _ansiFormatter;
-
-(NSDateFormatter*)ansiDateFormatter
{
if ( nil == self->_ansiFormatter )
@@ -45,7 +43,7 @@ -(void)testHalfYearRejectsNilInput
}
{
- result_ = [ SqlitePersistentDateFormatter halfYearForDate: [ NSDate date ]
+ result_ = [ SqlitePersistentDateFormatter halfYearForDate: [ NSDate new ]
usingCalendar: nil ];
STAssertTrue( -2 == result_, @"valid error code expected - %d", result_ );

0 comments on commit 1992654

Please sign in to comment.