@@ -233,8 +233,9 @@ - (void)testFetchConfigWithNilCallback {
233
233
NSMutableArray <XCTestExpectation *> *expectations =
234
234
[[NSMutableArray alloc ] initWithCapacity: RCNTestRCNumTotalInstances];
235
235
for (int i = 0 ; i < RCNTestRCNumTotalInstances; i++) {
236
- expectations[i] = [self expectationWithDescription: @" Set defaults no callback expectation" ];
237
-
236
+ expectations[i] = [self
237
+ expectationWithDescription:
238
+ [NSString stringWithFormat: @" Set defaults no callback expectation - instance %d " , i]];
238
239
XCTAssertEqual (_configInstances[i].lastFetchStatus , FIRRemoteConfigFetchStatusNoFetchYet);
239
240
240
241
[_configInstances[i] fetchWithExpirationDuration: 43200 completionHandler: nil ];
@@ -253,7 +254,9 @@ - (void)testFetchConfigsSuccessfully {
253
254
NSMutableArray <XCTestExpectation *> *expectations =
254
255
[[NSMutableArray alloc ] initWithCapacity: RCNTestRCNumTotalInstances];
255
256
for (int i = 0 ; i < RCNTestRCNumTotalInstances; i++) {
256
- expectations[i] = [self expectationWithDescription: @" Test fetch configs successfully." ];
257
+ expectations[i] =
258
+ [self expectationWithDescription:
259
+ [NSString stringWithFormat: @" Test fetch configs successfully - instance %d " , i]];
257
260
XCTAssertEqual (_configInstances[i].lastFetchStatus , FIRRemoteConfigFetchStatusNoFetchYet);
258
261
FIRRemoteConfigFetchCompletion fetchCompletion =
259
262
^void (FIRRemoteConfigFetchStatus status, NSError *error) {
@@ -294,7 +297,9 @@ - (void)testFetchAndActivate {
294
297
NSMutableArray <XCTestExpectation *> *expectations =
295
298
[[NSMutableArray alloc ] initWithCapacity: RCNTestRCNumTotalInstances];
296
299
for (int i = 0 ; i < RCNTestRCNumTotalInstances; i++) {
297
- expectations[i] = [self expectationWithDescription: @" Test fetch configs successfully." ];
300
+ expectations[i] =
301
+ [self expectationWithDescription:
302
+ [NSString stringWithFormat: @" Test fetch configs successfully - instance %d " , i]];
298
303
XCTAssertEqual (_configInstances[i].lastFetchStatus , FIRRemoteConfigFetchStatusNoFetchYet);
299
304
FIRRemoteConfigFetchAndActivateCompletion fetchAndActivateCompletion = ^void (
300
305
FIRRemoteConfigFetchAndActivateStatus status, NSError *error) {
@@ -339,7 +344,9 @@ - (void)testFetchConfigsSuccessfullyWithNewActivateMethodSignature {
339
344
NSMutableArray <XCTestExpectation *> *expectations =
340
345
[[NSMutableArray alloc ] initWithCapacity: RCNTestRCNumTotalInstances];
341
346
for (int i = 0 ; i < RCNTestRCNumTotalInstances; i++) {
342
- expectations[i] = [self expectationWithDescription: @" Test fetch configs successfully." ];
347
+ expectations[i] =
348
+ [self expectationWithDescription:
349
+ [NSString stringWithFormat: @" Test fetch configs successfully - instance %d " , i]];
343
350
XCTAssertEqual (_configInstances[i].lastFetchStatus , FIRRemoteConfigFetchStatusNoFetchYet);
344
351
FIRRemoteConfigFetchCompletion fetchCompletion =
345
352
^(FIRRemoteConfigFetchStatus status, NSError *error) {
@@ -384,8 +391,9 @@ - (void)testEnumeratingConfigResults {
384
391
NSMutableArray <XCTestExpectation *> *expectations =
385
392
[[NSMutableArray alloc ] initWithCapacity: RCNTestRCNumTotalInstances];
386
393
for (int i = 0 ; i < RCNTestRCNumTotalInstances; i++) {
387
- expectations[i] = [self expectationWithDescription: @" Test enumerating configs successfully." ];
388
-
394
+ expectations[i] = [self
395
+ expectationWithDescription:
396
+ [NSString stringWithFormat: @" Test enumerating configs successfully - instance %d " , i]];
389
397
XCTAssertEqual (_configInstances[i].lastFetchStatus , FIRRemoteConfigFetchStatusNoFetchYet);
390
398
FIRRemoteConfigFetchCompletion fetchCompletion =
391
399
^void (FIRRemoteConfigFetchStatus status, NSError *error) {
@@ -526,9 +534,11 @@ - (void)testFetchConfigsFailed {
526
534
// Make the fetch calls for all instances.
527
535
NSMutableArray <XCTestExpectation *> *expectations =
528
536
[[NSMutableArray alloc ] initWithCapacity: RCNTestRCNumTotalInstances];
529
- for (int i = 0 ; i < RCNTestRCNumTotalInstances; i++) {
530
- expectations[i] = [self expectationWithDescription: @" Test enumerating configs successfully." ];
531
537
538
+ for (int i = 0 ; i < RCNTestRCNumTotalInstances; i++) {
539
+ expectations[i] = [self
540
+ expectationWithDescription:
541
+ [NSString stringWithFormat: @" Test enumerating configs successfully - instance %d " , i]];
532
542
XCTAssertEqual (_configInstances[i].lastFetchStatus , FIRRemoteConfigFetchStatusNoFetchYet);
533
543
FIRRemoteConfigFetchCompletion fetchCompletion =
534
544
^void (FIRRemoteConfigFetchStatus status, NSError *error) {
@@ -554,8 +564,9 @@ - (void)testConfigValueForKey {
554
564
NSMutableArray <XCTestExpectation *> *expectations =
555
565
[[NSMutableArray alloc ] initWithCapacity: RCNTestRCNumTotalInstances];
556
566
for (int i = 0 ; i < RCNTestRCNumTotalInstances; i++) {
557
- expectations[i] = [self expectationWithDescription: @" Test configValueForKey: method." ];
558
-
567
+ expectations[i] =
568
+ [self expectationWithDescription:
569
+ [NSString stringWithFormat: @" Test configValueForKey: method - instance %d " , i]];
559
570
XCTAssertEqual (_configInstances[i].lastFetchStatus , FIRRemoteConfigFetchStatusNoFetchYet);
560
571
FIRRemoteConfigFetchCompletion fetchCompletion = ^void (FIRRemoteConfigFetchStatus status,
561
572
NSError *error) {
@@ -602,16 +613,18 @@ - (void)testConfigValueForKey {
602
613
}
603
614
604
615
- (void )testFetchConfigWithDefaultSets {
616
+ NSMutableArray <XCTestExpectation *> *fetchConfigsExpectation =
617
+ [[NSMutableArray alloc ] initWithCapacity: RCNTestRCNumTotalInstances];
605
618
for (int i = 0 ; i < RCNTestRCNumTotalInstances; i++) {
619
+ fetchConfigsExpectation[i] = [self
620
+ expectationWithDescription:
621
+ [NSString stringWithFormat: @" Test fetch configs with defaults set - instance %d " , i]];
606
622
NSString *key1 = [NSString stringWithFormat: @" key1-%d " , i];
607
623
NSString *key2 = [NSString stringWithFormat: @" key2-%d " , i];
608
624
NSString *key0 = [NSString stringWithFormat: @" key0-%d " , i];
609
625
NSString *value1 = [NSString stringWithFormat: @" value1-%d " , i];
610
626
NSString *value2 = [NSString stringWithFormat: @" value2-%d " , i];
611
627
612
- XCTestExpectation *fetchConfigsExpectation =
613
- [self expectationWithDescription: @" Test fetch configs with defaults set." ];
614
-
615
628
NSDictionary <NSString *, NSString *> *defaults = @{key1 : @" default key1" , key0 : @" value0-0" };
616
629
[_configInstances[i] setDefaults: defaults];
617
630
@@ -639,7 +652,7 @@ - (void)testFetchConfigWithDefaultSets {
639
652
XCTAssertEqual (status, FIRRemoteConfigFetchStatusSuccess,
640
653
@" Callback of first successful config "
641
654
@" fetch. Status must equal to FIRRemoteConfigFetchStatusSuccess." );
642
- [fetchConfigsExpectation fulfill ];
655
+ [fetchConfigsExpectation[i] fulfill ];
643
656
};
644
657
[_configInstances[i] fetchWithExpirationDuration: 43200 completionHandler: fetchCompletion];
645
658
}
@@ -708,9 +721,12 @@ - (void)testDefaultsSetsOnly {
708
721
}
709
722
710
723
- (void )testSetDefaultsWithNilParams {
724
+ NSMutableArray <XCTestExpectation *> *expectations =
725
+ [[NSMutableArray alloc ] initWithCapacity: RCNTestRCNumTotalInstances];
711
726
for (int i = 0 ; i < RCNTestRCNumTotalInstances; i++) {
712
- XCTestExpectation *expectation =
713
- [self expectationWithDescription: @" Set defaults no callback expectation" ];
727
+ expectations[i] = [self
728
+ expectationWithDescription:
729
+ [NSString stringWithFormat: @" Set defaults no callback expectation - instance %d " , i]];
714
730
// Should work when passing nil.
715
731
[_configInstances[i] setDefaults: nil ];
716
732
[_configInstances[i] setDefaults: nil namespace: nil ];
@@ -722,20 +738,22 @@ - (void)testSetDefaultsWithNilParams {
722
738
namespace: FIRNamespaceGoogleMobilePlatform]
723
739
.count ,
724
740
0 );
725
- [expectation fulfill ];
741
+ [expectations[i] fulfill ];
726
742
});
727
743
}
728
744
[self waitForExpectationsWithTimeout: _expectationTimeout handler: nil ];
729
745
}
730
746
731
747
- (void )testFetchConfigOverwriteDefaultSet {
748
+ NSMutableArray <XCTestExpectation *> *fetchConfigsExpectation =
749
+ [[NSMutableArray alloc ] initWithCapacity: RCNTestRCNumTotalInstances];
732
750
for (int i = 0 ; i < RCNTestRCNumTotalInstances; i++) {
751
+ fetchConfigsExpectation[i] = [self
752
+ expectationWithDescription:
753
+ [NSString stringWithFormat: @" Test fetch configs with defaults set - instance %d " , i]];
733
754
NSString *key1 = [NSString stringWithFormat: @" key1-%d " , i];
734
755
NSString *value1 = [NSString stringWithFormat: @" value1-%d " , i];
735
756
736
- XCTestExpectation *fetchConfigsExpectation =
737
- [self expectationWithDescription: @" Test fetch configs overwrites defaults set." ];
738
-
739
757
[_configInstances[i] setDefaults: @{key1 : @" default key1" }];
740
758
741
759
FIRRemoteConfigValue *value = _configInstances[i][key1];
@@ -759,7 +777,7 @@ - (void)testFetchConfigOverwriteDefaultSet {
759
777
XCTAssertEqual (status, FIRRemoteConfigFetchStatusSuccess,
760
778
@" Callback of first successful config "
761
779
@" fetch. Status must equal to FIRRemoteConfigFetchStatusSuccess." );
762
- [fetchConfigsExpectation fulfill ];
780
+ [fetchConfigsExpectation[i] fulfill ];
763
781
};
764
782
765
783
[_configInstances[i] fetchWithExpirationDuration: 43200 completionHandler: fetchCompletion];
@@ -771,11 +789,14 @@ - (void)testFetchConfigOverwriteDefaultSet {
771
789
}
772
790
773
791
- (void )testGetConfigValueBySource {
792
+ NSMutableArray <XCTestExpectation *> *fetchConfigsExpectation =
793
+ [[NSMutableArray alloc ] initWithCapacity: RCNTestRCNumTotalInstances];
774
794
for (int i = 0 ; i < RCNTestRCNumTotalInstances; i++) {
795
+ fetchConfigsExpectation[i] =
796
+ [self expectationWithDescription:
797
+ [NSString stringWithFormat: @" Test get config value by source - instance %d " , i]];
775
798
NSString *key1 = [NSString stringWithFormat: @" key1-%d " , i];
776
799
NSString *value1 = [NSString stringWithFormat: @" value1-%d " , i];
777
- XCTestExpectation *fetchConfigsExpectation =
778
- [self expectationWithDescription: @" Test get config value by source." ];
779
800
780
801
NSDictionary <NSString *, NSString *> *defaults = @{key1 : @" default value1" };
781
802
[_configInstances[i] setDefaults: defaults];
@@ -816,7 +837,7 @@ - (void)testGetConfigValueBySource {
816
837
XCTAssertEqual (status, FIRRemoteConfigFetchStatusSuccess,
817
838
@" Callback of first successful config "
818
839
@" fetch. Status must equal to FIRRemoteConfigFetchStatusSuccess." );
819
- [fetchConfigsExpectation fulfill ];
840
+ [fetchConfigsExpectation[i] fulfill ];
820
841
};
821
842
[_configInstances[i] fetchWithExpirationDuration: 43200 completionHandler: fetchCompletion];
822
843
}
@@ -942,9 +963,12 @@ - (void)testSetDeveloperMode {
942
963
}
943
964
944
965
- (void )testAllKeysFromSource {
966
+ NSMutableArray <XCTestExpectation *> *fetchConfigsExpectation =
967
+ [[NSMutableArray alloc ] initWithCapacity: RCNTestRCNumTotalInstances];
945
968
for (int i = 0 ; i < RCNTestRCNumTotalInstances; i++) {
946
- XCTestExpectation *fetchConfigsExpectation =
947
- [self expectationWithDescription: @" Test allKeys methods." ];
969
+ fetchConfigsExpectation[i] = [self
970
+ expectationWithDescription: [NSString
971
+ stringWithFormat: @" Test allKeys methods - instance %d " , i]];
948
972
NSString *key1 = [NSString stringWithFormat: @" key1-%d " , i];
949
973
NSString *key0 = [NSString stringWithFormat: @" key0-%d " , i];
950
974
NSDictionary <NSString *, NSString *> *defaults = @{key1 : @" default key1" , key0 : @" value0-0" };
@@ -995,7 +1019,7 @@ - (void)testAllKeysFromSource {
995
1019
[_configInstances[i] allKeysFromSource: FIRRemoteConfigSourceDefault namespace: nil ].count ,
996
1020
0 );
997
1021
998
- [fetchConfigsExpectation fulfill ];
1022
+ [fetchConfigsExpectation[i] fulfill ];
999
1023
};
1000
1024
[_configInstances[i] fetchWithExpirationDuration: 43200 completionHandler: fetchCompletion];
1001
1025
}
@@ -1006,10 +1030,12 @@ - (void)testAllKeysFromSource {
1006
1030
}
1007
1031
1008
1032
- (void )testAllKeysWithPrefix {
1033
+ NSMutableArray <XCTestExpectation *> *fetchConfigsExpectation =
1034
+ [[NSMutableArray alloc ] initWithCapacity: RCNTestRCNumTotalInstances];
1009
1035
for (int i = 0 ; i < RCNTestRCNumTotalInstances; i++) {
1010
- XCTestExpectation * fetchConfigsExpectation =
1011
- [ self expectationWithDescription: @" Test allKeys methods. " ];
1012
-
1036
+ fetchConfigsExpectation[i] = [ self
1037
+ expectationWithDescription: [ NSString
1038
+ stringWithFormat: @" Test allKeys methods - instance %d " , i]];
1013
1039
FIRRemoteConfigFetchCompletion fetchCompletion =
1014
1040
^void (FIRRemoteConfigFetchStatus status, NSError *error) {
1015
1041
XCTAssertEqual (status, FIRRemoteConfigFetchStatusSuccess);
@@ -1046,7 +1072,7 @@ - (void)testAllKeysWithPrefix {
1046
1072
XCTAssertEqual ([_configInstances[i] keysWithPrefix: nil ].count , 100 );
1047
1073
XCTAssertEqual ([_configInstances[i] keysWithPrefix: @" " ].count , 100 );
1048
1074
1049
- [fetchConfigsExpectation fulfill ];
1075
+ [fetchConfigsExpectation[i] fulfill ];
1050
1076
};
1051
1077
[_configInstances[i] fetchWithExpirationDuration: 43200 completionHandler: fetchCompletion];
1052
1078
}
@@ -1074,10 +1100,12 @@ - (void)testSetDeveloperModeConfigSetting {
1074
1100
1075
1101
// / Test the minimum fetch interval is applied and read back correctly.
1076
1102
- (void )testSetMinimumFetchIntervalConfigSetting {
1103
+ NSMutableArray <XCTestExpectation *> *fetchConfigsExpectation =
1104
+ [[NSMutableArray alloc ] initWithCapacity: RCNTestRCNumTotalInstances];
1077
1105
for (int i = 0 ; i < RCNTestRCNumTotalInstances; i++) {
1078
- XCTestExpectation * fetchConfigsExpectation =
1079
- [ self expectationWithDescription: @" test minimumFetchInterval expectation. " ];
1080
-
1106
+ fetchConfigsExpectation[i] = [ self
1107
+ expectationWithDescription:
1108
+ [ NSString stringWithFormat: @" Test minimumFetchInterval expectation - instance %d " , i]];
1081
1109
FIRRemoteConfigSettings *settings = [[FIRRemoteConfigSettings alloc ] init ];
1082
1110
settings.minimumFetchInterval = 123 ;
1083
1111
[_configInstances[i] setConfigSettings: settings];
@@ -1093,7 +1121,7 @@ - (void)testSetMinimumFetchIntervalConfigSetting {
1093
1121
[_configInstances[i] setConfigSettings: settings];
1094
1122
XCTAssertEqual ([_configInstances[i] configSettings ].minimumFetchInterval , 0 );
1095
1123
XCTAssertTrue ([_configInstances[i].settings hasMinimumFetchIntervalElapsed: 0 ]);
1096
- [fetchConfigsExpectation fulfill ];
1124
+ [fetchConfigsExpectation[i] fulfill ];
1097
1125
};
1098
1126
[_configInstances[i] fetchWithExpirationDuration: 43200 completionHandler: fetchCompletion];
1099
1127
}
0 commit comments