[ObjC] Fix some tests checking the wrong Message class.

This commit is contained in:
Thomas Van Lenten 2020-04-13 17:50:35 -04:00
parent 24dda9e233
commit 6f3bda22f4
2 changed files with 7 additions and 7 deletions

View File

@ -252,7 +252,7 @@
// build the selector, i.e. - repeatedInt32Array_Count
SEL countSel = NSSelectorFromString(
[NSString stringWithFormat:@"repeated%@Array_Count", name]);
XCTAssertTrue([Message2 instancesRespondToSelector:countSel], @"field: %@",
XCTAssertTrue([Message3 instancesRespondToSelector:countSel], @"field: %@",
name);
}
@ -264,9 +264,9 @@
NSSelectorFromString([NSString stringWithFormat:@"hasOneof%@", name]);
SEL setHasSel = NSSelectorFromString(
[NSString stringWithFormat:@"setHasOneof%@:", name]);
XCTAssertFalse([Message2 instancesRespondToSelector:hasSel], @"field: %@",
XCTAssertFalse([Message3 instancesRespondToSelector:hasSel], @"field: %@",
name);
XCTAssertFalse([Message2 instancesRespondToSelector:setHasSel],
XCTAssertFalse([Message3 instancesRespondToSelector:setHasSel],
@"field: %@", name);
}
@ -302,14 +302,14 @@
[NSString stringWithFormat:@"hasMap%@", name]);
SEL setHasSel = NSSelectorFromString(
[NSString stringWithFormat:@"setHasMap%@:", name]);
XCTAssertFalse([Message2 instancesRespondToSelector:hasSel], @"field: %@",
XCTAssertFalse([Message3 instancesRespondToSelector:hasSel], @"field: %@",
name);
XCTAssertFalse([Message2 instancesRespondToSelector:setHasSel],
XCTAssertFalse([Message3 instancesRespondToSelector:setHasSel],
@"field: %@", name);
// build the selector, i.e. - mapInt32Int32Count
SEL countSel = NSSelectorFromString(
[NSString stringWithFormat:@"map%@_Count", name]);
XCTAssertTrue([Message2 instancesRespondToSelector:countSel], @"field: %@",
XCTAssertTrue([Message3 instancesRespondToSelector:countSel], @"field: %@",
name);
}
}

View File

@ -355,7 +355,7 @@ class GPBBridgeTests: XCTestCase {
msg.oneof = nil
XCTAssertEqual(msg.oneof.optionalInt32, Int32(0)) // Default
XCTAssertEqual(msg.oOneOfCase, Message2_O_OneOfCase.gpbUnsetOneOfCase)
}
}
func testProto3OneOfSupport() {
let msg = Message3()