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

pull/7378/head
Thomas Van Lenten 5 years ago
parent 24dda9e233
commit 6f3bda22f4
  1. 12
      objectivec/Tests/GPBMessageTests+Runtime.m
  2. 2
      objectivec/Tests/GPBSwiftTests.swift

@ -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);
}
}

@ -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()

Loading…
Cancel
Save