Skip to content

Commit

Permalink
Merge pull request #89 from hyperledger/develop
Browse files Browse the repository at this point in the history
Error pointers initialization
  • Loading branch information
ERussel authored Mar 5, 2019
2 parents 111fb4c + 01a6f7a commit d91ffc7
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 25 deletions.
8 changes: 4 additions & 4 deletions Example/IrohaCommunication.xcodeproj/project.pbxproj
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@
inputFileListPaths = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-IntegrationTestHost/Pods-IntegrationTestHost-frameworks.sh",
"${PODS_ROOT}/Target Support Files/Pods-IntegrationTestHost/Pods-IntegrationTestHost-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/BoringSSL/openssl.framework",
"${BUILT_PRODUCTS_DIR}/IrohaCommunication/IrohaCommunication.framework",
"${BUILT_PRODUCTS_DIR}/IrohaCrypto/IrohaCrypto.framework",
Expand All @@ -704,7 +704,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-IntegrationTestHost/Pods-IntegrationTestHost-frameworks.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-IntegrationTestHost/Pods-IntegrationTestHost-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
F038CD8710A254DFB6ADBE4A /* [CP] Embed Pods Frameworks */ = {
Expand All @@ -715,7 +715,7 @@
inputFileListPaths = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-IrohaExample/Pods-IrohaExample-frameworks.sh",
"${PODS_ROOT}/Target Support Files/Pods-IrohaExample/Pods-IrohaExample-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/BoringSSL/openssl.framework",
"${BUILT_PRODUCTS_DIR}/IrohaCommunication/IrohaCommunication.framework",
"${BUILT_PRODUCTS_DIR}/IrohaCrypto/IrohaCrypto.framework",
Expand All @@ -742,7 +742,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-IrohaExample/Pods-IrohaExample-frameworks.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-IrohaExample/Pods-IrohaExample-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down
6 changes: 3 additions & 3 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ PODS:
- gRPC/Main (1.11.0):
- gRPC-Core (= 1.11.0)
- gRPC-RxLibrary (= 1.11.0)
- IrohaCommunication (3.0.1):
- IrohaCommunication (3.0.2):
- BoringSSL (= 10.0.3)
- gRPC-ProtoRPC (= 1.11.0)
- IrohaCrypto
Expand Down Expand Up @@ -62,11 +62,11 @@ SPEC CHECKSUMS:
gRPC-Core: 164639cd8ae18ca8b65477fafb2efbaecf4f181a
gRPC-ProtoRPC: bb5fddf3424aa4fad74d76736578a79fe40e244e
gRPC-RxLibrary: 26d53d1b1f306befd4ad4e15bd6de27839a82481
IrohaCommunication: 72885dfed88423377a2ab522d8f62e11f5ee42a5
IrohaCommunication: c0b4767cd2ee741538cd37b5a8aa59c16a71af65
IrohaCrypto: d0e6e1189ce43a51b6f7916f4830605c7d466d57
nanopb: 5601e6bca2dbf1ed831b519092ec110f66982ca3
Protobuf: 8a9838fba8dae3389230e1b7f8c104aa32389c03

PODFILE CHECKSUM: 29089a97c3781ec366ef8266addf4289525ff849

COCOAPODS: 1.5.3
COCOAPODS: 1.6.1
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ - (nonnull IRPromise*)executeQueryRequest:(nonnull id<IRQueryRequest>)queryReque
return promise;
}

NSError *error;
NSError *error = nil;
Query *protobufQuery = [(id<IRProtobufTransformable>)queryRequest transform:&error];

if (!protobufQuery) {
Expand Down
4 changes: 2 additions & 2 deletions Tests/Model/IRAccountIdTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ - (void)testValidAccountNames {

- (void)testInvalidAccountNamesWithError {
for (NSUInteger i = 0; i < INVALID_ACCOUNT_NAMES_COUNT; i++) {
NSError *error;
NSError *error = nil;
id<IRAccountId> accountId = [IRAccountIdFactory accountIdWithName:INVALID_ACCOUNT_NAMES[i]
domain:[IRDomainFactory domainWithIdentitifer:VALID_DOMAIN error:nil]
error:&error];
Expand Down Expand Up @@ -85,7 +85,7 @@ - (void)testValidIdentifier {

- (void)testInvalidAccountIdentifierWithError {
for (NSUInteger i = 0; i < INVALID_ACCOUNT_IDENTIFIERS_COUNT; i++) {
NSError *error;
NSError *error = nil;
id<IRAccountId> accountId = [IRAccountIdFactory accountWithIdentifier:INVALID_ACCOUNT_IDENTIFIERS[i]
error:&error];
XCTAssertNil(accountId);
Expand Down
8 changes: 4 additions & 4 deletions Tests/Model/IRAddressTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ - (void)testValidAddress {

- (void)testInvalidAddressWithError {
for (NSUInteger i = 0; i < INVALID_ADDRESSES_COUNT; i++) {
NSError *error;
NSError *error = nil;
id<IRAddress> address = [IRAddressFactory addressWithIp:INVALID_IPV4[i]
port:VALID_PORT
error:&error];
Expand All @@ -92,7 +92,7 @@ - (void)testInvalidAddressWithoutError {

- (void)testInvalidIpPortWithError {
for (NSUInteger i = 0; i < INVALID_PORTS_COUNT; i++) {
NSError *error;
NSError *error = nil;
id<IRAddress> address = [IRAddressFactory addressWithIp:VALID_IPV4[0]
port:INVALID_PORTS[i]
error:&error];
Expand Down Expand Up @@ -126,7 +126,7 @@ - (void)testValidDomain {

- (void)testInvalidDomainWithError {
for (NSUInteger i = 0; i < INVALID_ADDRESS_DOMAINS_COUNT; i++) {
NSError *error;
NSError *error = nil;
id<IRAddress> address = [IRAddressFactory addressWithDomain:INVALID_ADDRESS_DOMAINS[i]
port:VALID_PORT
error:&error];
Expand All @@ -149,7 +149,7 @@ - (void)testInvalidDomainWithoutError {

- (void)testInvalidDomainPortWithError {
for (NSUInteger i = 0; i < INVALID_PORTS_COUNT; i++) {
NSError *error;
NSError *error = nil;
id<IRAddress> address = [IRAddressFactory addressWithDomain:VALID_ADDRESS_DOMAINS[0]
port:INVALID_PORTS[i]
error:&error];
Expand Down
2 changes: 1 addition & 1 deletion Tests/Model/IRAmountTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ - (void)testValidStringAmount {

- (void)testInvalidStringAmountWithError {
for (NSUInteger i = 0; i < INVALID_STRING_AMOUNT_COUNT; i++) {
NSError *error;
NSError *error = nil;
id<IRAmount> amount = [IRAmountFactory amountFromString:INVALID_STRING_AMOUNT[i]
error:&error];

Expand Down
4 changes: 2 additions & 2 deletions Tests/Model/IRAssetIdTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ - (void)testValidAssetNames {

- (void)testInvalidAssetNamesWithError {
for (NSUInteger i = 0; i < INVALID_ASSET_NAMES_COUNT; i++) {
NSError *error;
NSError *error = nil;
id<IRAssetId> assetId = [IRAssetIdFactory assetIdWithName:INVALID_ASSET_NAMES[i]
domain:[IRDomainFactory domainWithIdentitifer:VALID_DOMAIN error:nil]
error:&error];
Expand Down Expand Up @@ -84,7 +84,7 @@ - (void)testValidIdentifier {

- (void)testInvalidAssetIdentifierWithError {
for (NSUInteger i = 0; i < INVALID_ASSET_IDENTIFIERS_COUNT; i++) {
NSError *error;
NSError *error = nil;
id<IRAssetId> assetId = [IRAssetIdFactory assetWithIdentifier:INVALID_ASSET_IDENTIFIERS[i]
error:&error];
XCTAssertNil(assetId);
Expand Down
2 changes: 1 addition & 1 deletion Tests/Model/IRDomainTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ - (void)testValidDomains {

- (void)testInvalidDomainsWithError {
for (NSUInteger i = 0; i < INVALID_DOMAINS_COUNT; i++) {
NSError *error;
NSError *error = nil;
id<IRDomain> domain = [IRDomainFactory domainWithIdentitifer:INVALID_DOMAINS[i]
error:&error];
XCTAssertNil(domain);
Expand Down
2 changes: 1 addition & 1 deletion Tests/Model/IRGrantablePermissionTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ - (void)testValidGrantablePermission {

- (void)testInvalidGrantablePermissionWithError {
for (int i = 5; i < 10; i++) {
NSError *error;
NSError *error = nil;
id<IRGrantablePermission> permission = [IRGrantablePermissionFactory permissionWithValue:i
error:&error];
XCTAssertNil(permission);
Expand Down
2 changes: 1 addition & 1 deletion Tests/Model/IRRoleNameTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ - (void)testValidRoleNames {

- (void)testInvalidRoleNamesWithError {
for (NSUInteger i = 0; i < INVALID_ROLE_NAMES_COUNT; i++) {
NSError *error;
NSError *error = nil;
id<IRRoleName> roleName = [IRRoleNameFactory roleWithName:INVALID_ROLE_NAMES[i]
error:&error];
XCTAssertNil(roleName);
Expand Down
2 changes: 1 addition & 1 deletion Tests/Model/IRRolePermissionTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ - (void)testValidRolePermission {

- (void)testInvalidRolPermissionWithError {
for (int i = 50; i < 60; i++) {
NSError *error;
NSError *error = nil;
id<IRRolePermission> permission = [IRRolePermissionFactory permissionWithValue:i
error:&error];
XCTAssertNil(permission);
Expand Down
8 changes: 4 additions & 4 deletions Tests/Query/IRQueryBuilderTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ @implementation IRQueryTests
- (void)testMissingAccountId {
IRQueryBuilder *queryBuilder = [[IRQueryBuilder alloc] init];

NSError *error;
NSError *error = nil;
id<IRQueryRequest> query = [queryBuilder build:&error];

XCTAssertNil(query);
Expand All @@ -57,7 +57,7 @@ - (void)testMissingQuery {

IRQueryBuilder *queryBuilder = [IRQueryBuilder builderWithCreatorAccountId:accountId];

NSError *error;
NSError *error = nil;
id<IRQueryRequest> query = [queryBuilder build:&error];

XCTAssertNil(query);
Expand Down Expand Up @@ -91,10 +91,10 @@ - (void)testQueries {

[invocation invoke];

NSError *error;
NSError *error = nil;
id<IRQueryRequest> queryRequest = [queryBuilder build:&error];

XCTAssertNil(error);
XCTAssertNil(error, "Query builder failed: %@", [error localizedDescription]);
XCTAssertNotNil(queryRequest);
XCTAssertEqualObjects([accountId identifier], [queryRequest.creator identifier]);
XCTAssertEqualObjects(date, queryRequest.createdAt);
Expand Down

0 comments on commit d91ffc7

Please sign in to comment.