XCTest 异步返回测试用例的问题


Xcode 6,OSX SDK 10.0,系统是10.9

代码:


 -(void)testSearchMusic {
    XCTestExpectation *expectation = [self expectationWithDescription:@"searchMusic"];
  [musicSDK searchMusicWithKw:@"回家"
                        block:^(NSArray *list){
                          XCTAssert(list, @"pass");
                          [expectation fulfill];
                        }];

    [self waitForExpectationsWithTimeout:10
                                 handler:nil];

}

执行测试用例的时候,提示:

test failure: -[NetEaseMusicSDKTests testSearchMusic] failed: failed: caught "NSInvalidArgumentException", "*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[4]"

求助

objecive-c xcode

颓废的Kim 10 years, 3 months ago

Your Answer