@@ -83,7 +83,7 @@ - (void)testNewUserDefaultsWithStandardUserDefaults {
83
83
XCTAssertEqualObjects ([userDefaults objectForKey: key3], array);
84
84
85
85
NSString *key4 = @" DictionaryKey" ;
86
- NSDictionary *dictionary = @{ @" testing" : @" Hi there!" };
86
+ NSDictionary *dictionary = @{@" testing" : @" Hi there!" };
87
87
[newUserDefaults setObject: dictionary forKey: key4];
88
88
XCTAssertEqualObjects ([newUserDefaults objectForKey: key4], dictionary);
89
89
XCTAssertEqualObjects ([newUserDefaults dictionaryForKey: key4], dictionary);
@@ -115,8 +115,8 @@ - (void)testNewUserDefaultsWithStandardUserDefaults {
115
115
XCTAssertNotNil ([userDefaults objectForKey: key7]);
116
116
XCTAssertEqualWithAccuracy ([testDate timeIntervalSinceDate: [newUserDefaults objectForKey: key7]],
117
117
0.0 , sEpsilon );
118
- XCTAssertEqualWithAccuracy ([testDate timeIntervalSinceDate: [userDefaults objectForKey: key7]],
119
- 0.0 , sEpsilon );
118
+ XCTAssertEqualWithAccuracy ([testDate timeIntervalSinceDate: [userDefaults objectForKey: key7]], 0.0 ,
119
+ sEpsilon );
120
120
121
121
NSString *key8 = @" FloatKey" ;
122
122
[newUserDefaults setFloat: 0.99 forKey: key8];
@@ -146,7 +146,7 @@ - (void)testNewUserDefaultsWithStandardUserDefaults {
146
146
XCTAssertEqualObjects ([newUserDefaults arrayForKey: key3], array2);
147
147
XCTAssertEqualObjects ([userDefaults objectForKey: key3], array2);
148
148
149
- NSDictionary *dictionary2 = @{ @" testing 2" : @3 };
149
+ NSDictionary *dictionary2 = @{@" testing 2" : @3 };
150
150
[newUserDefaults setObject: dictionary2 forKey: key4];
151
151
XCTAssertEqualObjects ([newUserDefaults objectForKey: key4], dictionary2);
152
152
XCTAssertEqualObjects ([newUserDefaults dictionaryForKey: key4], dictionary2);
@@ -202,7 +202,7 @@ - (void)testNSUserDefaultsWithNewUserDefaults {
202
202
XCTAssertEqualObjects ([userDefaults objectForKey: key3], array);
203
203
204
204
NSString *key4 = @" DictionaryKey" ;
205
- NSDictionary *dictionary = @{ @" testing" : @" Hi there!" };
205
+ NSDictionary *dictionary = @{@" testing" : @" Hi there!" };
206
206
[userDefaults setObject: dictionary forKey: key4];
207
207
XCTAssertEqualObjects ([newUserDefaults objectForKey: key4], dictionary);
208
208
XCTAssertEqualObjects ([newUserDefaults dictionaryForKey: key4], dictionary);
@@ -234,8 +234,8 @@ - (void)testNSUserDefaultsWithNewUserDefaults {
234
234
XCTAssertNotNil ([userDefaults objectForKey: key7]);
235
235
XCTAssertEqualWithAccuracy ([testDate timeIntervalSinceDate: [newUserDefaults objectForKey: key7]],
236
236
0.0 , sEpsilon );
237
- XCTAssertEqualWithAccuracy ([testDate timeIntervalSinceDate: [userDefaults objectForKey: key7]],
238
- 0.0 , sEpsilon );
237
+ XCTAssertEqualWithAccuracy ([testDate timeIntervalSinceDate: [userDefaults objectForKey: key7]], 0.0 ,
238
+ sEpsilon );
239
239
240
240
NSString *key8 = @" FloatKey" ;
241
241
[userDefaults setFloat: 0.99 forKey: key8];
@@ -265,7 +265,7 @@ - (void)testNSUserDefaultsWithNewUserDefaults {
265
265
XCTAssertEqualObjects ([newUserDefaults arrayForKey: key3], array2);
266
266
XCTAssertEqualObjects ([userDefaults objectForKey: key3], array2);
267
267
268
- NSDictionary *dictionary2 = @{ @" testing 2" : @3 };
268
+ NSDictionary *dictionary2 = @{@" testing 2" : @3 };
269
269
[userDefaults setObject: dictionary2 forKey: key4];
270
270
XCTAssertEqualObjects ([newUserDefaults objectForKey: key4], dictionary2);
271
271
XCTAssertEqualObjects ([newUserDefaults dictionaryForKey: key4], dictionary2);
@@ -322,7 +322,7 @@ - (void)testNewSharedUserDefaultsWithStandardUserDefaults {
322
322
XCTAssertEqualObjects ([userDefaults objectForKey: key3], array);
323
323
324
324
NSString *key4 = @" DictionaryKey" ;
325
- NSDictionary *dictionary = @{ @" testing" : @" Hi there!" };
325
+ NSDictionary *dictionary = @{@" testing" : @" Hi there!" };
326
326
[userDefaults setObject: dictionary forKey: key4];
327
327
XCTAssertEqualObjects ([newUserDefaults objectForKey: key4], dictionary);
328
328
XCTAssertEqualObjects ([newUserDefaults dictionaryForKey: key4], dictionary);
@@ -354,8 +354,8 @@ - (void)testNewSharedUserDefaultsWithStandardUserDefaults {
354
354
XCTAssertNotNil ([userDefaults objectForKey: key7]);
355
355
XCTAssertEqualWithAccuracy ([testDate timeIntervalSinceDate: [newUserDefaults objectForKey: key7]],
356
356
0.0 , sEpsilon );
357
- XCTAssertEqualWithAccuracy ([testDate timeIntervalSinceDate: [userDefaults objectForKey: key7]],
358
- 0.0 , sEpsilon );
357
+ XCTAssertEqualWithAccuracy ([testDate timeIntervalSinceDate: [userDefaults objectForKey: key7]], 0.0 ,
358
+ sEpsilon );
359
359
360
360
// Remove all of the objects from the normal NSUserDefaults. The values from the new user
361
361
// defaults must also be cleared!
@@ -380,7 +380,7 @@ - (void)testNewSharedUserDefaultsWithStandardUserDefaults {
380
380
XCTAssertEqualObjects ([newUserDefaults arrayForKey: key3], array2);
381
381
XCTAssertEqualObjects ([userDefaults objectForKey: key3], array2);
382
382
383
- NSDictionary *dictionary2 = @{ @" testing 2" : @3 };
383
+ NSDictionary *dictionary2 = @{@" testing 2" : @3 };
384
384
[userDefaults setObject: dictionary2 forKey: key4];
385
385
XCTAssertEqualObjects ([newUserDefaults objectForKey: key4], dictionary2);
386
386
XCTAssertEqualObjects ([userDefaults objectForKey: key4], dictionary2);
@@ -413,10 +413,10 @@ - (void)testUserDefaultNotifications {
413
413
};
414
414
415
415
id observer =
416
- [[NSNotificationCenter defaultCenter ] addObserverForName: NSUserDefaultsDidChangeNotification
417
- object: nil
418
- queue: nil
419
- usingBlock: callBlock];
416
+ [[NSNotificationCenter defaultCenter ] addObserverForName: NSUserDefaultsDidChangeNotification
417
+ object: nil
418
+ queue: nil
419
+ usingBlock: callBlock];
420
420
NSString *suiteName = @" test_suite_notification" ;
421
421
GULUserDefaults *newUserDefaults = [[GULUserDefaults alloc ] initWithSuiteName: suiteName];
422
422
[newUserDefaults setObject: @" 134" forKey: @" test-another" ];
@@ -453,7 +453,8 @@ - (void)testSynchronizeToDisk {
453
453
[newUserDefaults setObject: @" 134" forKey: @" test-another" ];
454
454
[newUserDefaults synchronize ];
455
455
456
- XCTAssertTrue ([fileManager fileExistsAtPath: filePath], @" The user defaults file was not synchronized to disk." );
456
+ XCTAssertTrue ([fileManager fileExistsAtPath: filePath],
457
+ @" The user defaults file was not synchronized to disk." );
457
458
458
459
// Now get the file directly from disk.
459
460
XCTAssertTrue ([fileManager fileExistsAtPath: filePath]);
@@ -564,7 +565,7 @@ - (void)testNewUserDefaultsThreadSafeAddingObjects {
564
565
XCTestExpectation *expectation = [self expectationForPredicate: dictionarySize
565
566
evaluatedWithObject: dictionary
566
567
handler: nil ];
567
- [self waitForExpectations: @[expectation] timeout: kGULTestCaseTimeoutInterval ];
568
+ [self waitForExpectations: @[ expectation ] timeout: kGULTestCaseTimeoutInterval ];
568
569
569
570
for (int i = 0 ; i < itemCount; i++) {
570
571
NSString *key = [NSString stringWithFormat: @" %d " , i];
@@ -608,7 +609,7 @@ - (void)testNewUserDefaultsRemovingObjects {
608
609
XCTestExpectation *expectation = [self expectationForPredicate: emptyDictionary
609
610
evaluatedWithObject: dictionary
610
611
handler: nil ];
611
- [self waitForExpectations: @[expectation] timeout: kGULTestCaseTimeoutInterval ];
612
+ [self waitForExpectations: @[ expectation ] timeout: kGULTestCaseTimeoutInterval ];
612
613
613
614
for (int i = 0 ; i < itemCount; i++) {
614
615
NSString *key = [NSString stringWithFormat: @" %d " , i];
@@ -649,7 +650,7 @@ - (void)testNewUserDefaultsRemovingSomeObjects {
649
650
XCTestExpectation *expectation = [self expectationForPredicate: dictionarySize
650
651
evaluatedWithObject: dictionary
651
652
handler: nil ];
652
- [self waitForExpectations: @[expectation] timeout: kGULTestCaseTimeoutInterval ];
653
+ [self waitForExpectations: @[ expectation ] timeout: kGULTestCaseTimeoutInterval ];
653
654
654
655
// Check the remaining of the user defaults.
655
656
for (int i = 0 ; i < itemCount; i++) {
@@ -691,7 +692,7 @@ - (void)testBothUserDefaultsThreadSafeAddingObjects {
691
692
XCTestExpectation *expectation = [self expectationForPredicate: dictionarySize
692
693
evaluatedWithObject: dictionary
693
694
handler: nil ];
694
- [self waitForExpectations: @[expectation] timeout: kGULTestCaseTimeoutInterval ];
695
+ [self waitForExpectations: @[ expectation ] timeout: kGULTestCaseTimeoutInterval ];
695
696
696
697
for (int i = 0 ; i < itemCount; i++) {
697
698
NSString *key = [NSString stringWithFormat: @" %d " , i];
@@ -739,7 +740,7 @@ - (void)testBothUserDefaultsRemovingSomeObjects {
739
740
XCTestExpectation *expectation = [self expectationForPredicate: dictionarySize
740
741
evaluatedWithObject: dictionary
741
742
handler: nil ];
742
- [self waitForExpectations: @[expectation] timeout: kGULTestCaseTimeoutInterval ];
743
+ [self waitForExpectations: @[ expectation ] timeout: kGULTestCaseTimeoutInterval ];
743
744
744
745
// Check the remaining of the user defaults.
745
746
for (int i = 0 ; i < itemCount; i++) {
@@ -828,10 +829,8 @@ - (NSString *)filePathForPreferencesName:(NSString *)preferencesName {
828
829
XCTFail (@" Library directory not found - NSSearchPath results are empty." );
829
830
}
830
831
NSArray *components = @[
831
- paths.lastObject,
832
- @" Preferences" ,
833
- [preferencesName stringByAppendingPathExtension: @" plist" ]
834
- ];
832
+ paths.lastObject, @" Preferences" , [preferencesName stringByAppendingPathExtension: @" plist" ]
833
+ ];
835
834
return [NSString pathWithComponents: components];
836
835
}
837
836
0 commit comments