Skip to content

Commit cc8b25c

Browse files
committed
optimize test case
1 parent c68eef6 commit cc8b25c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

QiniuSDKTests/QNDnsPrefetcherTest.m

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,18 @@ @implementation InetAddress
2727
@end
2828

2929
#define CustomIPValue @"192.168.1.1"
30+
#define kCustomHost @"uplog.qbox.me"
31+
#define kDnsTestToken token_na0
32+
3033
@interface CustomDns : NSObject <QNDnsDelegate>
3134
@property(nonatomic, assign)BOOL isTestTtl;
3235
@end
3336
@implementation CustomDns
3437

3538
- (NSArray<id<QNIDnsNetworkAddress>> *)lookup:(NSString *)host{
39+
if (![host isEqualToString:kCustomHost]) {
40+
return nil;
41+
}
3642

3743
InetAddress *inetAddress = [[InetAddress alloc] init];
3844
inetAddress.hostValue = host;
@@ -56,8 +62,6 @@ @interface QNDnsPrefetcherTest : XCTestCase
5662

5763
@implementation QNDnsPrefetcherTest
5864

59-
#define kCustomHost @"uplog.qbox.me"
60-
#define kDnsTestToken token_na0
6165
- (void)setUp {
6266

6367
[kQNTransactionManager destroyResource];

0 commit comments

Comments
 (0)