Skip to content

Commit

Permalink
update test case
Browse files Browse the repository at this point in the history
  • Loading branch information
YangSen-qn committed Sep 25, 2023
1 parent eaf050b commit 5b0dff4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
20 changes: 14 additions & 6 deletions QiniuSDKTests/QNAutoZoneTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,23 @@ - (void)testClearAutoZoneCache {
AGWW_WAIT_WHILE(x == 0, 100.0);
XCTAssertEqual(0, c, @"c: %d", c);

QNZonesInfo *info = [autoZone getZonesInfoWithToken:tok];
XCTAssertTrue(info != nil , @"info is nil");
XCTAssertTrue(!info.isTemporary , @"info is temporary");
QNZonesInfo *infoBefore = [autoZone getZonesInfoWithToken:tok];
XCTAssertTrue(infoBefore != nil , @"info is nil");

// 清理缓存
[QNAutoZone clearCache];

info = [autoZone getZonesInfoWithToken:tok];
XCTAssertTrue(info != nil , @"after clear: info is nil");
XCTAssertTrue(info.isTemporary , @"after clear: info is not temporary");
x = 0;
c = 0;
[autoZone preQuery:tok on:^(int code, QNResponseInfo *info, QNUploadRegionRequestMetrics *metrics) {
x = 1;
c = code;
}];

QNZonesInfo *infoAfter = [autoZone getZonesInfoWithToken:tok];

XCTAssertTrue(infoAfter != nil , @"after clear: info is nil");
XCTAssertTrue(infoBefore != infoAfter , @"after clear: info is not temporary");
}

- (void)testHttp {
Expand Down
6 changes: 0 additions & 6 deletions QiniuSDKTests/QNNetworkStatusTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,6 @@ - (void)testNetworkStatusCompare {
dispatch_group_leave(group);
});

dispatch_group_async(group, dispatch_get_global_queue(0, 0), ^{
for (int i=0; i<100000; i++) {
[kQNNetworkStatusManager performSelector:@selector(recoverNetworkStatusFromDisk)];
}
});


dispatch_group_wait(group, dispatch_time(DISPATCH_TIME_NOW, 20 * NSEC_PER_SEC));
}
Expand Down

0 comments on commit 5b0dff4

Please sign in to comment.