diff options
author | Thomas Van Lenten <thomasvl@google.com> | 2015-08-11 16:20:39 -0400 |
---|---|---|
committer | Thomas Van Lenten <thomasvl@google.com> | 2015-08-11 16:22:47 -0400 |
commit | 1c33d34e3496fa2d0c852ac99c444d44c09e432a (patch) | |
tree | 71456ab688e4d262bdbd8c7c6f1554d04b45d856 /objectivec/Tests/GPBWellKnownTypesTest.m | |
parent | 63778e537a82d91c6bced5999a7e85b0f41b90b1 (diff) | |
download | protobuf-1c33d34e3496fa2d0c852ac99c444d44c09e432a.tar.gz protobuf-1c33d34e3496fa2d0c852ac99c444d44c09e432a.tar.bz2 protobuf-1c33d34e3496fa2d0c852ac99c444d44c09e432a.zip |
Revert "Add packFrom, unpackTo and is in google.protobuf.Any."
This reverts commit 7366efd81e7f36108aa35e66fca61da8a65762c2.
Still some discussion about the api to expose the helpers with.
Diffstat (limited to 'objectivec/Tests/GPBWellKnownTypesTest.m')
-rw-r--r-- | objectivec/Tests/GPBWellKnownTypesTest.m | 53 |
1 files changed, 1 insertions, 52 deletions
diff --git a/objectivec/Tests/GPBWellKnownTypesTest.m b/objectivec/Tests/GPBWellKnownTypesTest.m index 48c875aa..78f4e637 100644 --- a/objectivec/Tests/GPBWellKnownTypesTest.m +++ b/objectivec/Tests/GPBWellKnownTypesTest.m @@ -28,9 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#import "google/protobuf/Unittest.pbobjc.h" #import "GPBWellKnownTypes.h" -#import "GPBTestUtilities.h" #import <XCTest/XCTest.h> @@ -40,7 +38,7 @@ static const NSTimeInterval kFutureOffsetInterval = 15000; // Nanosecond time accuracy static const NSTimeInterval kTimeAccuracy = 1e-9; -@interface WellKnownTypesTest : GPBTestCase +@interface WellKnownTypesTest : XCTestCase @end @implementation WellKnownTypesTest @@ -101,53 +99,4 @@ static const NSTimeInterval kTimeAccuracy = 1e-9; [duration2 release]; } -- (void)testAnyPackingAndUnpacking { - TestAllTypes *from = [TestAllTypes message]; - [self setAllFields:from repeatedCount:1]; - NSData *data = from.data; - - // Test initWithMessage - GPBAny *anyInited = [[GPBAny alloc] initWithMessage:from]; - XCTAssertEqualObjects( - [GPBTypeGoogleApisComPrefix stringByAppendingString:from.descriptor.name], - anyInited.typeURL); - XCTAssertEqualObjects(data, anyInited.value); - [anyInited release]; - - // Test setMessage. - GPBAny *any = [GPBAny message]; - [any setMessage:from]; - XCTAssertEqualObjects( - [GPBTypeGoogleApisComPrefix stringByAppendingString:from.descriptor.name], - any.typeURL); - XCTAssertEqualObjects(data, any.value); - - // Test messageOfClass - TestAllTypes *to = (TestAllTypes*)[any messageOfClass:[TestAllTypes class]]; - XCTAssertEqualObjects(from, to); - XCTAssertEqual([any messageOfClass:[ForeignMessage class]], nil); - XCTAssertEqual([[GPBAny message] messageOfClass:[TestAllTypes class]], nil); - - // Test setMessage with another type. - ForeignMessage *from2 = [ForeignMessage message]; - [any setMessage:from2]; - XCTAssertEqualObjects( - [GPBTypeGoogleApisComPrefix stringByAppendingString:from2.descriptor.name], - any.typeURL); - XCTAssertEqual(0UL, [any.value length]); - - // Test wrapsMessageOfClass - XCTAssertTrue([any wrapsMessageOfClass:[from2 class]]); - XCTAssertFalse([any wrapsMessageOfClass:[from class]]); -#if !defined(NS_BLOCK_ASSERTIONS) - // If assert is enabled, throw exception when the passed message class to - // wrapsMessageOfClass is not a child of GPBMessage. - XCTAssertThrows([any wrapsMessageOfClass:[NSString class]]); -#else - // If assert is disabled, return false when the passed message class to - // wrapsMessageOfClass is not a child of GPBMessage. - XCTAssertFalse([any wrapsMessageOfClass:[NSString class]]); -#endif -} - @end |