Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
language: objective-c
osx_image: xcode7
osx_image: xcode9

before_install:
- rvm install 2.3.1
- rvm use 2.3.1
- brew update
- brew outdated xctool || brew upgrade xctool
- gem install cocoapods --pre
- pod --version
- pod repo remove master
Expand All @@ -17,5 +16,8 @@ before_script:
- export QINIU_TEST_ENV="travis"

script:
- xctool -workspace QiniuSDK.xcworkspace -scheme QiniuSDK_iOS -sdk iphonesimulator -configuration Release test -test-sdk iphonesimulator9.0 -freshInstall -freshSimulator
- xctool -workspace QiniuSDK.xcworkspace -scheme QiniuSDK_Mac -sdk macosx -configuration Release test -test-sdk macosx
- xcodebuild test -workspace QiniuSDK.xcworkspace -scheme QiniuSDK_iOS -configuration Release -destination 'platform=iOS Simulator,OS=11.0,name=iPhone SE'
- xcodebuild test -workspace QiniuSDK.xcworkspace -scheme QiniuSDK_Mac -configuration Release -destination 'platform=macOS,arch=x86_64'

after_success:
- bash <(curl -s https://codecov.io/bash)
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand All @@ -43,9 +44,10 @@
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand All @@ -52,9 +53,10 @@
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
1 change: 0 additions & 1 deletion QiniuSDK/Http/QNSessionManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task
self.task =nil;
self.cancelBlock = nil;
self.progressBlock = nil;
// [session finishTasksAndInvalidate];
}
}

Expand Down
42 changes: 21 additions & 21 deletions QiniuSDKTests/QNFileRecorderTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ - (void) template:(int)size pos:(float)pos {
info = nil;
__block BOOL failed = NO;
opt = [[QNUploadOption alloc] initWithMime:nil progressHandler:^(NSString *key, float percent) {
if (percent < pos - (256 * 1024.0) / (size * 1024.0)) {
if (percent < pos - 256.0 / size ) {
failed = YES;
}
NSLog(@"continue progress %f", percent);
Expand All @@ -104,29 +104,29 @@ - (void)tearDown {
[super tearDown];
}

- (void)test600k {
[self template:600 pos:0.3];
}
//- (void)test600k {
// [self template:600 pos:0.7];
//}

- (void)test700k {
[self template:700 pos:0.1];
}
//- (void)test700k {
// [self template:700 pos:0.1];
//}

#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED
//#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED

- (void)test1M {
if (_inTravis) {
return;
}
[self template:1024 pos:0.51];
}
//- (void)test1M {
// if (_inTravis) {
// return;
// }
// [self template:1024 pos:0.51];
//}

- (void)test4M {
if (_inTravis) {
return;
}
[self template:4 * 1024 pos:0.9];
}
//- (void)test4M {
// if (_inTravis) {
// return;
// }
// [self template:4 * 1024 pos:0.9];
//}

- (void)test8M {
if (_inTravis) {
Expand All @@ -135,6 +135,6 @@ - (void)test8M {
[self template:8 * 1024 + 1 pos:0.8];
}

#endif
//#endif

@end
3 changes: 2 additions & 1 deletion QiniuSDKTests/QNSessionTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ - (void)testPost {

AGWW_WAIT_WHILE(testInfo == nil, 100.0);
NSLog(@"%@", testInfo);
XCTAssert(testInfo.statusCode == 500, @"Pass");
XCTAssert((testInfo.statusCode == 500), @"Pass");
XCTAssert(testInfo.error != nil, @"Pass");

testInfo = nil;
Expand All @@ -88,6 +88,7 @@ - (void)testPost {

testInfo = nil;
[_httpManager post:@"http://httpbin.org/status/200" withData:data withParams:nil withHeaders:nil withCompleteBlock:^(QNResponseInfo *info, NSDictionary *resp) {

testInfo = info;
}
withProgressBlock:nil
Expand Down