OLD | NEW |
1 // Protocol Buffers - Google's data interchange format | 1 // Protocol Buffers - Google's data interchange format |
2 // Copyright 2015 Google Inc. All rights reserved. | 2 // Copyright 2015 Google Inc. All rights reserved. |
3 // https://developers.google.com/protocol-buffers/ | 3 // https://developers.google.com/protocol-buffers/ |
4 // | 4 // |
5 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
6 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
7 // met: | 7 // met: |
8 // | 8 // |
9 // * Redistributions of source code must retain the above copyright | 9 // * Redistributions of source code must retain the above copyright |
10 // notice, this list of conditions and the following disclaimer. | 10 // notice, this list of conditions and the following disclaimer. |
(...skipping 2056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2067 } | 2067 } |
2068 | 2068 |
2069 #pragma mark - Subset from from map_tests.cc | 2069 #pragma mark - Subset from from map_tests.cc |
2070 | 2070 |
2071 // TEST(GeneratedMapFieldTest, IsInitialized) | 2071 // TEST(GeneratedMapFieldTest, IsInitialized) |
2072 - (void)testMap_IsInitialized { | 2072 - (void)testMap_IsInitialized { |
2073 TestRequiredMessageMap *msg = [[TestRequiredMessageMap alloc] init]; | 2073 TestRequiredMessageMap *msg = [[TestRequiredMessageMap alloc] init]; |
2074 | 2074 |
2075 // Add an uninitialized message. | 2075 // Add an uninitialized message. |
2076 TestRequired *subMsg = [[TestRequired alloc] init]; | 2076 TestRequired *subMsg = [[TestRequired alloc] init]; |
2077 msg.mapField = [GPBInt32ObjectDictionary dictionary]; | |
2078 [msg.mapField setObject:subMsg forKey:0]; | 2077 [msg.mapField setObject:subMsg forKey:0]; |
2079 XCTAssertFalse(msg.initialized); | 2078 XCTAssertFalse(msg.initialized); |
2080 | 2079 |
2081 // Initialize uninitialized message | 2080 // Initialize uninitialized message |
2082 subMsg.a = 0; | 2081 subMsg.a = 0; |
2083 subMsg.b = 0; | 2082 subMsg.b = 0; |
2084 subMsg.c = 0; | 2083 subMsg.c = 0; |
2085 XCTAssertTrue(msg.initialized); | 2084 XCTAssertTrue(msg.initialized); |
2086 | 2085 |
2087 [subMsg release]; | 2086 [subMsg release]; |
2088 [msg release]; | 2087 [msg release]; |
2089 } | 2088 } |
2090 | 2089 |
2091 @end | 2090 @end |
OLD | NEW |