aboutsummaryrefslogtreecommitdiffhomepage
path: root/objectivec/Tests
diff options
context:
space:
mode:
authorGravatar Thomas Van Lenten <thomasvl@google.com>2016-06-28 09:00:06 -0400
committerGravatar Thomas Van Lenten <thomasvl@google.com>2016-06-29 09:53:46 -0400
commit6cfc19edde6226ec7a3a58a8cacb713a3f861222 (patch)
tree34701079fbf22fe3fb40bdebde6314f721207b6f /objectivec/Tests
parentc18aa7795a2e02ef700ff8b039d94ecdcc33432f (diff)
Xcode project cleanup/setup.
- Correct some cases sources were compiled into the static lib and the tests. - Enable Xcodes code coverage support on the unittests. We aren't complete on coverage, but having the data always there should make it easier to chip away at this going forward. - Drop method in tests that isn't used, wire up a validator in another test.
Diffstat (limited to 'objectivec/Tests')
-rw-r--r--objectivec/Tests/GPBUnknownFieldSetTest.m4
-rw-r--r--objectivec/Tests/GPBWireFormatTests.m8
2 files changed, 7 insertions, 5 deletions
diff --git a/objectivec/Tests/GPBUnknownFieldSetTest.m b/objectivec/Tests/GPBUnknownFieldSetTest.m
index 01217ca6..b2b5b21e 100644
--- a/objectivec/Tests/GPBUnknownFieldSetTest.m
+++ b/objectivec/Tests/GPBUnknownFieldSetTest.m
@@ -60,10 +60,6 @@
unknownFields_ = emptyMessage_.unknownFields;
}
-- (GPBUnknownField *)getField:(int32_t)number {
- return [unknownFields_ getField:number];
-}
-
// Constructs a protocol buffer which contains fields with all the same
// numbers as allFieldsData except that each field is some other wire
// type.
diff --git a/objectivec/Tests/GPBWireFormatTests.m b/objectivec/Tests/GPBWireFormatTests.m
index 2a406f11..dbeab215 100644
--- a/objectivec/Tests/GPBWireFormatTests.m
+++ b/objectivec/Tests/GPBWireFormatTests.m
@@ -46,6 +46,7 @@
TestAllTypes* message = [self allSetRepeatedCount:kGPBDefaultRepeatCount];
NSData* rawBytes = message.data;
+ [self assertFieldsInOrder:rawBytes];
XCTAssertEqual(message.serializedSize, (size_t)rawBytes.length);
TestAllTypes* message2 = [TestAllTypes parseFromData:rawBytes error:NULL];
@@ -58,6 +59,7 @@
[self packedSetRepeatedCount:kGPBDefaultRepeatCount];
NSData* rawBytes = message.data;
+ [self assertFieldsInOrder:rawBytes];
XCTAssertEqual(message.serializedSize, (size_t)rawBytes.length);
TestPackedTypes* message2 =
@@ -74,6 +76,7 @@
TestAllExtensions* message =
[self allExtensionsSetRepeatedCount:kGPBDefaultRepeatCount];
NSData* rawBytes = message.data;
+ [self assertFieldsInOrder:rawBytes];
XCTAssertEqual(message.serializedSize, (size_t)rawBytes.length);
TestAllTypes* message2 = [TestAllTypes parseFromData:rawBytes error:NULL];
@@ -87,6 +90,7 @@
TestPackedExtensions* message =
[self packedExtensionsSetRepeatedCount:kGPBDefaultRepeatCount];
NSData* rawBytes = message.data;
+ [self assertFieldsInOrder:rawBytes];
TestPackedTypes* message2 =
[self packedSetRepeatedCount:kGPBDefaultRepeatCount];
@@ -102,6 +106,7 @@
TestAllTypes* message = [self allSetRepeatedCount:kGPBDefaultRepeatCount];
NSData* rawBytes = message.data;
+ [self assertFieldsInOrder:rawBytes];
GPBExtensionRegistry* registry = [self extensionRegistry];
@@ -113,7 +118,7 @@
}
-- (void) testExtensionsSerializedSize {
+- (void)testExtensionsSerializedSize {
size_t allSet = [self allSetRepeatedCount:kGPBDefaultRepeatCount].serializedSize;
size_t extensionSet = [self allExtensionsSetRepeatedCount:kGPBDefaultRepeatCount].serializedSize;
XCTAssertEqual(allSet, extensionSet);
@@ -124,6 +129,7 @@
TestPackedExtensions* message =
[self packedExtensionsSetRepeatedCount:kGPBDefaultRepeatCount];
NSData* rawBytes = message.data;
+ [self assertFieldsInOrder:rawBytes];
GPBExtensionRegistry* registry = [self extensionRegistry];