Skip to content

Commit

Permalink
Fixed the compiler warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yosuke Matsuda committed Dec 3, 2015
1 parent 702dcd7 commit 5ce586e
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 3 deletions.
2 changes: 2 additions & 0 deletions AWSCore/AWSCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
#import "AWSCategory.h"
#import "AWSLogging.h"
#import "AWSClientContext.h"
#import "AWSSynchronizedMutableDictionary.h"

#import "AWSSTS.h"
#import "AWSCognitoIdentity.h"

#import "AWSBolts.h"
#import "AWSGZIP.h"
#import "AWSFMDB.h"
2 changes: 1 addition & 1 deletion AWSCore/FMDB/AWSFMDatabase.m
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ - (int)lastErrorCode {
- (NSError*)errorWithMessage:(NSString*)message {
NSDictionary* errorMessage = [NSDictionary dictionaryWithObject:message forKey:NSLocalizedDescriptionKey];

return [NSError errorWithDomain:@"FMDatabase" code:sqlite3_errcode(_db) userInfo:errorMessage];
return [NSError errorWithDomain:@"AWSFMDatabase" code:sqlite3_errcode(_db) userInfo:errorMessage];
}

- (NSError*)lastError {
Expand Down
2 changes: 1 addition & 1 deletion AWSCore/FMDB/AWSFMResultSet.m
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ - (BOOL)nextWithError:(NSError **)outErr {
// If 'next' or 'nextWithError' is called after the result set is closed,
// we need to return the appropriate error.
NSDictionary* errorMessage = [NSDictionary dictionaryWithObject:@"parentDB does not exist" forKey:NSLocalizedDescriptionKey];
*outErr = [NSError errorWithDomain:@"FMDatabase" code:SQLITE_MISUSE userInfo:errorMessage];
*outErr = [NSError errorWithDomain:@"AWSFMDatabase" code:SQLITE_MISUSE userInfo:errorMessage];
}

}
Expand Down
2 changes: 2 additions & 0 deletions AWSCore/Service/AWSService.m
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,8 @@ - (NSURL *)URLWithRegion:(AWSRegionType)regionType
} else if (serviceType == AWSServiceSTS) {
if (regionType == AWSRegionCNNorth1) {
URL = [NSURL URLWithString:@"https://sts.cn-north-1.amazonaws.com"];
} else if (regionType == AWSRegionUSGovWest1) {
URL = [NSURL URLWithString:@"https://sts.us-gov-west-1.amazonaws.com"];
} else {
URL = [NSURL URLWithString:@"https://sts.amazonaws.com"];
}
Expand Down
24 changes: 23 additions & 1 deletion AWSCoreTests/AWSServiceTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ - (void)testEndpoint {
XCTAssertEqualObjects(endpoint.hostName, @"sqs.us-east-1.amazonaws.com");
XCTAssertFalse(endpoint.useUnsafeURL);

// Special cases
// ===== Special cases =====
endpoint = [[AWSEndpoint alloc] initWithRegion:AWSRegionUSEast1
service:AWSServiceSTS
useUnsafeURL:NO];
Expand All @@ -269,6 +269,17 @@ - (void)testEndpoint {
XCTAssertEqualObjects(endpoint.hostName, @"sts.cn-north-1.amazonaws.com.cn");
XCTAssertFalse(endpoint.useUnsafeURL);

endpoint = [[AWSEndpoint alloc] initWithRegion:AWSRegionUSGovWest1
service:AWSServiceSTS
useUnsafeURL:NO];
XCTAssertEqual(endpoint.regionType, AWSRegionUSGovWest1);
XCTAssertEqualObjects(endpoint.regionName, @"us-gov-west-1");
XCTAssertEqual(endpoint.serviceType, AWSServiceSTS);
XCTAssertEqualObjects(endpoint.serviceName, @"sts");
XCTAssertEqualObjects(endpoint.URL, [NSURL URLWithString:@"https://sts.us-gov-west-1.amazonaws.com"]);
XCTAssertEqualObjects(endpoint.hostName, @"sts.us-gov-west-1.amazonaws.com");
XCTAssertFalse(endpoint.useUnsafeURL);

endpoint = [[AWSEndpoint alloc] initWithRegion:AWSRegionUSEast1
service:AWSServiceSimpleDB
useUnsafeURL:NO];
Expand Down Expand Up @@ -324,6 +335,17 @@ - (void)testEndpoint {
XCTAssertEqualObjects(endpoint.hostName, @"s3-us-west-2.amazonaws.com");
XCTAssertTrue(endpoint.useUnsafeURL);

endpoint = [[AWSEndpoint alloc] initWithRegion:AWSRegionUSGovWest1
service:AWSServiceS3
useUnsafeURL:NO];
XCTAssertEqual(endpoint.regionType, AWSRegionUSGovWest1);
XCTAssertEqualObjects(endpoint.regionName, @"us-gov-west-1");
XCTAssertEqual(endpoint.serviceType, AWSServiceS3);
XCTAssertEqualObjects(endpoint.serviceName, @"s3");
XCTAssertEqualObjects(endpoint.URL, [NSURL URLWithString:@"https://s3-us-gov-west-1.amazonaws.com"]);
XCTAssertEqualObjects(endpoint.hostName, @"s3-us-gov-west-1.amazonaws.com");
XCTAssertFalse(endpoint.useUnsafeURL);

__block BOOL didThrowException = NO;
@try {
endpoint = [[AWSEndpoint alloc] initWithRegion:AWSRegionUnknown
Expand Down
3 changes: 3 additions & 0 deletions AWSSimpleDB/AWSSimpleDBService.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,10 @@ NS_ASSUME_NONNULL_BEGIN
@see AWSSimpleDBSelectRequest
@see AWSSimpleDBSelectResult
*/
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnullability"
- (AWSTask *)select:(AWSSimpleDBSelectRequest *)request;
#pragma clang diagnostic pop

@end

Expand Down

0 comments on commit 5ce586e

Please sign in to comment.