File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -151,8 +151,19 @@ - (void)testReloadData
151151
152152 tableView.asyncDelegate = dataSource;
153153 tableView.asyncDataSource = dataSource;
154+
155+ XCTestExpectation *reloadDataExpectation = [self expectationWithDescription: @" reloadData" ];
154156
155- [tableView reloadData ];
157+ [tableView reloadDataWithCompletion: ^{
158+ NSLog (@" *** Reload Complete ***" );
159+ [reloadDataExpectation fulfill ];
160+ }];
161+
162+ [self waitForExpectationsWithTimeout: 5 handler: ^(NSError *error) {
163+ if (error) {
164+ XCTFail (@" Expectation failed: %@ " , error);
165+ }
166+ }];
156167
157168 for (int i = 0 ; i < NumberOfReloadIterations; ++i) {
158169 UITableViewRowAnimation rowAnimation = (arc4random_uniform (2 ) == 0 ? UITableViewRowAnimationMiddle : UITableViewRowAnimationNone);
You can’t perform that action at this time.
0 commit comments