diff options
Diffstat (limited to 'objectivec')
90 files changed, 2386 insertions, 5618 deletions
diff --git a/objectivec/DevTools/full_mac_build.sh b/objectivec/DevTools/full_mac_build.sh index a825789f..c673fcba 100755 --- a/objectivec/DevTools/full_mac_build.sh +++ b/objectivec/DevTools/full_mac_build.sh @@ -244,8 +244,7 @@ if [[ "${DO_XCODE_IOS_TESTS}" == "yes" ]] ; then exit 10 ;; 7.* ) - echo "ERROR: The unittests include Swift code that is now Swift 3.0." 1>&2 - echo "ERROR: Xcode 8.0 or higher is required to build the test suite, but the library works with Xcode 7.x." 1>&2 + echo "ERROR: Xcode 7.x no longer supported for building, please use 8.0 or higher." 1>&2 exit 11 ;; 8.0* ) @@ -253,40 +252,36 @@ if [[ "${DO_XCODE_IOS_TESTS}" == "yes" ]] ; then XCODEBUILD_TEST_BASE_IOS+=( -destination "platform=iOS Simulator,name=iPhone 4s,OS=9.0" # 32bit -destination "platform=iOS Simulator,name=iPhone 7,OS=10.0" # 64bit - -destination "platform=iOS Simulator,name=iPad 2,OS=9.0" # 32bit - -destination "platform=iOS Simulator,name=iPad Pro (9.7 inch),OS=10.0" # 64bit ) ;; - 8.1* ) + 8.[1-3]* ) XCODEBUILD_TEST_BASE_IOS+=( -destination "platform=iOS Simulator,name=iPhone 4s,OS=8.1" # 32bit - -destination "platform=iOS Simulator,name=iPhone 7,OS=10.1" # 64bit - -destination "platform=iOS Simulator,name=iPad 2,OS=8.1" # 32bit - -destination "platform=iOS Simulator,name=iPad Pro (9.7 inch),OS=10.1" # 64bit - ) - ;; - 8.2* ) - XCODEBUILD_TEST_BASE_IOS+=( - -destination "platform=iOS Simulator,name=iPhone 4s,OS=8.1" # 32bit - -destination "platform=iOS Simulator,name=iPhone 7,OS=10.2" # 64bit - -destination "platform=iOS Simulator,name=iPad 2,OS=8.1" # 32bit - -destination "platform=iOS Simulator,name=iPad Pro (9.7 inch),OS=10.2" # 64bit + -destination "platform=iOS Simulator,name=iPhone 7,OS=latest" # 64bit ) ;; - 8.3* ) + 9.[0-2]* ) XCODEBUILD_TEST_BASE_IOS+=( -destination "platform=iOS Simulator,name=iPhone 4s,OS=8.1" # 32bit -destination "platform=iOS Simulator,name=iPhone 7,OS=latest" # 64bit + # 9.0-9.2 all seem to often fail running destinations in parallel + -disable-concurrent-testing ) ;; - 9.0* ) + 9.3* ) XCODEBUILD_TEST_BASE_IOS+=( - -destination "platform=iOS Simulator,name=iPhone 4s,OS=8.1" # 32bit + # Xcode 9.3 chokes targeting iOS 8.x - http://www.openradar.me/39335367 + -destination "platform=iOS Simulator,name=iPhone 4s,OS=9.0" # 32bit -destination "platform=iOS Simulator,name=iPhone 7,OS=latest" # 64bit + # 9.3 also seems to often fail running destinations in parallel + -disable-concurrent-testing ) ;; * ) - echo "Time to update the simulator targets for Xcode ${XCODE_VERSION}" + echo "" + echo "ATTENTION: Time to update the simulator targets for Xcode ${XCODE_VERSION}" + echo "" + echo "Build aborted!" exit 2 ;; esac @@ -299,7 +294,7 @@ if [[ "${DO_XCODE_IOS_TESTS}" == "yes" ]] ; then "${XCODEBUILD_TEST_BASE_IOS[@]}" -configuration Release test fi # Don't leave the simulator in the developer's face. - killall Simulator + killall Simulator 2> /dev/null || true fi if [[ "${DO_XCODE_OSX_TESTS}" == "yes" ]] ; then XCODEBUILD_TEST_BASE_OSX=( diff --git a/objectivec/DevTools/pddm_tests.py b/objectivec/DevTools/pddm_tests.py index 8a73b842..9ac6a855 100755 --- a/objectivec/DevTools/pddm_tests.py +++ b/objectivec/DevTools/pddm_tests.py @@ -311,7 +311,7 @@ foo(x, y) mc = pddm.MacroCollection(f) try: result = mc.Expand('foo(A,B)') - self.fail('Should throw exception, entry %d' % idx) + self.fail('Should throw exception! Test failed to catch recursion.') except pddm.PDDMError as e: self.assertEqual(e.message, 'Found macro recusion, invoking "foo(1, A)":\n...while expanding "bar(1, A)".\n...while expanding "foo(A,B)".') @@ -483,7 +483,7 @@ foo sf = pddm.SourceFile(f) try: sf.ProcessContent() - self.fail('Should throw exception, entry %d' % idx) + self.fail('Should throw exception! Test failed to catch macro parsing error.') except pddm.PDDMError as e: self.assertEqual(e.message, 'Attempt to redefine macro: "PDDM-DEFINE mumble(x_)"\n' @@ -503,7 +503,7 @@ foo sf = pddm.SourceFile(f) try: sf.ProcessContent() - self.fail('Should throw exception, entry %d' % idx) + self.fail('Should throw exception! Test failed to catch expand error.') except pddm.PDDMError as e: self.assertEqual(e.message, 'No macro named "foobar".\n' diff --git a/objectivec/GPBArray.m b/objectivec/GPBArray.m index f401631d..122e0304 100644 --- a/objectivec/GPBArray.m +++ b/objectivec/GPBArray.m @@ -2537,12 +2537,12 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) { return [_array countByEnumeratingWithState:state objects:buffer count:len]; } -- (void)enumerateObjectsUsingBlock:(void (^)(id obj, NSUInteger idx, BOOL *stop))block { +- (void)enumerateObjectsUsingBlock:(void (NS_NOESCAPE ^)(id obj, NSUInteger idx, BOOL *stop))block { [_array enumerateObjectsUsingBlock:block]; } - (void)enumerateObjectsWithOptions:(NSEnumerationOptions)opts - usingBlock:(void (^)(id obj, NSUInteger idx, BOOL *stop))block { + usingBlock:(void (NS_NOESCAPE ^)(id obj, NSUInteger idx, BOOL *stop))block { [_array enumerateObjectsWithOptions:opts usingBlock:block]; } diff --git a/objectivec/GPBCodedInputStream.m b/objectivec/GPBCodedInputStream.m index 0759640d..dd05ddb4 100644 --- a/objectivec/GPBCodedInputStream.m +++ b/objectivec/GPBCodedInputStream.m @@ -63,9 +63,9 @@ static void RaiseException(NSInteger code, NSString *reason) { NSDictionary *exceptionInfo = @{ GPBCodedInputStreamUnderlyingErrorKey: error }; - [[[NSException alloc] initWithName:GPBCodedInputStreamException - reason:reason - userInfo:exceptionInfo] raise]; + [[NSException exceptionWithName:GPBCodedInputStreamException + reason:reason + userInfo:exceptionInfo] raise]; } static void CheckRecursionLimit(GPBCodedInputStreamState *state) { @@ -110,7 +110,7 @@ static int64_t ReadRawVarint64(GPBCodedInputStreamState *state) { int64_t result = 0; while (shift < 64) { int8_t b = ReadRawByte(state); - result |= (int64_t)(b & 0x7F) << shift; + result |= (int64_t)((uint64_t)(b & 0x7F) << shift); if ((b & 0x80) == 0) { return result; } diff --git a/objectivec/GPBCodedInputStream_PackagePrivate.h b/objectivec/GPBCodedInputStream_PackagePrivate.h index 90bd0c92..43ec6e79 100644 --- a/objectivec/GPBCodedInputStream_PackagePrivate.h +++ b/objectivec/GPBCodedInputStream_PackagePrivate.h @@ -34,8 +34,6 @@ #import "GPBCodedInputStream.h" -#import <libkern/OSAtomic.h> - @class GPBUnknownFieldSet; @class GPBFieldDescriptor; diff --git a/objectivec/GPBCodedOutputStream.m b/objectivec/GPBCodedOutputStream.m index c299040f..b846c2fc 100644 --- a/objectivec/GPBCodedOutputStream.m +++ b/objectivec/GPBCodedOutputStream.m @@ -174,10 +174,10 @@ static void GPBWriteRawLittleEndian64(GPBOutputBufferState *state, data:(NSMutableData *)data { if ((self = [super init])) { buffer_ = [data retain]; - [output open]; state_.bytes = [data mutableBytes]; state_.size = [data length]; state_.output = [output retain]; + [state_.output open]; } return self; } @@ -942,7 +942,10 @@ static void GPBWriteRawLittleEndian64(GPBOutputBufferState *state, state_.position = length; } else { // Write is very big. Let's do it all at once. - [state_.output write:((uint8_t *)value) + offset maxLength:length]; + NSInteger written = [state_.output write:((uint8_t *)value) + offset maxLength:length]; + if (written != (NSInteger)length) { + [NSException raise:GPBCodedOutputStreamException_WriteFailed format:@""]; + } } } } diff --git a/objectivec/GPBDescriptor.h b/objectivec/GPBDescriptor.h index 651f4de0..292bce13 100644 --- a/objectivec/GPBDescriptor.h +++ b/objectivec/GPBDescriptor.h @@ -223,9 +223,12 @@ typedef NS_ENUM(uint8_t, GPBFieldType) { /** * Returns the enum value name for the given raw enum. * + * Note that there can be more than one name corresponding to a given value + * if the allow_alias option is used. + * * @param number The raw enum value. * - * @return The name of the enum value passed, or nil if not valid. + * @return The first name that matches the enum value passed, or nil if not valid. **/ - (nullable NSString *)enumNameForValue:(int32_t)number; @@ -244,7 +247,7 @@ typedef NS_ENUM(uint8_t, GPBFieldType) { * * @param number The raw enum value. * - * @return The text format name for the raw enum value, or nil if not valid. + * @return The first text format name which matches the enum value, or nil if not valid. **/ - (nullable NSString *)textFormatNameForValue:(int32_t)number; @@ -258,6 +261,33 @@ typedef NS_ENUM(uint8_t, GPBFieldType) { **/ - (BOOL)getValue:(nullable int32_t *)outValue forEnumTextFormatName:(NSString *)textFormatName; +/** + * Gets the number of defined enum names. + * + * @return Count of the number of enum names, including any aliases. + */ +@property(nonatomic, readonly) uint32_t enumNameCount; + +/** + * Gets the enum name corresponding to the given index. + * + * @param index Index into the available names. The defined range is from 0 + * to self.enumNameCount - 1. + * + * @returns The enum name at the given index, or nil if the index is out of range. + */ +- (nullable NSString *)getEnumNameForIndex:(uint32_t)index; + +/** + * Gets the enum text format name corresponding to the given index. + * + * @param index Index into the available names. The defined range is from 0 + * to self.enumNameCount - 1. + * + * @returns The text format name at the given index, or nil if the index is out of range. + */ +- (nullable NSString *)getEnumTextFormatNameForIndex:(uint32_t)index; + @end /** diff --git a/objectivec/GPBDescriptor.m b/objectivec/GPBDescriptor.m index 3c3844da..ad46ef4f 100644 --- a/objectivec/GPBDescriptor.m +++ b/objectivec/GPBDescriptor.m @@ -411,7 +411,7 @@ static NSArray *NewFieldsArrayForHasIndex(int hasIndex, } - (NSString *)name { - return @(name_); + return (NSString * _Nonnull)@(name_); } - (GPBFieldDescriptor *)fieldWithNumber:(uint32_t)fieldNumber { @@ -548,7 +548,8 @@ uint32_t GPBFieldAlternateTag(GPBFieldDescriptor *self) { // descriptor structure. const uint8_t *bytes = (const uint8_t *)defaultValue_.valueData; if (bytes) { - uint32_t length = *((uint32_t *)bytes); + uint32_t length; + memcpy(&length, bytes, sizeof(length)); length = ntohl(length); bytes += sizeof(length); defaultValue_.valueData = @@ -581,7 +582,7 @@ uint32_t GPBFieldAlternateTag(GPBFieldDescriptor *self) { } - (NSString *)name { - return @(description_->name); + return (NSString * _Nonnull)@(description_->name); } - (BOOL)isRequired { @@ -829,13 +830,9 @@ uint32_t GPBFieldAlternateTag(GPBFieldDescriptor *self) { } - (NSString *)enumNameForValue:(int32_t)number { - if (nameOffsets_ == NULL) [self calcValueNameOffsets]; - for (uint32_t i = 0; i < valueCount_; ++i) { if (values_[i] == number) { - const char *valueName = valueNames_ + nameOffsets_[i]; - NSString *fullName = [NSString stringWithFormat:@"%@_%s", name_, valueName]; - return fullName; + return [self getEnumNameForIndex:i]; } } return nil; @@ -885,8 +882,6 @@ uint32_t GPBFieldAlternateTag(GPBFieldDescriptor *self) { } - (NSString *)textFormatNameForValue:(int32_t)number { - if (nameOffsets_ == NULL) [self calcValueNameOffsets]; - // Find the EnumValue descriptor and its index. BOOL foundIt = NO; uint32_t valueDescriptorIndex; @@ -901,16 +896,39 @@ uint32_t GPBFieldAlternateTag(GPBFieldDescriptor *self) { if (!foundIt) { return nil; } + return [self getEnumTextFormatNameForIndex:valueDescriptorIndex]; +} + +- (uint32_t)enumNameCount { + return valueCount_; +} + +- (NSString *)getEnumNameForIndex:(uint32_t)index { + if (nameOffsets_ == NULL) [self calcValueNameOffsets]; + if (index >= valueCount_) { + return nil; + } + const char *valueName = valueNames_ + nameOffsets_[index]; + NSString *fullName = [NSString stringWithFormat:@"%@_%s", name_, valueName]; + return fullName; +} + +- (NSString *)getEnumTextFormatNameForIndex:(uint32_t)index { + if (nameOffsets_ == NULL) [self calcValueNameOffsets]; + + if (index >= valueCount_) { + return nil; + } NSString *result = nil; // Naming adds an underscore between enum name and value name, skip that also. - const char *valueName = valueNames_ + nameOffsets_[valueDescriptorIndex]; + const char *valueName = valueNames_ + nameOffsets_[index]; NSString *shortName = @(valueName); // See if it is in the map of special format handling. if (extraTextFormatInfo_) { result = GPBDecodeTextFormatName(extraTextFormatInfo_, - (int32_t)valueDescriptorIndex, shortName); + (int32_t)index, shortName); } // Logic here needs to match what objectivec_enum.cc does in the proto // compiler. @@ -963,7 +981,8 @@ uint32_t GPBFieldAlternateTag(GPBFieldDescriptor *self) { const uint8_t *bytes = (const uint8_t *)description->defaultValue.valueData; if (bytes) { - uint32_t length = *((uint32_t *)bytes); + uint32_t length; + memcpy(&length, bytes, sizeof(length)); // The length is stored in network byte order. length = ntohl(length); bytes += sizeof(length); @@ -996,7 +1015,7 @@ uint32_t GPBFieldAlternateTag(GPBFieldDescriptor *self) { } - (NSString *)singletonName { - return @(description_->singletonName); + return (NSString * _Nonnull)@(description_->singletonName); } - (const char *)singletonNameC { diff --git a/objectivec/GPBDictionary.h b/objectivec/GPBDictionary.h index 9d674150..a81165e8 100644 --- a/objectivec/GPBDictionary.h +++ b/objectivec/GPBDictionary.h @@ -60,55 +60,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithUInt32:(uint32_t)value - forKey:(uint32_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithUInt32s:(const uint32_t [__nullable])values - forKeys:(const uint32_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBUInt32UInt32Dictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -204,55 +155,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithInt32:(int32_t)value - forKey:(uint32_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithInt32s:(const int32_t [__nullable])values - forKeys:(const uint32_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBUInt32Int32Dictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -348,55 +250,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithUInt64:(uint64_t)value - forKey:(uint32_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithUInt64s:(const uint64_t [__nullable])values - forKeys:(const uint32_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBUInt32UInt64Dictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -492,55 +345,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithInt64:(int64_t)value - forKey:(uint32_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithInt64s:(const int64_t [__nullable])values - forKeys:(const uint32_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBUInt32Int64Dictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -636,55 +440,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithBool:(BOOL)value - forKey:(uint32_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithBools:(const BOOL [__nullable])values - forKeys:(const uint32_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBUInt32BoolDictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -780,55 +535,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithFloat:(float)value - forKey:(uint32_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithFloats:(const float [__nullable])values - forKeys:(const uint32_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBUInt32FloatDictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -924,55 +630,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithDouble:(double)value - forKey:(uint32_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithDoubles:(const double [__nullable])values - forKeys:(const uint32_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBUInt32DoubleDictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -1070,70 +727,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) GPBEnumValidationFunc validationFunc; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the given validation function. - * - * @param func The enum validation function for the dictionary. - * - * @return A newly instanced dictionary. - **/ -+ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param func The enum validation function for the dictionary. - * @param rawValue The raw enum value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func - rawValue:(int32_t)rawValue - forKey:(uint32_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param func The enum validation function for the dictionary. - * @param values The raw enum values values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func - rawValues:(const int32_t [__nullable])values - forKeys:(const uint32_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBUInt32EnumDictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param func The enum validation function for the dictionary. - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func - capacity:(NSUInteger)numItems; - -/** * Initializes a dictionary with the given validation function. * * @param func The enum validation function for the dictionary. @@ -1294,55 +887,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param object The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithObject:(ObjectType)object - forKey:(uint32_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param objects The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithObjects:(const ObjectType __nonnull GPB_UNSAFE_UNRETAINED [__nullable])objects - forKeys:(const uint32_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBUInt32ObjectDictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param objects The values to be placed in this dictionary. @@ -1437,55 +981,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithUInt32:(uint32_t)value - forKey:(int32_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithUInt32s:(const uint32_t [__nullable])values - forKeys:(const int32_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBInt32UInt32Dictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -1581,55 +1076,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithInt32:(int32_t)value - forKey:(int32_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithInt32s:(const int32_t [__nullable])values - forKeys:(const int32_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBInt32Int32Dictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -1725,55 +1171,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithUInt64:(uint64_t)value - forKey:(int32_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithUInt64s:(const uint64_t [__nullable])values - forKeys:(const int32_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBInt32UInt64Dictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -1869,55 +1266,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithInt64:(int64_t)value - forKey:(int32_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithInt64s:(const int64_t [__nullable])values - forKeys:(const int32_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBInt32Int64Dictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -2013,55 +1361,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithBool:(BOOL)value - forKey:(int32_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithBools:(const BOOL [__nullable])values - forKeys:(const int32_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBInt32BoolDictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -2157,55 +1456,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithFloat:(float)value - forKey:(int32_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithFloats:(const float [__nullable])values - forKeys:(const int32_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBInt32FloatDictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -2301,55 +1551,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithDouble:(double)value - forKey:(int32_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithDoubles:(const double [__nullable])values - forKeys:(const int32_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBInt32DoubleDictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -2447,70 +1648,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) GPBEnumValidationFunc validationFunc; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the given validation function. - * - * @param func The enum validation function for the dictionary. - * - * @return A newly instanced dictionary. - **/ -+ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param func The enum validation function for the dictionary. - * @param rawValue The raw enum value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func - rawValue:(int32_t)rawValue - forKey:(int32_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param func The enum validation function for the dictionary. - * @param values The raw enum values values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func - rawValues:(const int32_t [__nullable])values - forKeys:(const int32_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBInt32EnumDictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param func The enum validation function for the dictionary. - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func - capacity:(NSUInteger)numItems; - -/** * Initializes a dictionary with the given validation function. * * @param func The enum validation function for the dictionary. @@ -2671,55 +1808,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param object The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithObject:(ObjectType)object - forKey:(int32_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param objects The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithObjects:(const ObjectType __nonnull GPB_UNSAFE_UNRETAINED [__nullable])objects - forKeys:(const int32_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBInt32ObjectDictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param objects The values to be placed in this dictionary. @@ -2814,55 +1902,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithUInt32:(uint32_t)value - forKey:(uint64_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithUInt32s:(const uint32_t [__nullable])values - forKeys:(const uint64_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBUInt64UInt32Dictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -2958,55 +1997,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithInt32:(int32_t)value - forKey:(uint64_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithInt32s:(const int32_t [__nullable])values - forKeys:(const uint64_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBUInt64Int32Dictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -3102,55 +2092,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithUInt64:(uint64_t)value - forKey:(uint64_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithUInt64s:(const uint64_t [__nullable])values - forKeys:(const uint64_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBUInt64UInt64Dictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -3246,55 +2187,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithInt64:(int64_t)value - forKey:(uint64_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithInt64s:(const int64_t [__nullable])values - forKeys:(const uint64_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBUInt64Int64Dictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -3390,55 +2282,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithBool:(BOOL)value - forKey:(uint64_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithBools:(const BOOL [__nullable])values - forKeys:(const uint64_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBUInt64BoolDictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -3534,55 +2377,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithFloat:(float)value - forKey:(uint64_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithFloats:(const float [__nullable])values - forKeys:(const uint64_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBUInt64FloatDictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -3678,55 +2472,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithDouble:(double)value - forKey:(uint64_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithDoubles:(const double [__nullable])values - forKeys:(const uint64_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBUInt64DoubleDictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -3824,70 +2569,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) GPBEnumValidationFunc validationFunc; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the given validation function. - * - * @param func The enum validation function for the dictionary. - * - * @return A newly instanced dictionary. - **/ -+ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param func The enum validation function for the dictionary. - * @param rawValue The raw enum value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func - rawValue:(int32_t)rawValue - forKey:(uint64_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param func The enum validation function for the dictionary. - * @param values The raw enum values values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func - rawValues:(const int32_t [__nullable])values - forKeys:(const uint64_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBUInt64EnumDictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param func The enum validation function for the dictionary. - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func - capacity:(NSUInteger)numItems; - -/** * Initializes a dictionary with the given validation function. * * @param func The enum validation function for the dictionary. @@ -4048,55 +2729,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param object The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithObject:(ObjectType)object - forKey:(uint64_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param objects The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithObjects:(const ObjectType __nonnull GPB_UNSAFE_UNRETAINED [__nullable])objects - forKeys:(const uint64_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBUInt64ObjectDictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param objects The values to be placed in this dictionary. @@ -4191,55 +2823,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithUInt32:(uint32_t)value - forKey:(int64_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithUInt32s:(const uint32_t [__nullable])values - forKeys:(const int64_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBInt64UInt32Dictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -4335,55 +2918,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithInt32:(int32_t)value - forKey:(int64_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithInt32s:(const int32_t [__nullable])values - forKeys:(const int64_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBInt64Int32Dictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -4479,55 +3013,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithUInt64:(uint64_t)value - forKey:(int64_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithUInt64s:(const uint64_t [__nullable])values - forKeys:(const int64_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBInt64UInt64Dictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -4623,55 +3108,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithInt64:(int64_t)value - forKey:(int64_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithInt64s:(const int64_t [__nullable])values - forKeys:(const int64_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBInt64Int64Dictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -4767,55 +3203,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithBool:(BOOL)value - forKey:(int64_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithBools:(const BOOL [__nullable])values - forKeys:(const int64_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBInt64BoolDictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -4911,55 +3298,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithFloat:(float)value - forKey:(int64_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithFloats:(const float [__nullable])values - forKeys:(const int64_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBInt64FloatDictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -5055,55 +3393,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithDouble:(double)value - forKey:(int64_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithDoubles:(const double [__nullable])values - forKeys:(const int64_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBInt64DoubleDictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -5201,70 +3490,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) GPBEnumValidationFunc validationFunc; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the given validation function. - * - * @param func The enum validation function for the dictionary. - * - * @return A newly instanced dictionary. - **/ -+ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param func The enum validation function for the dictionary. - * @param rawValue The raw enum value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func - rawValue:(int32_t)rawValue - forKey:(int64_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param func The enum validation function for the dictionary. - * @param values The raw enum values values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func - rawValues:(const int32_t [__nullable])values - forKeys:(const int64_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBInt64EnumDictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param func The enum validation function for the dictionary. - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func - capacity:(NSUInteger)numItems; - -/** * Initializes a dictionary with the given validation function. * * @param func The enum validation function for the dictionary. @@ -5425,55 +3650,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param object The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithObject:(ObjectType)object - forKey:(int64_t)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param objects The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithObjects:(const ObjectType __nonnull GPB_UNSAFE_UNRETAINED [__nullable])objects - forKeys:(const int64_t [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBInt64ObjectDictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param objects The values to be placed in this dictionary. @@ -5568,55 +3744,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithUInt32:(uint32_t)value - forKey:(BOOL)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithUInt32s:(const uint32_t [__nullable])values - forKeys:(const BOOL [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBBoolUInt32Dictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -5712,55 +3839,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithInt32:(int32_t)value - forKey:(BOOL)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithInt32s:(const int32_t [__nullable])values - forKeys:(const BOOL [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBBoolInt32Dictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -5856,55 +3934,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithUInt64:(uint64_t)value - forKey:(BOOL)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithUInt64s:(const uint64_t [__nullable])values - forKeys:(const BOOL [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBBoolUInt64Dictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -6000,55 +4029,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithInt64:(int64_t)value - forKey:(BOOL)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithInt64s:(const int64_t [__nullable])values - forKeys:(const BOOL [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBBoolInt64Dictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -6144,55 +4124,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithBool:(BOOL)value - forKey:(BOOL)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithBools:(const BOOL [__nullable])values - forKeys:(const BOOL [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBBoolBoolDictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -6288,55 +4219,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithFloat:(float)value - forKey:(BOOL)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithFloats:(const float [__nullable])values - forKeys:(const BOOL [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBBoolFloatDictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -6432,55 +4314,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithDouble:(double)value - forKey:(BOOL)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithDoubles:(const double [__nullable])values - forKeys:(const BOOL [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBBoolDoubleDictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -6578,70 +4411,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) GPBEnumValidationFunc validationFunc; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the given validation function. - * - * @param func The enum validation function for the dictionary. - * - * @return A newly instanced dictionary. - **/ -+ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param func The enum validation function for the dictionary. - * @param rawValue The raw enum value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func - rawValue:(int32_t)rawValue - forKey:(BOOL)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param func The enum validation function for the dictionary. - * @param values The raw enum values values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func - rawValues:(const int32_t [__nullable])values - forKeys:(const BOOL [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBBoolEnumDictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param func The enum validation function for the dictionary. - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func - capacity:(NSUInteger)numItems; - -/** * Initializes a dictionary with the given validation function. * * @param func The enum validation function for the dictionary. @@ -6802,55 +4571,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param object The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithObject:(ObjectType)object - forKey:(BOOL)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param objects The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithObjects:(const ObjectType __nonnull GPB_UNSAFE_UNRETAINED [__nullable])objects - forKeys:(const BOOL [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBBoolObjectDictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param objects The values to be placed in this dictionary. @@ -6945,55 +4665,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithUInt32:(uint32_t)value - forKey:(NSString *)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithUInt32s:(const uint32_t [__nullable])values - forKeys:(const NSString * __nonnull GPB_UNSAFE_UNRETAINED [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBStringUInt32Dictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -7089,55 +4760,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithInt32:(int32_t)value - forKey:(NSString *)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithInt32s:(const int32_t [__nullable])values - forKeys:(const NSString * __nonnull GPB_UNSAFE_UNRETAINED [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBStringInt32Dictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -7233,55 +4855,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithUInt64:(uint64_t)value - forKey:(NSString *)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithUInt64s:(const uint64_t [__nullable])values - forKeys:(const NSString * __nonnull GPB_UNSAFE_UNRETAINED [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBStringUInt64Dictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -7377,55 +4950,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithInt64:(int64_t)value - forKey:(NSString *)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithInt64s:(const int64_t [__nullable])values - forKeys:(const NSString * __nonnull GPB_UNSAFE_UNRETAINED [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBStringInt64Dictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -7521,55 +5045,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithBool:(BOOL)value - forKey:(NSString *)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithBools:(const BOOL [__nullable])values - forKeys:(const NSString * __nonnull GPB_UNSAFE_UNRETAINED [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBStringBoolDictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -7665,55 +5140,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithFloat:(float)value - forKey:(NSString *)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithFloats:(const float [__nullable])values - forKeys:(const NSString * __nonnull GPB_UNSAFE_UNRETAINED [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBStringFloatDictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -7809,55 +5235,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param value The value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithDouble:(double)value - forKey:(NSString *)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param values The values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithDoubles:(const double [__nullable])values - forKeys:(const NSString * __nonnull GPB_UNSAFE_UNRETAINED [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBStringDoubleDictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; - -/** * Initializes this dictionary, copying the given values and keys. * * @param values The values to be placed in this dictionary. @@ -7955,70 +5332,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) GPBEnumValidationFunc validationFunc; /** - * @return A newly instanced and empty dictionary. - **/ -+ (instancetype)dictionary; - -/** - * Creates and initializes a dictionary with the given validation function. - * - * @param func The enum validation function for the dictionary. - * - * @return A newly instanced dictionary. - **/ -+ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func; - -/** - * Creates and initializes a dictionary with the single entry given. - * - * @param func The enum validation function for the dictionary. - * @param rawValue The raw enum value to be placed in the dictionary. - * @param key The key under which to store the value. - * - * @return A newly instanced dictionary with the key and value in it. - **/ -+ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func - rawValue:(int32_t)rawValue - forKey:(NSString *)key; - -/** - * Creates and initializes a dictionary with the entries given. - * - * @param func The enum validation function for the dictionary. - * @param values The raw enum values values to be placed in the dictionary. - * @param keys The keys under which to store the values. - * @param count The number of entries to store in the dictionary. - * - * @return A newly instanced dictionary with the keys and values in it. - **/ -+ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func - rawValues:(const int32_t [__nullable])values - forKeys:(const NSString * __nonnull GPB_UNSAFE_UNRETAINED [__nullable])keys - count:(NSUInteger)count; - -/** - * Creates and initializes a dictionary with the entries from the given. - * dictionary. - * - * @param dictionary Dictionary containing the entries to add to the dictionary. - * - * @return A newly instanced dictionary with the entries from the given - * dictionary in it. - **/ -+ (instancetype)dictionaryWithDictionary:(GPBStringEnumDictionary *)dictionary; - -/** - * Creates and initializes a dictionary with the given capacity. - * - * @param func The enum validation function for the dictionary. - * @param numItems Capacity needed for the dictionary. - * - * @return A newly instanced dictionary with the given capacity. - **/ -+ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func - capacity:(NSUInteger)numItems; - -/** * Initializes a dictionary with the given validation function. * * @param func The enum validation function for the dictionary. @@ -8240,55 +5553,6 @@ NS_ASSUME_NONNULL_END //%@property(nonatomic, readonly) NSUInteger count; //% //%/** -//% * @return A newly instanced and empty dictionary. -//% **/ -//%+ (instancetype)dictionary; -//% -//%/** -//% * Creates and initializes a dictionary with the single entry given. -//% * -//% * @param ##VNAME_VAR The value to be placed in the dictionary. -//% * @param key ##VNAME_VAR$S## The key under which to store the value. -//% * -//% * @return A newly instanced dictionary with the key and value in it. -//% **/ -//%+ (instancetype)dictionaryWith##VNAME##:(VALUE_TYPE)##VNAME_VAR -//% ##VNAME$S## forKey:(KEY_TYPE##KisP$S##KisP)key; -//% -//%/** -//% * Creates and initializes a dictionary with the entries given. -//% * -//% * @param ##VNAME_VAR##s The values to be placed in the dictionary. -//% * @param keys ##VNAME_VAR$S## The keys under which to store the values. -//% * @param count ##VNAME_VAR$S## The number of entries to store in the dictionary. -//% * -//% * @return A newly instanced dictionary with the keys and values in it. -//% **/ -//%+ (instancetype)dictionaryWith##VNAME##s:(const VALUE_TYPE ARRAY_ARG_MODIFIER##VHELPER()[__nullable])##VNAME_VAR##s -//% ##VNAME$S## forKeys:(const KEY_TYPE##KisP$S##KisP ARRAY_ARG_MODIFIER##KHELPER()[__nullable])keys -//% ##VNAME$S## count:(NSUInteger)count; -//% -//%/** -//% * Creates and initializes a dictionary with the entries from the given. -//% * dictionary. -//% * -//% * @param dictionary Dictionary containing the entries to add to the dictionary. -//% * -//% * @return A newly instanced dictionary with the entries from the given -//% * dictionary in it. -//% **/ -//%+ (instancetype)dictionaryWithDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)dictionary; -//% -//%/** -//% * Creates and initializes a dictionary with the given capacity. -//% * -//% * @param numItems Capacity needed for the dictionary. -//% * -//% * @return A newly instanced dictionary with the given capacity. -//% **/ -//%+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; -//% -//%/** //% * Initializes this dictionary, copying the given values and keys. //% * //% * @param ##VNAME_VAR##s The values to be placed in this dictionary. @@ -8353,70 +5617,6 @@ NS_ASSUME_NONNULL_END //%@property(nonatomic, readonly) GPBEnumValidationFunc validationFunc; //% //%/** -//% * @return A newly instanced and empty dictionary. -//% **/ -//%+ (instancetype)dictionary; -//% -//%/** -//% * Creates and initializes a dictionary with the given validation function. -//% * -//% * @param func The enum validation function for the dictionary. -//% * -//% * @return A newly instanced dictionary. -//% **/ -//%+ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func; -//% -//%/** -//% * Creates and initializes a dictionary with the single entry given. -//% * -//% * @param func The enum validation function for the dictionary. -//% * @param rawValue The raw enum value to be placed in the dictionary. -//% * @param key The key under which to store the value. -//% * -//% * @return A newly instanced dictionary with the key and value in it. -//% **/ -//%+ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func -//% rawValue:(VALUE_TYPE)rawValue -//% forKey:(KEY_TYPE##KisP$S##KisP)key; -//% -//%/** -//% * Creates and initializes a dictionary with the entries given. -//% * -//% * @param func The enum validation function for the dictionary. -//% * @param values The raw enum values values to be placed in the dictionary. -//% * @param keys The keys under which to store the values. -//% * @param count The number of entries to store in the dictionary. -//% * -//% * @return A newly instanced dictionary with the keys and values in it. -//% **/ -//%+ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func -//% rawValues:(const VALUE_TYPE ARRAY_ARG_MODIFIER##VHELPER()[__nullable])values -//% forKeys:(const KEY_TYPE##KisP$S##KisP ARRAY_ARG_MODIFIER##KHELPER()[__nullable])keys -//% count:(NSUInteger)count; -//% -//%/** -//% * Creates and initializes a dictionary with the entries from the given. -//% * dictionary. -//% * -//% * @param dictionary Dictionary containing the entries to add to the dictionary. -//% * -//% * @return A newly instanced dictionary with the entries from the given -//% * dictionary in it. -//% **/ -//%+ (instancetype)dictionaryWithDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)dictionary; -//% -//%/** -//% * Creates and initializes a dictionary with the given capacity. -//% * -//% * @param func The enum validation function for the dictionary. -//% * @param numItems Capacity needed for the dictionary. -//% * -//% * @return A newly instanced dictionary with the given capacity. -//% **/ -//%+ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func -//% capacity:(NSUInteger)numItems; -//% -//%/** //% * Initializes a dictionary with the given validation function. //% * //% * @param func The enum validation function for the dictionary. diff --git a/objectivec/GPBDictionary.m b/objectivec/GPBDictionary.m index 7713376e..cedf5e54 100644 --- a/objectivec/GPBDictionary.m +++ b/objectivec/GPBDictionary.m @@ -596,39 +596,6 @@ void GPBDictionaryReadEntry(id mapDictionary, //% NSMutableDictionary *_dictionary; //%} //% -//%+ (instancetype)dictionary { -//% return [[[self alloc] initWith##VNAME##s:NULL forKeys:NULL count:0] autorelease]; -//%} -//% -//%+ (instancetype)dictionaryWith##VNAME##:(VALUE_TYPE)##VNAME_VAR -//% ##VNAME$S## forKey:(KEY_TYPE##KisP$S##KisP)key { -//% // Cast is needed so the compiler knows what class we are invoking initWith##VNAME##s:forKeys:count: -//% // on to get the type correct. -//% return [[(GPB##KEY_NAME##VALUE_NAME##Dictionary*)[self alloc] initWith##VNAME##s:&##VNAME_VAR -//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:&key -//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:1] autorelease]; -//%} -//% -//%+ (instancetype)dictionaryWith##VNAME##s:(const VALUE_TYPE [])##VNAME_VAR##s -//% ##VNAME$S## forKeys:(const KEY_TYPE##KisP$S##KisP [])keys -//% ##VNAME$S## count:(NSUInteger)count { -//% // Cast is needed so the compiler knows what class we are invoking initWith##VNAME##s:forKeys:count: -//% // on to get the type correct. -//% return [[(GPB##KEY_NAME##VALUE_NAME##Dictionary*)[self alloc] initWith##VNAME##s:##VNAME_VAR##s -//% KEY_NAME$S VALUE_NAME$S forKeys:keys -//% KEY_NAME$S VALUE_NAME$S count:count] autorelease]; -//%} -//% -//%+ (instancetype)dictionaryWithDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)dictionary { -//% // Cast is needed so the compiler knows what class we are invoking initWithDictionary: -//% // on to get the type correct. -//% return [[(GPB##KEY_NAME##VALUE_NAME##Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -//%} -//% -//%+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { -//% return [[[self alloc] initWithCapacity:numItems] autorelease]; -//%} -//% //%- (instancetype)init { //% return [self initWith##VNAME##s:NULL forKeys:NULL count:0]; //%} @@ -685,54 +652,6 @@ void GPBDictionaryReadEntry(id mapDictionary, //% //%@synthesize validationFunc = _validationFunc; //% -//%+ (instancetype)dictionary { -//% return [[[self alloc] initWithValidationFunction:NULL -//% rawValues:NULL -//% forKeys:NULL -//% count:0] autorelease]; -//%} -//% -//%+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func { -//% return [[[self alloc] initWithValidationFunction:func -//% rawValues:NULL -//% forKeys:NULL -//% count:0] autorelease]; -//%} -//% -//%+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func -//% rawValue:(VALUE_TYPE)rawValue -//% forKey:(KEY_TYPE##KisP$S##KisP)key { -//% // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: -//% // on to get the type correct. -//% return [[(GPB##KEY_NAME##VALUE_NAME##Dictionary*)[self alloc] initWithValidationFunction:func -//% KEY_NAME$S VALUE_NAME$S rawValues:&rawValue -//% KEY_NAME$S VALUE_NAME$S forKeys:&key -//% KEY_NAME$S VALUE_NAME$S count:1] autorelease]; -//%} -//% -//%+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func -//% rawValues:(const VALUE_TYPE [])rawValues -//% forKeys:(const KEY_TYPE##KisP$S##KisP [])keys -//% count:(NSUInteger)count { -//% // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: -//% // on to get the type correct. -//% return [[(GPB##KEY_NAME##VALUE_NAME##Dictionary*)[self alloc] initWithValidationFunction:func -//% KEY_NAME$S VALUE_NAME$S rawValues:rawValues -//% KEY_NAME$S VALUE_NAME$S forKeys:keys -//% KEY_NAME$S VALUE_NAME$S count:count] autorelease]; -//%} -//% -//%+ (instancetype)dictionaryWithDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)dictionary { -//% // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: -//% // on to get the type correct. -//% return [[(GPB##KEY_NAME##VALUE_NAME##Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -//%} -//% -//%+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func -//% capacity:(NSUInteger)numItems { -//% return [[[self alloc] initWithValidationFunction:func capacity:numItems] autorelease]; -//%} -//% //%- (instancetype)init { //% return [self initWithValidationFunction:NULL rawValues:NULL forKeys:NULL count:0]; //%} @@ -988,39 +907,6 @@ void GPBDictionaryReadEntry(id mapDictionary, //% VALUE_TYPE _values[2]; //%BOOL_DICT_HAS_STORAGE_##HELPER()} //% -//%+ (instancetype)dictionary { -//% return [[[self alloc] initWith##VNAME##s:NULL forKeys:NULL count:0] autorelease]; -//%} -//% -//%+ (instancetype)dictionaryWith##VNAME##:(VALUE_TYPE)VNAME_VAR -//% ##VNAME$S## forKey:(BOOL)key { -//% // Cast is needed so the compiler knows what class we are invoking initWith##VNAME##s:forKeys:count: -//% // on to get the type correct. -//% return [[(GPBBool##VALUE_NAME##Dictionary*)[self alloc] initWith##VNAME##s:&##VNAME_VAR -//% VALUE_NAME$S ##VNAME$S## forKeys:&key -//% VALUE_NAME$S ##VNAME$S## count:1] autorelease]; -//%} -//% -//%+ (instancetype)dictionaryWith##VNAME##s:(const VALUE_TYPE [])##VNAME_VAR##s -//% ##VNAME$S## forKeys:(const BOOL [])keys -//% ##VNAME$S## count:(NSUInteger)count { -//% // Cast is needed so the compiler knows what class we are invoking initWith##VNAME##s:forKeys:count: -//% // on to get the type correct. -//% return [[(GPBBool##VALUE_NAME##Dictionary*)[self alloc] initWith##VNAME##s:##VNAME_VAR##s -//% VALUE_NAME$S ##VNAME$S## forKeys:keys -//% VALUE_NAME$S ##VNAME$S## count:count] autorelease]; -//%} -//% -//%+ (instancetype)dictionaryWithDictionary:(GPBBool##VALUE_NAME##Dictionary *)dictionary { -//% // Cast is needed so the compiler knows what class we are invoking initWithDictionary: -//% // on to get the type correct. -//% return [[(GPBBool##VALUE_NAME##Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -//%} -//% -//%+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { -//% return [[[self alloc] initWithCapacity:numItems] autorelease]; -//%} -//% //%- (instancetype)init { //% return [self initWith##VNAME##s:NULL forKeys:NULL count:0]; //%} @@ -1549,39 +1435,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithUInt32s:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithUInt32:(uint32_t)value - forKey:(uint32_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithUInt32s:forKeys:count: - // on to get the type correct. - return [[(GPBUInt32UInt32Dictionary*)[self alloc] initWithUInt32s:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithUInt32s:(const uint32_t [])values - forKeys:(const uint32_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithUInt32s:forKeys:count: - // on to get the type correct. - return [[(GPBUInt32UInt32Dictionary*)[self alloc] initWithUInt32s:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBUInt32UInt32Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBUInt32UInt32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithUInt32s:NULL forKeys:NULL count:0]; } @@ -1765,39 +1618,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithInt32s:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithInt32:(int32_t)value - forKey:(uint32_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithInt32s:forKeys:count: - // on to get the type correct. - return [[(GPBUInt32Int32Dictionary*)[self alloc] initWithInt32s:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithInt32s:(const int32_t [])values - forKeys:(const uint32_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithInt32s:forKeys:count: - // on to get the type correct. - return [[(GPBUInt32Int32Dictionary*)[self alloc] initWithInt32s:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBUInt32Int32Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBUInt32Int32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithInt32s:NULL forKeys:NULL count:0]; } @@ -1981,39 +1801,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithUInt64s:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithUInt64:(uint64_t)value - forKey:(uint32_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithUInt64s:forKeys:count: - // on to get the type correct. - return [[(GPBUInt32UInt64Dictionary*)[self alloc] initWithUInt64s:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithUInt64s:(const uint64_t [])values - forKeys:(const uint32_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithUInt64s:forKeys:count: - // on to get the type correct. - return [[(GPBUInt32UInt64Dictionary*)[self alloc] initWithUInt64s:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBUInt32UInt64Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBUInt32UInt64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithUInt64s:NULL forKeys:NULL count:0]; } @@ -2197,39 +1984,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithInt64s:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithInt64:(int64_t)value - forKey:(uint32_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithInt64s:forKeys:count: - // on to get the type correct. - return [[(GPBUInt32Int64Dictionary*)[self alloc] initWithInt64s:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithInt64s:(const int64_t [])values - forKeys:(const uint32_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithInt64s:forKeys:count: - // on to get the type correct. - return [[(GPBUInt32Int64Dictionary*)[self alloc] initWithInt64s:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBUInt32Int64Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBUInt32Int64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithInt64s:NULL forKeys:NULL count:0]; } @@ -2413,39 +2167,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithBools:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithBool:(BOOL)value - forKey:(uint32_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithBools:forKeys:count: - // on to get the type correct. - return [[(GPBUInt32BoolDictionary*)[self alloc] initWithBools:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithBools:(const BOOL [])values - forKeys:(const uint32_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithBools:forKeys:count: - // on to get the type correct. - return [[(GPBUInt32BoolDictionary*)[self alloc] initWithBools:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBUInt32BoolDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBUInt32BoolDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithBools:NULL forKeys:NULL count:0]; } @@ -2629,39 +2350,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithFloats:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithFloat:(float)value - forKey:(uint32_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithFloats:forKeys:count: - // on to get the type correct. - return [[(GPBUInt32FloatDictionary*)[self alloc] initWithFloats:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithFloats:(const float [])values - forKeys:(const uint32_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithFloats:forKeys:count: - // on to get the type correct. - return [[(GPBUInt32FloatDictionary*)[self alloc] initWithFloats:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBUInt32FloatDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBUInt32FloatDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithFloats:NULL forKeys:NULL count:0]; } @@ -2845,39 +2533,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithDoubles:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithDouble:(double)value - forKey:(uint32_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithDoubles:forKeys:count: - // on to get the type correct. - return [[(GPBUInt32DoubleDictionary*)[self alloc] initWithDoubles:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithDoubles:(const double [])values - forKeys:(const uint32_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithDoubles:forKeys:count: - // on to get the type correct. - return [[(GPBUInt32DoubleDictionary*)[self alloc] initWithDoubles:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBUInt32DoubleDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBUInt32DoubleDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithDoubles:NULL forKeys:NULL count:0]; } @@ -3064,54 +2719,6 @@ void GPBDictionaryReadEntry(id mapDictionary, @synthesize validationFunc = _validationFunc; -+ (instancetype)dictionary { - return [[[self alloc] initWithValidationFunction:NULL - rawValues:NULL - forKeys:NULL - count:0] autorelease]; -} - -+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func { - return [[[self alloc] initWithValidationFunction:func - rawValues:NULL - forKeys:NULL - count:0] autorelease]; -} - -+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func - rawValue:(int32_t)rawValue - forKey:(uint32_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: - // on to get the type correct. - return [[(GPBUInt32EnumDictionary*)[self alloc] initWithValidationFunction:func - rawValues:&rawValue - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func - rawValues:(const int32_t [])rawValues - forKeys:(const uint32_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: - // on to get the type correct. - return [[(GPBUInt32EnumDictionary*)[self alloc] initWithValidationFunction:func - rawValues:rawValues - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBUInt32EnumDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: - // on to get the type correct. - return [[(GPBUInt32EnumDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func - capacity:(NSUInteger)numItems { - return [[[self alloc] initWithValidationFunction:func capacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithValidationFunction:NULL rawValues:NULL forKeys:NULL count:0]; } @@ -3361,39 +2968,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithObjects:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithObject:(id)object - forKey:(uint32_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithObjects:forKeys:count: - // on to get the type correct. - return [[(GPBUInt32ObjectDictionary*)[self alloc] initWithObjects:&object - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithObjects:(const id [])objects - forKeys:(const uint32_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithObjects:forKeys:count: - // on to get the type correct. - return [[(GPBUInt32ObjectDictionary*)[self alloc] initWithObjects:objects - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBUInt32ObjectDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBUInt32ObjectDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithObjects:NULL forKeys:NULL count:0]; } @@ -3609,39 +3183,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithUInt32s:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithUInt32:(uint32_t)value - forKey:(int32_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithUInt32s:forKeys:count: - // on to get the type correct. - return [[(GPBInt32UInt32Dictionary*)[self alloc] initWithUInt32s:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithUInt32s:(const uint32_t [])values - forKeys:(const int32_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithUInt32s:forKeys:count: - // on to get the type correct. - return [[(GPBInt32UInt32Dictionary*)[self alloc] initWithUInt32s:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBInt32UInt32Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBInt32UInt32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithUInt32s:NULL forKeys:NULL count:0]; } @@ -3825,39 +3366,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithInt32s:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithInt32:(int32_t)value - forKey:(int32_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithInt32s:forKeys:count: - // on to get the type correct. - return [[(GPBInt32Int32Dictionary*)[self alloc] initWithInt32s:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithInt32s:(const int32_t [])values - forKeys:(const int32_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithInt32s:forKeys:count: - // on to get the type correct. - return [[(GPBInt32Int32Dictionary*)[self alloc] initWithInt32s:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBInt32Int32Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBInt32Int32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithInt32s:NULL forKeys:NULL count:0]; } @@ -4041,39 +3549,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithUInt64s:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithUInt64:(uint64_t)value - forKey:(int32_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithUInt64s:forKeys:count: - // on to get the type correct. - return [[(GPBInt32UInt64Dictionary*)[self alloc] initWithUInt64s:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithUInt64s:(const uint64_t [])values - forKeys:(const int32_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithUInt64s:forKeys:count: - // on to get the type correct. - return [[(GPBInt32UInt64Dictionary*)[self alloc] initWithUInt64s:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBInt32UInt64Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBInt32UInt64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithUInt64s:NULL forKeys:NULL count:0]; } @@ -4257,39 +3732,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithInt64s:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithInt64:(int64_t)value - forKey:(int32_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithInt64s:forKeys:count: - // on to get the type correct. - return [[(GPBInt32Int64Dictionary*)[self alloc] initWithInt64s:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithInt64s:(const int64_t [])values - forKeys:(const int32_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithInt64s:forKeys:count: - // on to get the type correct. - return [[(GPBInt32Int64Dictionary*)[self alloc] initWithInt64s:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBInt32Int64Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBInt32Int64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithInt64s:NULL forKeys:NULL count:0]; } @@ -4473,39 +3915,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithBools:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithBool:(BOOL)value - forKey:(int32_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithBools:forKeys:count: - // on to get the type correct. - return [[(GPBInt32BoolDictionary*)[self alloc] initWithBools:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithBools:(const BOOL [])values - forKeys:(const int32_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithBools:forKeys:count: - // on to get the type correct. - return [[(GPBInt32BoolDictionary*)[self alloc] initWithBools:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBInt32BoolDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBInt32BoolDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithBools:NULL forKeys:NULL count:0]; } @@ -4689,39 +4098,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithFloats:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithFloat:(float)value - forKey:(int32_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithFloats:forKeys:count: - // on to get the type correct. - return [[(GPBInt32FloatDictionary*)[self alloc] initWithFloats:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithFloats:(const float [])values - forKeys:(const int32_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithFloats:forKeys:count: - // on to get the type correct. - return [[(GPBInt32FloatDictionary*)[self alloc] initWithFloats:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBInt32FloatDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBInt32FloatDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithFloats:NULL forKeys:NULL count:0]; } @@ -4905,39 +4281,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithDoubles:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithDouble:(double)value - forKey:(int32_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithDoubles:forKeys:count: - // on to get the type correct. - return [[(GPBInt32DoubleDictionary*)[self alloc] initWithDoubles:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithDoubles:(const double [])values - forKeys:(const int32_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithDoubles:forKeys:count: - // on to get the type correct. - return [[(GPBInt32DoubleDictionary*)[self alloc] initWithDoubles:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBInt32DoubleDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBInt32DoubleDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithDoubles:NULL forKeys:NULL count:0]; } @@ -5124,54 +4467,6 @@ void GPBDictionaryReadEntry(id mapDictionary, @synthesize validationFunc = _validationFunc; -+ (instancetype)dictionary { - return [[[self alloc] initWithValidationFunction:NULL - rawValues:NULL - forKeys:NULL - count:0] autorelease]; -} - -+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func { - return [[[self alloc] initWithValidationFunction:func - rawValues:NULL - forKeys:NULL - count:0] autorelease]; -} - -+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func - rawValue:(int32_t)rawValue - forKey:(int32_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: - // on to get the type correct. - return [[(GPBInt32EnumDictionary*)[self alloc] initWithValidationFunction:func - rawValues:&rawValue - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func - rawValues:(const int32_t [])rawValues - forKeys:(const int32_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: - // on to get the type correct. - return [[(GPBInt32EnumDictionary*)[self alloc] initWithValidationFunction:func - rawValues:rawValues - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBInt32EnumDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: - // on to get the type correct. - return [[(GPBInt32EnumDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func - capacity:(NSUInteger)numItems { - return [[[self alloc] initWithValidationFunction:func capacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithValidationFunction:NULL rawValues:NULL forKeys:NULL count:0]; } @@ -5421,39 +4716,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithObjects:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithObject:(id)object - forKey:(int32_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithObjects:forKeys:count: - // on to get the type correct. - return [[(GPBInt32ObjectDictionary*)[self alloc] initWithObjects:&object - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithObjects:(const id [])objects - forKeys:(const int32_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithObjects:forKeys:count: - // on to get the type correct. - return [[(GPBInt32ObjectDictionary*)[self alloc] initWithObjects:objects - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBInt32ObjectDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBInt32ObjectDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithObjects:NULL forKeys:NULL count:0]; } @@ -5669,39 +4931,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithUInt32s:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithUInt32:(uint32_t)value - forKey:(uint64_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithUInt32s:forKeys:count: - // on to get the type correct. - return [[(GPBUInt64UInt32Dictionary*)[self alloc] initWithUInt32s:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithUInt32s:(const uint32_t [])values - forKeys:(const uint64_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithUInt32s:forKeys:count: - // on to get the type correct. - return [[(GPBUInt64UInt32Dictionary*)[self alloc] initWithUInt32s:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBUInt64UInt32Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBUInt64UInt32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithUInt32s:NULL forKeys:NULL count:0]; } @@ -5885,39 +5114,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithInt32s:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithInt32:(int32_t)value - forKey:(uint64_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithInt32s:forKeys:count: - // on to get the type correct. - return [[(GPBUInt64Int32Dictionary*)[self alloc] initWithInt32s:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithInt32s:(const int32_t [])values - forKeys:(const uint64_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithInt32s:forKeys:count: - // on to get the type correct. - return [[(GPBUInt64Int32Dictionary*)[self alloc] initWithInt32s:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBUInt64Int32Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBUInt64Int32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithInt32s:NULL forKeys:NULL count:0]; } @@ -6101,39 +5297,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithUInt64s:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithUInt64:(uint64_t)value - forKey:(uint64_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithUInt64s:forKeys:count: - // on to get the type correct. - return [[(GPBUInt64UInt64Dictionary*)[self alloc] initWithUInt64s:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithUInt64s:(const uint64_t [])values - forKeys:(const uint64_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithUInt64s:forKeys:count: - // on to get the type correct. - return [[(GPBUInt64UInt64Dictionary*)[self alloc] initWithUInt64s:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBUInt64UInt64Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBUInt64UInt64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithUInt64s:NULL forKeys:NULL count:0]; } @@ -6317,39 +5480,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithInt64s:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithInt64:(int64_t)value - forKey:(uint64_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithInt64s:forKeys:count: - // on to get the type correct. - return [[(GPBUInt64Int64Dictionary*)[self alloc] initWithInt64s:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithInt64s:(const int64_t [])values - forKeys:(const uint64_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithInt64s:forKeys:count: - // on to get the type correct. - return [[(GPBUInt64Int64Dictionary*)[self alloc] initWithInt64s:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBUInt64Int64Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBUInt64Int64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithInt64s:NULL forKeys:NULL count:0]; } @@ -6533,39 +5663,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithBools:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithBool:(BOOL)value - forKey:(uint64_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithBools:forKeys:count: - // on to get the type correct. - return [[(GPBUInt64BoolDictionary*)[self alloc] initWithBools:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithBools:(const BOOL [])values - forKeys:(const uint64_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithBools:forKeys:count: - // on to get the type correct. - return [[(GPBUInt64BoolDictionary*)[self alloc] initWithBools:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBUInt64BoolDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBUInt64BoolDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithBools:NULL forKeys:NULL count:0]; } @@ -6749,39 +5846,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithFloats:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithFloat:(float)value - forKey:(uint64_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithFloats:forKeys:count: - // on to get the type correct. - return [[(GPBUInt64FloatDictionary*)[self alloc] initWithFloats:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithFloats:(const float [])values - forKeys:(const uint64_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithFloats:forKeys:count: - // on to get the type correct. - return [[(GPBUInt64FloatDictionary*)[self alloc] initWithFloats:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBUInt64FloatDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBUInt64FloatDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithFloats:NULL forKeys:NULL count:0]; } @@ -6965,39 +6029,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithDoubles:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithDouble:(double)value - forKey:(uint64_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithDoubles:forKeys:count: - // on to get the type correct. - return [[(GPBUInt64DoubleDictionary*)[self alloc] initWithDoubles:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithDoubles:(const double [])values - forKeys:(const uint64_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithDoubles:forKeys:count: - // on to get the type correct. - return [[(GPBUInt64DoubleDictionary*)[self alloc] initWithDoubles:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBUInt64DoubleDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBUInt64DoubleDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithDoubles:NULL forKeys:NULL count:0]; } @@ -7184,54 +6215,6 @@ void GPBDictionaryReadEntry(id mapDictionary, @synthesize validationFunc = _validationFunc; -+ (instancetype)dictionary { - return [[[self alloc] initWithValidationFunction:NULL - rawValues:NULL - forKeys:NULL - count:0] autorelease]; -} - -+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func { - return [[[self alloc] initWithValidationFunction:func - rawValues:NULL - forKeys:NULL - count:0] autorelease]; -} - -+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func - rawValue:(int32_t)rawValue - forKey:(uint64_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: - // on to get the type correct. - return [[(GPBUInt64EnumDictionary*)[self alloc] initWithValidationFunction:func - rawValues:&rawValue - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func - rawValues:(const int32_t [])rawValues - forKeys:(const uint64_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: - // on to get the type correct. - return [[(GPBUInt64EnumDictionary*)[self alloc] initWithValidationFunction:func - rawValues:rawValues - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBUInt64EnumDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: - // on to get the type correct. - return [[(GPBUInt64EnumDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func - capacity:(NSUInteger)numItems { - return [[[self alloc] initWithValidationFunction:func capacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithValidationFunction:NULL rawValues:NULL forKeys:NULL count:0]; } @@ -7481,39 +6464,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithObjects:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithObject:(id)object - forKey:(uint64_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithObjects:forKeys:count: - // on to get the type correct. - return [[(GPBUInt64ObjectDictionary*)[self alloc] initWithObjects:&object - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithObjects:(const id [])objects - forKeys:(const uint64_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithObjects:forKeys:count: - // on to get the type correct. - return [[(GPBUInt64ObjectDictionary*)[self alloc] initWithObjects:objects - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBUInt64ObjectDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBUInt64ObjectDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithObjects:NULL forKeys:NULL count:0]; } @@ -7729,39 +6679,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithUInt32s:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithUInt32:(uint32_t)value - forKey:(int64_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithUInt32s:forKeys:count: - // on to get the type correct. - return [[(GPBInt64UInt32Dictionary*)[self alloc] initWithUInt32s:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithUInt32s:(const uint32_t [])values - forKeys:(const int64_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithUInt32s:forKeys:count: - // on to get the type correct. - return [[(GPBInt64UInt32Dictionary*)[self alloc] initWithUInt32s:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBInt64UInt32Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBInt64UInt32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithUInt32s:NULL forKeys:NULL count:0]; } @@ -7945,39 +6862,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithInt32s:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithInt32:(int32_t)value - forKey:(int64_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithInt32s:forKeys:count: - // on to get the type correct. - return [[(GPBInt64Int32Dictionary*)[self alloc] initWithInt32s:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithInt32s:(const int32_t [])values - forKeys:(const int64_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithInt32s:forKeys:count: - // on to get the type correct. - return [[(GPBInt64Int32Dictionary*)[self alloc] initWithInt32s:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBInt64Int32Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBInt64Int32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithInt32s:NULL forKeys:NULL count:0]; } @@ -8161,39 +7045,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithUInt64s:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithUInt64:(uint64_t)value - forKey:(int64_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithUInt64s:forKeys:count: - // on to get the type correct. - return [[(GPBInt64UInt64Dictionary*)[self alloc] initWithUInt64s:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithUInt64s:(const uint64_t [])values - forKeys:(const int64_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithUInt64s:forKeys:count: - // on to get the type correct. - return [[(GPBInt64UInt64Dictionary*)[self alloc] initWithUInt64s:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBInt64UInt64Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBInt64UInt64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithUInt64s:NULL forKeys:NULL count:0]; } @@ -8377,39 +7228,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithInt64s:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithInt64:(int64_t)value - forKey:(int64_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithInt64s:forKeys:count: - // on to get the type correct. - return [[(GPBInt64Int64Dictionary*)[self alloc] initWithInt64s:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithInt64s:(const int64_t [])values - forKeys:(const int64_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithInt64s:forKeys:count: - // on to get the type correct. - return [[(GPBInt64Int64Dictionary*)[self alloc] initWithInt64s:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBInt64Int64Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBInt64Int64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithInt64s:NULL forKeys:NULL count:0]; } @@ -8593,39 +7411,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithBools:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithBool:(BOOL)value - forKey:(int64_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithBools:forKeys:count: - // on to get the type correct. - return [[(GPBInt64BoolDictionary*)[self alloc] initWithBools:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithBools:(const BOOL [])values - forKeys:(const int64_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithBools:forKeys:count: - // on to get the type correct. - return [[(GPBInt64BoolDictionary*)[self alloc] initWithBools:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBInt64BoolDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBInt64BoolDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithBools:NULL forKeys:NULL count:0]; } @@ -8809,39 +7594,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithFloats:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithFloat:(float)value - forKey:(int64_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithFloats:forKeys:count: - // on to get the type correct. - return [[(GPBInt64FloatDictionary*)[self alloc] initWithFloats:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithFloats:(const float [])values - forKeys:(const int64_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithFloats:forKeys:count: - // on to get the type correct. - return [[(GPBInt64FloatDictionary*)[self alloc] initWithFloats:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBInt64FloatDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBInt64FloatDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithFloats:NULL forKeys:NULL count:0]; } @@ -9025,39 +7777,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithDoubles:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithDouble:(double)value - forKey:(int64_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithDoubles:forKeys:count: - // on to get the type correct. - return [[(GPBInt64DoubleDictionary*)[self alloc] initWithDoubles:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithDoubles:(const double [])values - forKeys:(const int64_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithDoubles:forKeys:count: - // on to get the type correct. - return [[(GPBInt64DoubleDictionary*)[self alloc] initWithDoubles:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBInt64DoubleDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBInt64DoubleDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithDoubles:NULL forKeys:NULL count:0]; } @@ -9244,54 +7963,6 @@ void GPBDictionaryReadEntry(id mapDictionary, @synthesize validationFunc = _validationFunc; -+ (instancetype)dictionary { - return [[[self alloc] initWithValidationFunction:NULL - rawValues:NULL - forKeys:NULL - count:0] autorelease]; -} - -+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func { - return [[[self alloc] initWithValidationFunction:func - rawValues:NULL - forKeys:NULL - count:0] autorelease]; -} - -+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func - rawValue:(int32_t)rawValue - forKey:(int64_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: - // on to get the type correct. - return [[(GPBInt64EnumDictionary*)[self alloc] initWithValidationFunction:func - rawValues:&rawValue - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func - rawValues:(const int32_t [])rawValues - forKeys:(const int64_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: - // on to get the type correct. - return [[(GPBInt64EnumDictionary*)[self alloc] initWithValidationFunction:func - rawValues:rawValues - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBInt64EnumDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: - // on to get the type correct. - return [[(GPBInt64EnumDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func - capacity:(NSUInteger)numItems { - return [[[self alloc] initWithValidationFunction:func capacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithValidationFunction:NULL rawValues:NULL forKeys:NULL count:0]; } @@ -9541,39 +8212,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithObjects:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithObject:(id)object - forKey:(int64_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithObjects:forKeys:count: - // on to get the type correct. - return [[(GPBInt64ObjectDictionary*)[self alloc] initWithObjects:&object - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithObjects:(const id [])objects - forKeys:(const int64_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithObjects:forKeys:count: - // on to get the type correct. - return [[(GPBInt64ObjectDictionary*)[self alloc] initWithObjects:objects - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBInt64ObjectDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBInt64ObjectDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithObjects:NULL forKeys:NULL count:0]; } @@ -9789,39 +8427,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithUInt32s:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithUInt32:(uint32_t)value - forKey:(NSString *)key { - // Cast is needed so the compiler knows what class we are invoking initWithUInt32s:forKeys:count: - // on to get the type correct. - return [[(GPBStringUInt32Dictionary*)[self alloc] initWithUInt32s:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithUInt32s:(const uint32_t [])values - forKeys:(const NSString * [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithUInt32s:forKeys:count: - // on to get the type correct. - return [[(GPBStringUInt32Dictionary*)[self alloc] initWithUInt32s:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBStringUInt32Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBStringUInt32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithUInt32s:NULL forKeys:NULL count:0]; } @@ -10013,39 +8618,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithInt32s:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithInt32:(int32_t)value - forKey:(NSString *)key { - // Cast is needed so the compiler knows what class we are invoking initWithInt32s:forKeys:count: - // on to get the type correct. - return [[(GPBStringInt32Dictionary*)[self alloc] initWithInt32s:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithInt32s:(const int32_t [])values - forKeys:(const NSString * [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithInt32s:forKeys:count: - // on to get the type correct. - return [[(GPBStringInt32Dictionary*)[self alloc] initWithInt32s:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBStringInt32Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBStringInt32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithInt32s:NULL forKeys:NULL count:0]; } @@ -10237,39 +8809,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithUInt64s:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithUInt64:(uint64_t)value - forKey:(NSString *)key { - // Cast is needed so the compiler knows what class we are invoking initWithUInt64s:forKeys:count: - // on to get the type correct. - return [[(GPBStringUInt64Dictionary*)[self alloc] initWithUInt64s:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithUInt64s:(const uint64_t [])values - forKeys:(const NSString * [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithUInt64s:forKeys:count: - // on to get the type correct. - return [[(GPBStringUInt64Dictionary*)[self alloc] initWithUInt64s:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBStringUInt64Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBStringUInt64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithUInt64s:NULL forKeys:NULL count:0]; } @@ -10461,39 +9000,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithInt64s:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithInt64:(int64_t)value - forKey:(NSString *)key { - // Cast is needed so the compiler knows what class we are invoking initWithInt64s:forKeys:count: - // on to get the type correct. - return [[(GPBStringInt64Dictionary*)[self alloc] initWithInt64s:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithInt64s:(const int64_t [])values - forKeys:(const NSString * [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithInt64s:forKeys:count: - // on to get the type correct. - return [[(GPBStringInt64Dictionary*)[self alloc] initWithInt64s:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBStringInt64Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBStringInt64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithInt64s:NULL forKeys:NULL count:0]; } @@ -10685,39 +9191,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithBools:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithBool:(BOOL)value - forKey:(NSString *)key { - // Cast is needed so the compiler knows what class we are invoking initWithBools:forKeys:count: - // on to get the type correct. - return [[(GPBStringBoolDictionary*)[self alloc] initWithBools:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithBools:(const BOOL [])values - forKeys:(const NSString * [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithBools:forKeys:count: - // on to get the type correct. - return [[(GPBStringBoolDictionary*)[self alloc] initWithBools:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBStringBoolDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBStringBoolDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithBools:NULL forKeys:NULL count:0]; } @@ -10909,39 +9382,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithFloats:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithFloat:(float)value - forKey:(NSString *)key { - // Cast is needed so the compiler knows what class we are invoking initWithFloats:forKeys:count: - // on to get the type correct. - return [[(GPBStringFloatDictionary*)[self alloc] initWithFloats:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithFloats:(const float [])values - forKeys:(const NSString * [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithFloats:forKeys:count: - // on to get the type correct. - return [[(GPBStringFloatDictionary*)[self alloc] initWithFloats:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBStringFloatDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBStringFloatDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithFloats:NULL forKeys:NULL count:0]; } @@ -11133,39 +9573,6 @@ void GPBDictionaryReadEntry(id mapDictionary, NSMutableDictionary *_dictionary; } -+ (instancetype)dictionary { - return [[[self alloc] initWithDoubles:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithDouble:(double)value - forKey:(NSString *)key { - // Cast is needed so the compiler knows what class we are invoking initWithDoubles:forKeys:count: - // on to get the type correct. - return [[(GPBStringDoubleDictionary*)[self alloc] initWithDoubles:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithDoubles:(const double [])values - forKeys:(const NSString * [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithDoubles:forKeys:count: - // on to get the type correct. - return [[(GPBStringDoubleDictionary*)[self alloc] initWithDoubles:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBStringDoubleDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBStringDoubleDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithDoubles:NULL forKeys:NULL count:0]; } @@ -11360,54 +9767,6 @@ void GPBDictionaryReadEntry(id mapDictionary, @synthesize validationFunc = _validationFunc; -+ (instancetype)dictionary { - return [[[self alloc] initWithValidationFunction:NULL - rawValues:NULL - forKeys:NULL - count:0] autorelease]; -} - -+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func { - return [[[self alloc] initWithValidationFunction:func - rawValues:NULL - forKeys:NULL - count:0] autorelease]; -} - -+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func - rawValue:(int32_t)rawValue - forKey:(NSString *)key { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: - // on to get the type correct. - return [[(GPBStringEnumDictionary*)[self alloc] initWithValidationFunction:func - rawValues:&rawValue - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func - rawValues:(const int32_t [])rawValues - forKeys:(const NSString * [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: - // on to get the type correct. - return [[(GPBStringEnumDictionary*)[self alloc] initWithValidationFunction:func - rawValues:rawValues - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBStringEnumDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: - // on to get the type correct. - return [[(GPBStringEnumDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func - capacity:(NSUInteger)numItems { - return [[[self alloc] initWithValidationFunction:func capacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithValidationFunction:NULL rawValues:NULL forKeys:NULL count:0]; } @@ -11676,39 +10035,6 @@ void GPBDictionaryReadEntry(id mapDictionary, BOOL _valueSet[2]; } -+ (instancetype)dictionary { - return [[[self alloc] initWithUInt32s:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithUInt32:(uint32_t)value - forKey:(BOOL)key { - // Cast is needed so the compiler knows what class we are invoking initWithUInt32s:forKeys:count: - // on to get the type correct. - return [[(GPBBoolUInt32Dictionary*)[self alloc] initWithUInt32s:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithUInt32s:(const uint32_t [])values - forKeys:(const BOOL [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithUInt32s:forKeys:count: - // on to get the type correct. - return [[(GPBBoolUInt32Dictionary*)[self alloc] initWithUInt32s:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBBoolUInt32Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBBoolUInt32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithUInt32s:NULL forKeys:NULL count:0]; } @@ -11918,39 +10244,6 @@ void GPBDictionaryReadEntry(id mapDictionary, BOOL _valueSet[2]; } -+ (instancetype)dictionary { - return [[[self alloc] initWithInt32s:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithInt32:(int32_t)value - forKey:(BOOL)key { - // Cast is needed so the compiler knows what class we are invoking initWithInt32s:forKeys:count: - // on to get the type correct. - return [[(GPBBoolInt32Dictionary*)[self alloc] initWithInt32s:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithInt32s:(const int32_t [])values - forKeys:(const BOOL [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithInt32s:forKeys:count: - // on to get the type correct. - return [[(GPBBoolInt32Dictionary*)[self alloc] initWithInt32s:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBBoolInt32Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBBoolInt32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithInt32s:NULL forKeys:NULL count:0]; } @@ -12160,39 +10453,6 @@ void GPBDictionaryReadEntry(id mapDictionary, BOOL _valueSet[2]; } -+ (instancetype)dictionary { - return [[[self alloc] initWithUInt64s:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithUInt64:(uint64_t)value - forKey:(BOOL)key { - // Cast is needed so the compiler knows what class we are invoking initWithUInt64s:forKeys:count: - // on to get the type correct. - return [[(GPBBoolUInt64Dictionary*)[self alloc] initWithUInt64s:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithUInt64s:(const uint64_t [])values - forKeys:(const BOOL [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithUInt64s:forKeys:count: - // on to get the type correct. - return [[(GPBBoolUInt64Dictionary*)[self alloc] initWithUInt64s:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBBoolUInt64Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBBoolUInt64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithUInt64s:NULL forKeys:NULL count:0]; } @@ -12402,39 +10662,6 @@ void GPBDictionaryReadEntry(id mapDictionary, BOOL _valueSet[2]; } -+ (instancetype)dictionary { - return [[[self alloc] initWithInt64s:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithInt64:(int64_t)value - forKey:(BOOL)key { - // Cast is needed so the compiler knows what class we are invoking initWithInt64s:forKeys:count: - // on to get the type correct. - return [[(GPBBoolInt64Dictionary*)[self alloc] initWithInt64s:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithInt64s:(const int64_t [])values - forKeys:(const BOOL [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithInt64s:forKeys:count: - // on to get the type correct. - return [[(GPBBoolInt64Dictionary*)[self alloc] initWithInt64s:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBBoolInt64Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBBoolInt64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithInt64s:NULL forKeys:NULL count:0]; } @@ -12644,39 +10871,6 @@ void GPBDictionaryReadEntry(id mapDictionary, BOOL _valueSet[2]; } -+ (instancetype)dictionary { - return [[[self alloc] initWithBools:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithBool:(BOOL)value - forKey:(BOOL)key { - // Cast is needed so the compiler knows what class we are invoking initWithBools:forKeys:count: - // on to get the type correct. - return [[(GPBBoolBoolDictionary*)[self alloc] initWithBools:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithBools:(const BOOL [])values - forKeys:(const BOOL [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithBools:forKeys:count: - // on to get the type correct. - return [[(GPBBoolBoolDictionary*)[self alloc] initWithBools:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBBoolBoolDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBBoolBoolDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithBools:NULL forKeys:NULL count:0]; } @@ -12886,39 +11080,6 @@ void GPBDictionaryReadEntry(id mapDictionary, BOOL _valueSet[2]; } -+ (instancetype)dictionary { - return [[[self alloc] initWithFloats:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithFloat:(float)value - forKey:(BOOL)key { - // Cast is needed so the compiler knows what class we are invoking initWithFloats:forKeys:count: - // on to get the type correct. - return [[(GPBBoolFloatDictionary*)[self alloc] initWithFloats:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithFloats:(const float [])values - forKeys:(const BOOL [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithFloats:forKeys:count: - // on to get the type correct. - return [[(GPBBoolFloatDictionary*)[self alloc] initWithFloats:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBBoolFloatDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBBoolFloatDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithFloats:NULL forKeys:NULL count:0]; } @@ -13128,39 +11289,6 @@ void GPBDictionaryReadEntry(id mapDictionary, BOOL _valueSet[2]; } -+ (instancetype)dictionary { - return [[[self alloc] initWithDoubles:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithDouble:(double)value - forKey:(BOOL)key { - // Cast is needed so the compiler knows what class we are invoking initWithDoubles:forKeys:count: - // on to get the type correct. - return [[(GPBBoolDoubleDictionary*)[self alloc] initWithDoubles:&value - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithDoubles:(const double [])values - forKeys:(const BOOL [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithDoubles:forKeys:count: - // on to get the type correct. - return [[(GPBBoolDoubleDictionary*)[self alloc] initWithDoubles:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBBoolDoubleDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBBoolDoubleDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithDoubles:NULL forKeys:NULL count:0]; } @@ -13369,39 +11497,6 @@ void GPBDictionaryReadEntry(id mapDictionary, id _values[2]; } -+ (instancetype)dictionary { - return [[[self alloc] initWithObjects:NULL forKeys:NULL count:0] autorelease]; -} - -+ (instancetype)dictionaryWithObject:(id)object - forKey:(BOOL)key { - // Cast is needed so the compiler knows what class we are invoking initWithObjects:forKeys:count: - // on to get the type correct. - return [[(GPBBoolObjectDictionary*)[self alloc] initWithObjects:&object - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithObjects:(const id [])objects - forKeys:(const BOOL [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithObjects:forKeys:count: - // on to get the type correct. - return [[(GPBBoolObjectDictionary*)[self alloc] initWithObjects:objects - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBBoolObjectDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithDictionary: - // on to get the type correct. - return [[(GPBBoolObjectDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { - return [[[self alloc] initWithCapacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithObjects:NULL forKeys:NULL count:0]; } @@ -13635,54 +11730,6 @@ void GPBDictionaryReadEntry(id mapDictionary, @synthesize validationFunc = _validationFunc; -+ (instancetype)dictionary { - return [[[self alloc] initWithValidationFunction:NULL - rawValues:NULL - forKeys:NULL - count:0] autorelease]; -} - -+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func { - return [[[self alloc] initWithValidationFunction:func - rawValues:NULL - forKeys:NULL - count:0] autorelease]; -} - -+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func - rawValue:(int32_t)rawValue - forKey:(BOOL)key { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: - // on to get the type correct. - return [[(GPBBoolEnumDictionary*)[self alloc] initWithValidationFunction:func - rawValues:&rawValue - forKeys:&key - count:1] autorelease]; -} - -+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func - rawValues:(const int32_t [])values - forKeys:(const BOOL [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: - // on to get the type correct. - return [[(GPBBoolEnumDictionary*)[self alloc] initWithValidationFunction:func - rawValues:values - forKeys:keys - count:count] autorelease]; -} - -+ (instancetype)dictionaryWithDictionary:(GPBBoolEnumDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: - // on to get the type correct. - return [[(GPBBoolEnumDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; -} - -+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func - capacity:(NSUInteger)numItems { - return [[[self alloc] initWithValidationFunction:func capacity:numItems] autorelease]; -} - - (instancetype)init { return [self initWithValidationFunction:NULL rawValues:NULL forKeys:NULL count:0]; } @@ -14055,14 +12102,14 @@ void GPBDictionaryReadEntry(id mapDictionary, } } -- (void)enumerateKeysAndObjectsUsingBlock:(void (^)(id key, +- (void)enumerateKeysAndObjectsUsingBlock:(void (NS_NOESCAPE ^)(id key, id obj, BOOL *stop))block { [_dictionary enumerateKeysAndObjectsUsingBlock:block]; } - (void)enumerateKeysAndObjectsWithOptions:(NSEnumerationOptions)opts - usingBlock:(void (^)(id key, + usingBlock:(void (NS_NOESCAPE ^)(id key, id obj, BOOL *stop))block { [_dictionary enumerateKeysAndObjectsWithOptions:opts usingBlock:block]; diff --git a/objectivec/GPBMessage.m b/objectivec/GPBMessage.m index afe39c1e..db5d3b60 100644 --- a/objectivec/GPBMessage.m +++ b/objectivec/GPBMessage.m @@ -32,6 +32,7 @@ #import <objc/runtime.h> #import <objc/message.h> +#import <stdatomic.h> #import "GPBArray_PackagePrivate.h" #import "GPBCodedInputStream_PackagePrivate.h" @@ -77,6 +78,20 @@ static NSString *const kGPBDataCoderKey = @"GPBData"; GPBMessage *autocreator_; GPBFieldDescriptor *autocreatorField_; GPBExtensionDescriptor *autocreatorExtension_; + + // A lock to provide mutual exclusion from internal data that can be modified + // by *read* operations such as getters (autocreation of message fields and + // message extensions, not setting of values). Used to guarantee thread safety + // for concurrent reads on the message. + // NOTE: OSSpinLock may seem like a good fit here but Apple engineers have + // pointed out that they are vulnerable to live locking on iOS in cases of + // priority inversion: + // http://mjtsai.com/blog/2015/12/16/osspinlock-is-unsafe/ + // https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20151214/000372.html + // Use of readOnlySemaphore_ must be prefaced by a call to + // GPBPrepareReadOnlySemaphore to ensure it has been created. This allows + // readOnlySemaphore_ to be only created when actually needed. + _Atomic(dispatch_semaphore_t) readOnlySemaphore_; } @end @@ -742,16 +757,22 @@ void GPBClearMessageAutocreator(GPBMessage *self) { void GPBPrepareReadOnlySemaphore(GPBMessage *self) { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdirect-ivar-access" -#pragma clang diagnostic ignored "-Wdeprecated-declarations" // Create the semaphore on demand (rather than init) as developers might not cause them // to be needed, and the heap usage can add up. The atomic swap is used to avoid needing // another lock around creating it. if (self->readOnlySemaphore_ == nil) { dispatch_semaphore_t worker = dispatch_semaphore_create(1); - if (!OSAtomicCompareAndSwapPtrBarrier(NULL, worker, (void * volatile *)&(self->readOnlySemaphore_))) { + dispatch_semaphore_t expected = nil; + if (!atomic_compare_exchange_strong(&self->readOnlySemaphore_, &expected, worker)) { dispatch_release(worker); } +#if defined(__clang_analyzer__) + // The Xcode 9.2 (and 9.3 beta) static analyzer thinks worker is leaked + // (doesn't seem to know about atomic_compare_exchange_strong); so just + // for the analyzer, let it think worker is also released in this case. + else { dispatch_release(worker); } +#endif } #pragma clang diagnostic pop @@ -969,7 +990,8 @@ static GPBUnknownFieldSet *GetOrMakeUnknownFields(GPBMessage *self) { newValue = [value copyWithZone:zone]; } } else { - if (field.mapKeyDataType == GPBDataTypeString) { + if ((field.mapKeyDataType == GPBDataTypeString) && + GPBFieldDataTypeIsObject(field)) { // NSDictionary newValue = [value mutableCopyWithZone:zone]; } else { @@ -2026,7 +2048,12 @@ static GPBUnknownFieldSet *GetOrMakeUnknownFields(GPBMessage *self) { [newInput release]; } else { GPBUnknownFieldSet *unknownFields = GetOrMakeUnknownFields(self); - [unknownFields mergeMessageSetMessage:typeId data:rawBytes]; + // rawBytes was created via a NoCopy, so it can be reusing a + // subrange of another NSData that might go out of scope as things + // unwind, so a copy is needed to ensure what is saved in the + // unknown fields stays valid. + NSData *cloned = [NSData dataWithData:rawBytes]; + [unknownFields mergeMessageSetMessage:typeId data:cloned]; } } } @@ -2998,7 +3025,10 @@ typedef struct ResolveIvarAccessorMethodResult { SEL encodingSelector; } ResolveIvarAccessorMethodResult; -static void ResolveIvarGet(GPBFieldDescriptor *field, +// |field| can be __unsafe_unretained because they are created at startup +// and are essentially global. No need to pay for retain/release when +// they are captured in blocks. +static void ResolveIvarGet(__unsafe_unretained GPBFieldDescriptor *field, ResolveIvarAccessorMethodResult *result) { GPBDataType fieldDataType = GPBGetFieldDataType(field); switch (fieldDataType) { @@ -3040,7 +3070,8 @@ static void ResolveIvarGet(GPBFieldDescriptor *field, } } -static void ResolveIvarSet(GPBFieldDescriptor *field, +// See comment about __unsafe_unretained on ResolveIvarGet. +static void ResolveIvarSet(__unsafe_unretained GPBFieldDescriptor *field, GPBFileSyntax syntax, ResolveIvarAccessorMethodResult *result) { GPBDataType fieldDataType = GPBGetFieldDataType(field); @@ -3084,9 +3115,10 @@ static void ResolveIvarSet(GPBFieldDescriptor *field, // NOTE: hasOrCountSel_/setHasSel_ will be NULL if the field for the given // message should not have has support (done in GPBDescriptor.m), so there is // no need for checks here to see if has*/setHas* are allowed. - ResolveIvarAccessorMethodResult result = {NULL, NULL}; - for (GPBFieldDescriptor *field in descriptor->fields_) { + + // See comment about __unsafe_unretained on ResolveIvarGet. + for (__unsafe_unretained GPBFieldDescriptor *field in descriptor->fields_) { BOOL isMapOrArray = GPBFieldIsMapOrArray(field); if (!isMapOrArray) { // Single fields. @@ -3254,4 +3286,32 @@ id GPBGetMessageMapField(GPBMessage *self, GPBFieldDescriptor *field) { return GetOrCreateMapIvarWithField(self, field, syntax); } +id GPBGetObjectIvarWithField(GPBMessage *self, GPBFieldDescriptor *field) { + NSCAssert(!GPBFieldIsMapOrArray(field), @"Shouldn't get here"); + if (GPBGetHasIvarField(self, field)) { + uint8_t *storage = (uint8_t *)self->messageStorage_; + id *typePtr = (id *)&storage[field->description_->offset]; + return *typePtr; + } + // Not set... + + // Non messages (string/data), get their default. + if (!GPBFieldDataTypeIsMessage(field)) { + return field.defaultValue.valueMessage; + } + + GPBPrepareReadOnlySemaphore(self); + dispatch_semaphore_wait(self->readOnlySemaphore_, DISPATCH_TIME_FOREVER); + GPBMessage *result = GPBGetObjectIvarWithFieldNoAutocreate(self, field); + if (!result) { + // For non repeated messages, create the object, set it and return it. + // This object will not initially be visible via GPBGetHasIvar, so + // we save its creator so it can become visible if it's mutated later. + result = GPBCreateMessageWithAutocreator(field.msgClass, self, field); + GPBSetAutocreatedRetainedObjectIvarWithField(self, field, result); + } + dispatch_semaphore_signal(self->readOnlySemaphore_); + return result; +} + #pragma clang diagnostic pop diff --git a/objectivec/GPBMessage_PackagePrivate.h b/objectivec/GPBMessage_PackagePrivate.h index 90834d40..ca10983b 100644 --- a/objectivec/GPBMessage_PackagePrivate.h +++ b/objectivec/GPBMessage_PackagePrivate.h @@ -34,6 +34,10 @@ #import "GPBMessage.h" +// TODO: Remove this import. Older generated code use the OSAtomic* apis, +// so anyone that hasn't regenerated says building by having this. After +// enough time has passed, this likely can be removed as folks should have +// regenerated. #import <libkern/OSAtomic.h> #import "GPBBootstrap.h" @@ -57,20 +61,6 @@ typedef struct GPBMessage_Storage *GPBMessage_StoragePtr; // GPBMessage_Storage with _has_storage__ as the first field. // Kept public because static functions need to access it. GPBMessage_StoragePtr messageStorage_; - - // A lock to provide mutual exclusion from internal data that can be modified - // by *read* operations such as getters (autocreation of message fields and - // message extensions, not setting of values). Used to guarantee thread safety - // for concurrent reads on the message. - // NOTE: OSSpinLock may seem like a good fit here but Apple engineers have - // pointed out that they are vulnerable to live locking on iOS in cases of - // priority inversion: - // http://mjtsai.com/blog/2015/12/16/osspinlock-is-unsafe/ - // https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20151214/000372.html - // Use of readOnlySemaphore_ must be prefaced by a call to - // GPBPrepareReadOnlySemaphore to ensure it has been created. This allows - // readOnlySemaphore_ to be only created when actually needed. - dispatch_semaphore_t readOnlySemaphore_; } // Gets an extension value without autocreating the result if not found. (i.e. diff --git a/objectivec/GPBProtocolBuffers_RuntimeSupport.h b/objectivec/GPBProtocolBuffers_RuntimeSupport.h index fea75b93..04dde620 100644 --- a/objectivec/GPBProtocolBuffers_RuntimeSupport.h +++ b/objectivec/GPBProtocolBuffers_RuntimeSupport.h @@ -31,7 +31,7 @@ // This header is meant to only be used by the generated source, it should not // be included in code using protocol buffers. -#import "GPBProtocolBuffers.h" +#import "GPBBootstrap.h" #import "GPBDescriptor_PackagePrivate.h" #import "GPBExtensionInternals.h" diff --git a/objectivec/GPBRootObject.m b/objectivec/GPBRootObject.m index 585d205a..bad2f9a7 100644 --- a/objectivec/GPBRootObject.m +++ b/objectivec/GPBRootObject.m @@ -43,6 +43,14 @@ - (const char *)singletonNameC; @end +// We need some object to conform to the MessageSignatureProtocol to make sure +// the selectors in it are recorded in our Objective C runtime information. +// GPBMessage is arguably the more "obvious" choice, but given that all messages +// inherit from GPBMessage, conflicts seem likely, so we are using GPBRootObject +// instead. +@interface GPBRootObject () <GPBMessageSignatureProtocol> +@end + @implementation GPBRootObject // Taken from http://www.burtleburtle.net/bob/hash/doobs.html diff --git a/objectivec/GPBUtilities.m b/objectivec/GPBUtilities.m index 5029ec73..e2a12ca4 100644 --- a/objectivec/GPBUtilities.m +++ b/objectivec/GPBUtilities.m @@ -49,6 +49,19 @@ static void AppendTextFormatForMessage(GPBMessage *message, NSMutableString *toStr, NSString *lineIndent); +// Are two datatypes the same basic type representation (ex Int32 and SInt32). +// Marked unused because currently only called from asserts/debug. +static BOOL DataTypesEquivalent(GPBDataType type1, + GPBDataType type2) __attribute__ ((unused)); + +// Basic type representation for a type (ex: for SInt32 it is Int32). +// Marked unused because currently only called from asserts/debug. +static GPBDataType BaseDataType(GPBDataType type) __attribute__ ((unused)); + +// String name for a data type. +// Marked unused because currently only called from asserts/debug. +static NSString *TypeToString(GPBDataType dataType) __attribute__ ((unused)); + NSData *GPBEmptyNSData(void) { static dispatch_once_t onceToken; static NSData *defaultNSData = nil; @@ -278,7 +291,7 @@ BOOL GPBGetHasIvar(GPBMessage *self, int32_t idx, uint32_t fieldNumber) { } else { NSCAssert(idx != GPBNoHasBit, @"Invalid has bit."); uint32_t byteIndex = idx / 32; - uint32_t bitMask = (1 << (idx % 32)); + uint32_t bitMask = (1U << (idx % 32)); BOOL hasIvar = (self->messageStorage_->_has_storage_[byteIndex] & bitMask) ? YES : NO; return hasIvar; @@ -302,7 +315,7 @@ void GPBSetHasIvar(GPBMessage *self, int32_t idx, uint32_t fieldNumber, NSCAssert(idx != GPBNoHasBit, @"Invalid has bit."); uint32_t *has_storage = self->messageStorage_->_has_storage_; uint32_t byte = idx / 32; - uint32_t bitMask = (1 << (idx % 32)); + uint32_t bitMask = (1U << (idx % 32)); if (value) { has_storage[byte] |= bitMask; } else { @@ -342,6 +355,14 @@ void GPBMaybeClearOneof(GPBMessage *self, GPBOneofDescriptor *oneof, //%PDDM-DEFINE IVAR_POD_ACCESSORS_DEFN(NAME, TYPE) //%TYPE GPBGetMessage##NAME##Field(GPBMessage *self, //% TYPE$S NAME$S GPBFieldDescriptor *field) { +//%#if defined(DEBUG) && DEBUG +//% NSCAssert(DataTypesEquivalent(GPBGetFieldDataType(field), +//% GPBDataType##NAME), +//% @"Attempting to get value of TYPE from field %@ " +//% @"of %@ which is of type %@.", +//% [self class], field.name, +//% TypeToString(GPBGetFieldDataType(field))); +//%#endif //% if (GPBGetHasIvarField(self, field)) { //% uint8_t *storage = (uint8_t *)self->messageStorage_; //% TYPE *typePtr = (TYPE *)&storage[field->description_->offset]; @@ -364,14 +385,24 @@ void GPBMaybeClearOneof(GPBMessage *self, GPBOneofDescriptor *oneof, //% NAME$S GPBFieldDescriptor *field, //% NAME$S TYPE value, //% NAME$S GPBFileSyntax syntax) { +//%#if defined(DEBUG) && DEBUG +//% NSCAssert(DataTypesEquivalent(GPBGetFieldDataType(field), +//% GPBDataType##NAME), +//% @"Attempting to set field %@ of %@ which is of type %@ with " +//% @"value of type TYPE.", +//% [self class], field.name, +//% TypeToString(GPBGetFieldDataType(field))); +//%#endif //% GPBOneofDescriptor *oneof = field->containingOneof_; //% if (oneof) { //% GPBMessageFieldDescription *fieldDesc = field->description_; //% GPBMaybeClearOneof(self, oneof, fieldDesc->hasIndex, fieldDesc->number); //% } +//%#if defined(DEBUG) && DEBUG //% NSCAssert(self->messageStorage_ != NULL, //% @"%@: All messages should have storage (from init)", //% [self class]); +//%#endif //%#if defined(__clang_analyzer__) //% if (self->messageStorage_ == NULL) return; //%#endif @@ -391,6 +422,14 @@ void GPBMaybeClearOneof(GPBMessage *self, GPBOneofDescriptor *oneof, //%// Only exists for public api, no core code should use this. //%TYPE *GPBGetMessage##NAME##Field(GPBMessage *self, //% TYPE$S NAME$S GPBFieldDescriptor *field) { +//%#if defined(DEBUG) && DEBUG +//% NSCAssert(DataTypesEquivalent(GPBGetFieldDataType(field), +//% GPBDataType##NAME), +//% @"Attempting to get value of TYPE from field %@ " +//% @"of %@ which is of type %@.", +//% [self class], field.name, +//% TypeToString(GPBGetFieldDataType(field))); +//%#endif //% return (TYPE *)GPBGetObjectIvarWithField(self, field); //%} //% @@ -398,6 +437,14 @@ void GPBMaybeClearOneof(GPBMessage *self, GPBOneofDescriptor *oneof, //%void GPBSetMessage##NAME##Field(GPBMessage *self, //% NAME$S GPBFieldDescriptor *field, //% NAME$S TYPE *value) { +//%#if defined(DEBUG) && DEBUG +//% NSCAssert(DataTypesEquivalent(GPBGetFieldDataType(field), +//% GPBDataType##NAME), +//% @"Attempting to set field %@ of %@ which is of type %@ with " +//% @"value of type TYPE.", +//% [self class], field.name, +//% TypeToString(GPBGetFieldDataType(field))); +//%#endif //% GPBSetObjectIvarWithField(self, field, (id)value); //%} //% @@ -455,7 +502,7 @@ void GPBSetRetainedObjectIvarWithFieldInternal(GPBMessage *self, GPBDataType fieldType = GPBGetFieldDataType(field); BOOL isMapOrArray = GPBFieldIsMapOrArray(field); BOOL fieldIsMessage = GPBDataTypeIsMessage(fieldType); -#ifdef DEBUG +#if defined(DEBUG) && DEBUG if (value == nil && !isMapOrArray && !fieldIsMessage && field.hasDefaultValue) { // Setting a message to nil is an obvious way to "clear" the value @@ -581,34 +628,6 @@ id GPBGetObjectIvarWithFieldNoAutocreate(GPBMessage *self, return *typePtr; } -id GPBGetObjectIvarWithField(GPBMessage *self, GPBFieldDescriptor *field) { - NSCAssert(!GPBFieldIsMapOrArray(field), @"Shouldn't get here"); - if (GPBGetHasIvarField(self, field)) { - uint8_t *storage = (uint8_t *)self->messageStorage_; - id *typePtr = (id *)&storage[field->description_->offset]; - return *typePtr; - } - // Not set... - - // Non messages (string/data), get their default. - if (!GPBFieldDataTypeIsMessage(field)) { - return field.defaultValue.valueMessage; - } - - GPBPrepareReadOnlySemaphore(self); - dispatch_semaphore_wait(self->readOnlySemaphore_, DISPATCH_TIME_FOREVER); - GPBMessage *result = GPBGetObjectIvarWithFieldNoAutocreate(self, field); - if (!result) { - // For non repeated messages, create the object, set it and return it. - // This object will not initially be visible via GPBGetHasIvar, so - // we save its creator so it can become visible if it's mutated later. - result = GPBCreateMessageWithAutocreator(field.msgClass, self, field); - GPBSetAutocreatedRetainedObjectIvarWithField(self, field, result); - } - dispatch_semaphore_signal(self->readOnlySemaphore_); - return result; -} - // Only exists for public api, no core code should use this. int32_t GPBGetMessageEnumField(GPBMessage *self, GPBFieldDescriptor *field) { GPBFileSyntax syntax = [self descriptor].file.syntax; @@ -618,6 +637,13 @@ int32_t GPBGetMessageEnumField(GPBMessage *self, GPBFieldDescriptor *field) { int32_t GPBGetEnumIvarWithFieldInternal(GPBMessage *self, GPBFieldDescriptor *field, GPBFileSyntax syntax) { +#if defined(DEBUG) && DEBUG + NSCAssert(GPBGetFieldDataType(field) == GPBDataTypeEnum, + @"Attempting to get value of type Enum from field %@ " + @"of %@ which is of type %@.", + [self class], field.name, + TypeToString(GPBGetFieldDataType(field))); +#endif int32_t result = GPBGetMessageInt32Field(self, field); // If this is presevering unknown enums, make sure the value is valid before // returning it. @@ -638,6 +664,13 @@ void GPBSetMessageEnumField(GPBMessage *self, GPBFieldDescriptor *field, void GPBSetEnumIvarWithFieldInternal(GPBMessage *self, GPBFieldDescriptor *field, int32_t value, GPBFileSyntax syntax) { +#if defined(DEBUG) && DEBUG + NSCAssert(GPBGetFieldDataType(field) == GPBDataTypeEnum, + @"Attempting to set field %@ of %@ which is of type %@ with " + @"value of type Enum.", + [self class], field.name, + TypeToString(GPBGetFieldDataType(field))); +#endif // Don't allow in unknown values. Proto3 can use the Raw method. if (![field isValidEnumValue:value]) { [NSException raise:NSInvalidArgumentException @@ -663,6 +696,13 @@ void GPBSetMessageRawEnumField(GPBMessage *self, GPBFieldDescriptor *field, BOOL GPBGetMessageBoolField(GPBMessage *self, GPBFieldDescriptor *field) { +#if defined(DEBUG) && DEBUG + NSCAssert(DataTypesEquivalent(GPBGetFieldDataType(field), GPBDataTypeBool), + @"Attempting to get value of type bool from field %@ " + @"of %@ which is of type %@.", + [self class], field.name, + TypeToString(GPBGetFieldDataType(field))); +#endif if (GPBGetHasIvarField(self, field)) { // Bools are stored in the has bits to avoid needing explicit space in the // storage structure. @@ -688,6 +728,13 @@ void GPBSetBoolIvarWithFieldInternal(GPBMessage *self, GPBFieldDescriptor *field, BOOL value, GPBFileSyntax syntax) { +#if defined(DEBUG) && DEBUG + NSCAssert(DataTypesEquivalent(GPBGetFieldDataType(field), GPBDataTypeBool), + @"Attempting to set field %@ of %@ which is of type %@ with " + @"value of type bool.", + [self class], field.name, + TypeToString(GPBGetFieldDataType(field))); +#endif GPBMessageFieldDescription *fieldDesc = field->description_; GPBOneofDescriptor *oneof = field->containingOneof_; if (oneof) { @@ -714,6 +761,14 @@ void GPBSetBoolIvarWithFieldInternal(GPBMessage *self, int32_t GPBGetMessageInt32Field(GPBMessage *self, GPBFieldDescriptor *field) { +#if defined(DEBUG) && DEBUG + NSCAssert(DataTypesEquivalent(GPBGetFieldDataType(field), + GPBDataTypeInt32), + @"Attempting to get value of int32_t from field %@ " + @"of %@ which is of type %@.", + [self class], field.name, + TypeToString(GPBGetFieldDataType(field))); +#endif if (GPBGetHasIvarField(self, field)) { uint8_t *storage = (uint8_t *)self->messageStorage_; int32_t *typePtr = (int32_t *)&storage[field->description_->offset]; @@ -736,14 +791,24 @@ void GPBSetInt32IvarWithFieldInternal(GPBMessage *self, GPBFieldDescriptor *field, int32_t value, GPBFileSyntax syntax) { +#if defined(DEBUG) && DEBUG + NSCAssert(DataTypesEquivalent(GPBGetFieldDataType(field), + GPBDataTypeInt32), + @"Attempting to set field %@ of %@ which is of type %@ with " + @"value of type int32_t.", + [self class], field.name, + TypeToString(GPBGetFieldDataType(field))); +#endif GPBOneofDescriptor *oneof = field->containingOneof_; if (oneof) { GPBMessageFieldDescription *fieldDesc = field->description_; GPBMaybeClearOneof(self, oneof, fieldDesc->hasIndex, fieldDesc->number); } +#if defined(DEBUG) && DEBUG NSCAssert(self->messageStorage_ != NULL, @"%@: All messages should have storage (from init)", [self class]); +#endif #if defined(__clang_analyzer__) if (self->messageStorage_ == NULL) return; #endif @@ -764,6 +829,14 @@ void GPBSetInt32IvarWithFieldInternal(GPBMessage *self, uint32_t GPBGetMessageUInt32Field(GPBMessage *self, GPBFieldDescriptor *field) { +#if defined(DEBUG) && DEBUG + NSCAssert(DataTypesEquivalent(GPBGetFieldDataType(field), + GPBDataTypeUInt32), + @"Attempting to get value of uint32_t from field %@ " + @"of %@ which is of type %@.", + [self class], field.name, + TypeToString(GPBGetFieldDataType(field))); +#endif if (GPBGetHasIvarField(self, field)) { uint8_t *storage = (uint8_t *)self->messageStorage_; uint32_t *typePtr = (uint32_t *)&storage[field->description_->offset]; @@ -786,14 +859,24 @@ void GPBSetUInt32IvarWithFieldInternal(GPBMessage *self, GPBFieldDescriptor *field, uint32_t value, GPBFileSyntax syntax) { +#if defined(DEBUG) && DEBUG + NSCAssert(DataTypesEquivalent(GPBGetFieldDataType(field), + GPBDataTypeUInt32), + @"Attempting to set field %@ of %@ which is of type %@ with " + @"value of type uint32_t.", + [self class], field.name, + TypeToString(GPBGetFieldDataType(field))); +#endif GPBOneofDescriptor *oneof = field->containingOneof_; if (oneof) { GPBMessageFieldDescription *fieldDesc = field->description_; GPBMaybeClearOneof(self, oneof, fieldDesc->hasIndex, fieldDesc->number); } +#if defined(DEBUG) && DEBUG NSCAssert(self->messageStorage_ != NULL, @"%@: All messages should have storage (from init)", [self class]); +#endif #if defined(__clang_analyzer__) if (self->messageStorage_ == NULL) return; #endif @@ -814,6 +897,14 @@ void GPBSetUInt32IvarWithFieldInternal(GPBMessage *self, int64_t GPBGetMessageInt64Field(GPBMessage *self, GPBFieldDescriptor *field) { +#if defined(DEBUG) && DEBUG + NSCAssert(DataTypesEquivalent(GPBGetFieldDataType(field), + GPBDataTypeInt64), + @"Attempting to get value of int64_t from field %@ " + @"of %@ which is of type %@.", + [self class], field.name, + TypeToString(GPBGetFieldDataType(field))); +#endif if (GPBGetHasIvarField(self, field)) { uint8_t *storage = (uint8_t *)self->messageStorage_; int64_t *typePtr = (int64_t *)&storage[field->description_->offset]; @@ -836,14 +927,24 @@ void GPBSetInt64IvarWithFieldInternal(GPBMessage *self, GPBFieldDescriptor *field, int64_t value, GPBFileSyntax syntax) { +#if defined(DEBUG) && DEBUG + NSCAssert(DataTypesEquivalent(GPBGetFieldDataType(field), + GPBDataTypeInt64), + @"Attempting to set field %@ of %@ which is of type %@ with " + @"value of type int64_t.", + [self class], field.name, + TypeToString(GPBGetFieldDataType(field))); +#endif GPBOneofDescriptor *oneof = field->containingOneof_; if (oneof) { GPBMessageFieldDescription *fieldDesc = field->description_; GPBMaybeClearOneof(self, oneof, fieldDesc->hasIndex, fieldDesc->number); } +#if defined(DEBUG) && DEBUG NSCAssert(self->messageStorage_ != NULL, @"%@: All messages should have storage (from init)", [self class]); +#endif #if defined(__clang_analyzer__) if (self->messageStorage_ == NULL) return; #endif @@ -864,6 +965,14 @@ void GPBSetInt64IvarWithFieldInternal(GPBMessage *self, uint64_t GPBGetMessageUInt64Field(GPBMessage *self, GPBFieldDescriptor *field) { +#if defined(DEBUG) && DEBUG + NSCAssert(DataTypesEquivalent(GPBGetFieldDataType(field), + GPBDataTypeUInt64), + @"Attempting to get value of uint64_t from field %@ " + @"of %@ which is of type %@.", + [self class], field.name, + TypeToString(GPBGetFieldDataType(field))); +#endif if (GPBGetHasIvarField(self, field)) { uint8_t *storage = (uint8_t *)self->messageStorage_; uint64_t *typePtr = (uint64_t *)&storage[field->description_->offset]; @@ -886,14 +995,24 @@ void GPBSetUInt64IvarWithFieldInternal(GPBMessage *self, GPBFieldDescriptor *field, uint64_t value, GPBFileSyntax syntax) { +#if defined(DEBUG) && DEBUG + NSCAssert(DataTypesEquivalent(GPBGetFieldDataType(field), + GPBDataTypeUInt64), + @"Attempting to set field %@ of %@ which is of type %@ with " + @"value of type uint64_t.", + [self class], field.name, + TypeToString(GPBGetFieldDataType(field))); +#endif GPBOneofDescriptor *oneof = field->containingOneof_; if (oneof) { GPBMessageFieldDescription *fieldDesc = field->description_; GPBMaybeClearOneof(self, oneof, fieldDesc->hasIndex, fieldDesc->number); } +#if defined(DEBUG) && DEBUG NSCAssert(self->messageStorage_ != NULL, @"%@: All messages should have storage (from init)", [self class]); +#endif #if defined(__clang_analyzer__) if (self->messageStorage_ == NULL) return; #endif @@ -914,6 +1033,14 @@ void GPBSetUInt64IvarWithFieldInternal(GPBMessage *self, float GPBGetMessageFloatField(GPBMessage *self, GPBFieldDescriptor *field) { +#if defined(DEBUG) && DEBUG + NSCAssert(DataTypesEquivalent(GPBGetFieldDataType(field), + GPBDataTypeFloat), + @"Attempting to get value of float from field %@ " + @"of %@ which is of type %@.", + [self class], field.name, + TypeToString(GPBGetFieldDataType(field))); +#endif if (GPBGetHasIvarField(self, field)) { uint8_t *storage = (uint8_t *)self->messageStorage_; float *typePtr = (float *)&storage[field->description_->offset]; @@ -936,14 +1063,24 @@ void GPBSetFloatIvarWithFieldInternal(GPBMessage *self, GPBFieldDescriptor *field, float value, GPBFileSyntax syntax) { +#if defined(DEBUG) && DEBUG + NSCAssert(DataTypesEquivalent(GPBGetFieldDataType(field), + GPBDataTypeFloat), + @"Attempting to set field %@ of %@ which is of type %@ with " + @"value of type float.", + [self class], field.name, + TypeToString(GPBGetFieldDataType(field))); +#endif GPBOneofDescriptor *oneof = field->containingOneof_; if (oneof) { GPBMessageFieldDescription *fieldDesc = field->description_; GPBMaybeClearOneof(self, oneof, fieldDesc->hasIndex, fieldDesc->number); } +#if defined(DEBUG) && DEBUG NSCAssert(self->messageStorage_ != NULL, @"%@: All messages should have storage (from init)", [self class]); +#endif #if defined(__clang_analyzer__) if (self->messageStorage_ == NULL) return; #endif @@ -964,6 +1101,14 @@ void GPBSetFloatIvarWithFieldInternal(GPBMessage *self, double GPBGetMessageDoubleField(GPBMessage *self, GPBFieldDescriptor *field) { +#if defined(DEBUG) && DEBUG + NSCAssert(DataTypesEquivalent(GPBGetFieldDataType(field), + GPBDataTypeDouble), + @"Attempting to get value of double from field %@ " + @"of %@ which is of type %@.", + [self class], field.name, + TypeToString(GPBGetFieldDataType(field))); +#endif if (GPBGetHasIvarField(self, field)) { uint8_t *storage = (uint8_t *)self->messageStorage_; double *typePtr = (double *)&storage[field->description_->offset]; @@ -986,14 +1131,24 @@ void GPBSetDoubleIvarWithFieldInternal(GPBMessage *self, GPBFieldDescriptor *field, double value, GPBFileSyntax syntax) { +#if defined(DEBUG) && DEBUG + NSCAssert(DataTypesEquivalent(GPBGetFieldDataType(field), + GPBDataTypeDouble), + @"Attempting to set field %@ of %@ which is of type %@ with " + @"value of type double.", + [self class], field.name, + TypeToString(GPBGetFieldDataType(field))); +#endif GPBOneofDescriptor *oneof = field->containingOneof_; if (oneof) { GPBMessageFieldDescription *fieldDesc = field->description_; GPBMaybeClearOneof(self, oneof, fieldDesc->hasIndex, fieldDesc->number); } +#if defined(DEBUG) && DEBUG NSCAssert(self->messageStorage_ != NULL, @"%@: All messages should have storage (from init)", [self class]); +#endif #if defined(__clang_analyzer__) if (self->messageStorage_ == NULL) return; #endif @@ -1019,6 +1174,14 @@ void GPBSetDoubleIvarWithFieldInternal(GPBMessage *self, // Only exists for public api, no core code should use this. NSString *GPBGetMessageStringField(GPBMessage *self, GPBFieldDescriptor *field) { +#if defined(DEBUG) && DEBUG + NSCAssert(DataTypesEquivalent(GPBGetFieldDataType(field), + GPBDataTypeString), + @"Attempting to get value of NSString from field %@ " + @"of %@ which is of type %@.", + [self class], field.name, + TypeToString(GPBGetFieldDataType(field))); +#endif return (NSString *)GPBGetObjectIvarWithField(self, field); } @@ -1026,6 +1189,14 @@ NSString *GPBGetMessageStringField(GPBMessage *self, void GPBSetMessageStringField(GPBMessage *self, GPBFieldDescriptor *field, NSString *value) { +#if defined(DEBUG) && DEBUG + NSCAssert(DataTypesEquivalent(GPBGetFieldDataType(field), + GPBDataTypeString), + @"Attempting to set field %@ of %@ which is of type %@ with " + @"value of type NSString.", + [self class], field.name, + TypeToString(GPBGetFieldDataType(field))); +#endif GPBSetObjectIvarWithField(self, field, (id)value); } @@ -1035,6 +1206,14 @@ void GPBSetMessageStringField(GPBMessage *self, // Only exists for public api, no core code should use this. NSData *GPBGetMessageBytesField(GPBMessage *self, GPBFieldDescriptor *field) { +#if defined(DEBUG) && DEBUG + NSCAssert(DataTypesEquivalent(GPBGetFieldDataType(field), + GPBDataTypeBytes), + @"Attempting to get value of NSData from field %@ " + @"of %@ which is of type %@.", + [self class], field.name, + TypeToString(GPBGetFieldDataType(field))); +#endif return (NSData *)GPBGetObjectIvarWithField(self, field); } @@ -1042,6 +1221,14 @@ NSData *GPBGetMessageBytesField(GPBMessage *self, void GPBSetMessageBytesField(GPBMessage *self, GPBFieldDescriptor *field, NSData *value) { +#if defined(DEBUG) && DEBUG + NSCAssert(DataTypesEquivalent(GPBGetFieldDataType(field), + GPBDataTypeBytes), + @"Attempting to set field %@ of %@ which is of type %@ with " + @"value of type NSData.", + [self class], field.name, + TypeToString(GPBGetFieldDataType(field))); +#endif GPBSetObjectIvarWithField(self, field, (id)value); } @@ -1051,6 +1238,14 @@ void GPBSetMessageBytesField(GPBMessage *self, // Only exists for public api, no core code should use this. GPBMessage *GPBGetMessageMessageField(GPBMessage *self, GPBFieldDescriptor *field) { +#if defined(DEBUG) && DEBUG + NSCAssert(DataTypesEquivalent(GPBGetFieldDataType(field), + GPBDataTypeMessage), + @"Attempting to get value of GPBMessage from field %@ " + @"of %@ which is of type %@.", + [self class], field.name, + TypeToString(GPBGetFieldDataType(field))); +#endif return (GPBMessage *)GPBGetObjectIvarWithField(self, field); } @@ -1058,6 +1253,14 @@ GPBMessage *GPBGetMessageMessageField(GPBMessage *self, void GPBSetMessageMessageField(GPBMessage *self, GPBFieldDescriptor *field, GPBMessage *value) { +#if defined(DEBUG) && DEBUG + NSCAssert(DataTypesEquivalent(GPBGetFieldDataType(field), + GPBDataTypeMessage), + @"Attempting to set field %@ of %@ which is of type %@ with " + @"value of type GPBMessage.", + [self class], field.name, + TypeToString(GPBGetFieldDataType(field))); +#endif GPBSetObjectIvarWithField(self, field, (id)value); } @@ -1067,6 +1270,14 @@ void GPBSetMessageMessageField(GPBMessage *self, // Only exists for public api, no core code should use this. GPBMessage *GPBGetMessageGroupField(GPBMessage *self, GPBFieldDescriptor *field) { +#if defined(DEBUG) && DEBUG + NSCAssert(DataTypesEquivalent(GPBGetFieldDataType(field), + GPBDataTypeGroup), + @"Attempting to get value of GPBMessage from field %@ " + @"of %@ which is of type %@.", + [self class], field.name, + TypeToString(GPBGetFieldDataType(field))); +#endif return (GPBMessage *)GPBGetObjectIvarWithField(self, field); } @@ -1074,6 +1285,14 @@ GPBMessage *GPBGetMessageGroupField(GPBMessage *self, void GPBSetMessageGroupField(GPBMessage *self, GPBFieldDescriptor *field, GPBMessage *value) { +#if defined(DEBUG) && DEBUG + NSCAssert(DataTypesEquivalent(GPBGetFieldDataType(field), + GPBDataTypeGroup), + @"Attempting to set field %@ of %@ which is of type %@ with " + @"value of type GPBMessage.", + [self class], field.name, + TypeToString(GPBGetFieldDataType(field))); +#endif GPBSetObjectIvarWithField(self, field, (id)value); } @@ -1137,8 +1356,40 @@ void GPBSetMessageRepeatedField(GPBMessage *self, GPBFieldDescriptor *field, id GPBSetObjectIvarWithField(self, field, array); } -#if defined(DEBUG) && DEBUG -static NSString *TypeToStr(GPBDataType dataType) { +static GPBDataType BaseDataType(GPBDataType type) { + switch (type) { + case GPBDataTypeSFixed32: + case GPBDataTypeInt32: + case GPBDataTypeSInt32: + case GPBDataTypeEnum: + return GPBDataTypeInt32; + case GPBDataTypeFixed32: + case GPBDataTypeUInt32: + return GPBDataTypeUInt32; + case GPBDataTypeSFixed64: + case GPBDataTypeInt64: + case GPBDataTypeSInt64: + return GPBDataTypeInt64; + case GPBDataTypeFixed64: + case GPBDataTypeUInt64: + return GPBDataTypeUInt64; + case GPBDataTypeMessage: + case GPBDataTypeGroup: + return GPBDataTypeMessage; + case GPBDataTypeBool: + case GPBDataTypeFloat: + case GPBDataTypeDouble: + case GPBDataTypeBytes: + case GPBDataTypeString: + return type; + } +} + +static BOOL DataTypesEquivalent(GPBDataType type1, GPBDataType type2) { + return BaseDataType(type1) == BaseDataType(type2); +} + +static NSString *TypeToString(GPBDataType dataType) { switch (dataType) { case GPBDataTypeBool: return @"Bool"; @@ -1166,10 +1417,9 @@ static NSString *TypeToStr(GPBDataType dataType) { case GPBDataTypeGroup: return @"Object"; case GPBDataTypeEnum: - return @"Bool"; + return @"Enum"; } } -#endif // GPBGetMessageMapField is defined in GPBMessage.m @@ -1185,8 +1435,8 @@ void GPBSetMessageMapField(GPBMessage *self, GPBFieldDescriptor *field, if (dictionary) { GPBDataType keyDataType = field.mapKeyDataType; GPBDataType valueDataType = GPBGetFieldDataType(field); - NSString *keyStr = TypeToStr(keyDataType); - NSString *valueStr = TypeToStr(valueDataType); + NSString *keyStr = TypeToString(keyDataType); + NSString *valueStr = TypeToString(valueDataType); if (keyDataType == GPBDataTypeString) { keyStr = @"String"; } @@ -1216,8 +1466,11 @@ void GPBSetMessageMapField(GPBMessage *self, GPBFieldDescriptor *field, const char *GPBMessageEncodingForSelector(SEL selector, BOOL instanceSel) { Protocol *protocol = objc_getProtocol(GPBStringifySymbol(GPBMessageSignatureProtocol)); + NSCAssert(protocol, @"Missing GPBMessageSignatureProtocol"); struct objc_method_description description = protocol_getMethodDescription(protocol, selector, NO, instanceSel); + NSCAssert(description.name != Nil && description.types != nil, + @"Missing method for selector %@", NSStringFromSelector(selector)); return description.types; } @@ -1911,13 +2164,3 @@ BOOL GPBClassHasSel(Class aClass, SEL sel) { free(methodList); return result; } - -#pragma mark - GPBMessageSignatureProtocol - -// A series of selectors that are used solely to get @encoding values -// for them by the dynamic protobuf runtime code. An object using the protocol -// needs to be declared for the protocol to be valid at runtime. -@interface GPBMessageSignatureProtocol : NSObject<GPBMessageSignatureProtocol> -@end -@implementation GPBMessageSignatureProtocol -@end diff --git a/objectivec/GPBUtilities_PackagePrivate.h b/objectivec/GPBUtilities_PackagePrivate.h index 16859d48..ed424ce3 100644 --- a/objectivec/GPBUtilities_PackagePrivate.h +++ b/objectivec/GPBUtilities_PackagePrivate.h @@ -124,7 +124,7 @@ GPB_INLINE int64_t GPBDecodeZigZag64(uint64_t n) { // thus always taking 10 bytes on the wire.) GPB_INLINE uint32_t GPBEncodeZigZag32(int32_t n) { // Note: the right-shift must be arithmetic - return (uint32_t)((n << 1) ^ (n >> 31)); + return ((uint32_t)n << 1) ^ (uint32_t)(n >> 31); } // Encode a ZigZag-encoded 64-bit value. ZigZag encodes signed integers @@ -133,7 +133,7 @@ GPB_INLINE uint32_t GPBEncodeZigZag32(int32_t n) { // thus always taking 10 bytes on the wire.) GPB_INLINE uint64_t GPBEncodeZigZag64(int64_t n) { // Note: the right-shift must be arithmetic - return (uint64_t)((n << 1) ^ (n >> 63)); + return ((uint64_t)n << 1) ^ (uint64_t)(n >> 63); } #pragma clang diagnostic push @@ -309,7 +309,8 @@ NSString *GPBDecodeTextFormatName(const uint8_t *decodeData, int32_t key, // A series of selectors that are used solely to get @encoding values // for them by the dynamic protobuf runtime code. See -// GPBMessageEncodingForSelector for details. +// GPBMessageEncodingForSelector for details. GPBRootObject conforms to +// the protocol so that it is encoded in the Objective C runtime. @protocol GPBMessageSignatureProtocol @optional diff --git a/objectivec/ProtocolBuffers_OSX.xcodeproj/project.pbxproj b/objectivec/ProtocolBuffers_OSX.xcodeproj/project.pbxproj index 266b05a1..a41be9f2 100644 --- a/objectivec/ProtocolBuffers_OSX.xcodeproj/project.pbxproj +++ b/objectivec/ProtocolBuffers_OSX.xcodeproj/project.pbxproj @@ -37,6 +37,31 @@ 8BF8193514A0DDA600A2C982 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; F401DC2D1A8D444600FCC765 /* GPBArray.m in Sources */ = {isa = PBXBuildFile; fileRef = F401DC2B1A8D444600FCC765 /* GPBArray.m */; }; F401DC331A8E5C0200FCC765 /* GPBArrayTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F401DC321A8E5C0200FCC765 /* GPBArrayTests.m */; }; + F40EE4AB206BF8B90071091A /* GPBCompileTest01.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE488206BF8B00071091A /* GPBCompileTest01.m */; }; + F40EE4AC206BF8B90071091A /* GPBCompileTest02.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE481206BF8AE0071091A /* GPBCompileTest02.m */; }; + F40EE4AD206BF8B90071091A /* GPBCompileTest03.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE491206BF8B10071091A /* GPBCompileTest03.m */; }; + F40EE4AE206BF8B90071091A /* GPBCompileTest04.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE47E206BF8AE0071091A /* GPBCompileTest04.m */; }; + F40EE4AF206BF8B90071091A /* GPBCompileTest05.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE47F206BF8AE0071091A /* GPBCompileTest05.m */; }; + F40EE4B0206BF8B90071091A /* GPBCompileTest06.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE492206BF8B10071091A /* GPBCompileTest06.m */; }; + F40EE4B1206BF8B90071091A /* GPBCompileTest07.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE480206BF8AE0071091A /* GPBCompileTest07.m */; }; + F40EE4B2206BF8B90071091A /* GPBCompileTest08.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE47D206BF8AD0071091A /* GPBCompileTest08.m */; }; + F40EE4B3206BF8B90071091A /* GPBCompileTest09.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE484206BF8AF0071091A /* GPBCompileTest09.m */; }; + F40EE4B4206BF8B90071091A /* GPBCompileTest10.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE48C206BF8B00071091A /* GPBCompileTest10.m */; }; + F40EE4B5206BF8B90071091A /* GPBCompileTest11.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE493206BF8B20071091A /* GPBCompileTest11.m */; }; + F40EE4B6206BF8B90071091A /* GPBCompileTest12.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE490206BF8B10071091A /* GPBCompileTest12.m */; }; + F40EE4B7206BF8B90071091A /* GPBCompileTest13.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE483206BF8AF0071091A /* GPBCompileTest13.m */; }; + F40EE4B8206BF8B90071091A /* GPBCompileTest14.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE48F206BF8B10071091A /* GPBCompileTest14.m */; }; + F40EE4B9206BF8B90071091A /* GPBCompileTest15.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE489206BF8B00071091A /* GPBCompileTest15.m */; }; + F40EE4BA206BF8B90071091A /* GPBCompileTest16.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE48B206BF8B00071091A /* GPBCompileTest16.m */; }; + F40EE4BB206BF8B90071091A /* GPBCompileTest17.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE48D206BF8B00071091A /* GPBCompileTest17.m */; }; + F40EE4BC206BF8B90071091A /* GPBCompileTest18.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE48E206BF8B10071091A /* GPBCompileTest18.m */; }; + F40EE4BD206BF8B90071091A /* GPBCompileTest19.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE482206BF8AF0071091A /* GPBCompileTest19.m */; }; + F40EE4BE206BF8B90071091A /* GPBCompileTest20.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE485206BF8AF0071091A /* GPBCompileTest20.m */; }; + F40EE4BF206BF8B90071091A /* GPBCompileTest21.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE486206BF8AF0071091A /* GPBCompileTest21.m */; }; + F40EE4C0206BF8B90071091A /* GPBCompileTest22.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE48A206BF8B00071091A /* GPBCompileTest22.m */; }; + F40EE4C1206BF8B90071091A /* GPBCompileTest23.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE487206BF8B00071091A /* GPBCompileTest23.m */; }; + F40EE50B206C06640071091A /* GPBCompileTest24.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE508206C06440071091A /* GPBCompileTest24.m */; }; + F40EE50C206C06640071091A /* GPBCompileTest25.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE507206C06440071091A /* GPBCompileTest25.m */; }; F41C175D1833D3310064ED4D /* GPBPerfTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F41C175C1833D3310064ED4D /* GPBPerfTests.m */; }; F4353D1D1AB8822D005A6198 /* GPBDescriptorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F4353D1C1AB8822D005A6198 /* GPBDescriptorTests.m */; }; F4353D231ABB1537005A6198 /* GPBDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = F4353D211ABB1537005A6198 /* GPBDictionary.m */; }; @@ -158,6 +183,31 @@ F401DC2A1A8D444600FCC765 /* GPBArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPBArray.h; sourceTree = "<group>"; }; F401DC2B1A8D444600FCC765 /* GPBArray.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBArray.m; sourceTree = "<group>"; }; F401DC321A8E5C0200FCC765 /* GPBArrayTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBArrayTests.m; sourceTree = "<group>"; }; + F40EE47D206BF8AD0071091A /* GPBCompileTest08.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest08.m; sourceTree = "<group>"; }; + F40EE47E206BF8AE0071091A /* GPBCompileTest04.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest04.m; sourceTree = "<group>"; }; + F40EE47F206BF8AE0071091A /* GPBCompileTest05.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest05.m; sourceTree = "<group>"; }; + F40EE480206BF8AE0071091A /* GPBCompileTest07.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest07.m; sourceTree = "<group>"; }; + F40EE481206BF8AE0071091A /* GPBCompileTest02.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest02.m; sourceTree = "<group>"; }; + F40EE482206BF8AF0071091A /* GPBCompileTest19.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest19.m; sourceTree = "<group>"; }; + F40EE483206BF8AF0071091A /* GPBCompileTest13.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest13.m; sourceTree = "<group>"; }; + F40EE484206BF8AF0071091A /* GPBCompileTest09.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest09.m; sourceTree = "<group>"; }; + F40EE485206BF8AF0071091A /* GPBCompileTest20.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest20.m; sourceTree = "<group>"; }; + F40EE486206BF8AF0071091A /* GPBCompileTest21.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest21.m; sourceTree = "<group>"; }; + F40EE487206BF8B00071091A /* GPBCompileTest23.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest23.m; sourceTree = "<group>"; }; + F40EE488206BF8B00071091A /* GPBCompileTest01.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest01.m; sourceTree = "<group>"; }; + F40EE489206BF8B00071091A /* GPBCompileTest15.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest15.m; sourceTree = "<group>"; }; + F40EE48A206BF8B00071091A /* GPBCompileTest22.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest22.m; sourceTree = "<group>"; }; + F40EE48B206BF8B00071091A /* GPBCompileTest16.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest16.m; sourceTree = "<group>"; }; + F40EE48C206BF8B00071091A /* GPBCompileTest10.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest10.m; sourceTree = "<group>"; }; + F40EE48D206BF8B00071091A /* GPBCompileTest17.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest17.m; sourceTree = "<group>"; }; + F40EE48E206BF8B10071091A /* GPBCompileTest18.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest18.m; sourceTree = "<group>"; }; + F40EE48F206BF8B10071091A /* GPBCompileTest14.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest14.m; sourceTree = "<group>"; }; + F40EE490206BF8B10071091A /* GPBCompileTest12.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest12.m; sourceTree = "<group>"; }; + F40EE491206BF8B10071091A /* GPBCompileTest03.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest03.m; sourceTree = "<group>"; }; + F40EE492206BF8B10071091A /* GPBCompileTest06.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest06.m; sourceTree = "<group>"; }; + F40EE493206BF8B20071091A /* GPBCompileTest11.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest11.m; sourceTree = "<group>"; }; + F40EE507206C06440071091A /* GPBCompileTest25.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest25.m; sourceTree = "<group>"; }; + F40EE508206C06440071091A /* GPBCompileTest24.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest24.m; sourceTree = "<group>"; }; F41C175C1833D3310064ED4D /* GPBPerfTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBPerfTests.m; sourceTree = "<group>"; }; F4353D1C1AB8822D005A6198 /* GPBDescriptorTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBDescriptorTests.m; sourceTree = "<group>"; }; F4353D201ABB1537005A6198 /* GPBDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPBDictionary.h; sourceTree = "<group>"; }; @@ -395,6 +445,31 @@ F401DC321A8E5C0200FCC765 /* GPBArrayTests.m */, 7461B69B0F94FDF800A0C422 /* GPBCodedInputStreamTests.m */, 7461B69D0F94FDF800A0C422 /* GPBCodedOuputStreamTests.m */, + F40EE488206BF8B00071091A /* GPBCompileTest01.m */, + F40EE481206BF8AE0071091A /* GPBCompileTest02.m */, + F40EE491206BF8B10071091A /* GPBCompileTest03.m */, + F40EE47E206BF8AE0071091A /* GPBCompileTest04.m */, + F40EE47F206BF8AE0071091A /* GPBCompileTest05.m */, + F40EE492206BF8B10071091A /* GPBCompileTest06.m */, + F40EE480206BF8AE0071091A /* GPBCompileTest07.m */, + F40EE47D206BF8AD0071091A /* GPBCompileTest08.m */, + F40EE484206BF8AF0071091A /* GPBCompileTest09.m */, + F40EE48C206BF8B00071091A /* GPBCompileTest10.m */, + F40EE493206BF8B20071091A /* GPBCompileTest11.m */, + F40EE490206BF8B10071091A /* GPBCompileTest12.m */, + F40EE483206BF8AF0071091A /* GPBCompileTest13.m */, + F40EE48F206BF8B10071091A /* GPBCompileTest14.m */, + F40EE489206BF8B00071091A /* GPBCompileTest15.m */, + F40EE48B206BF8B00071091A /* GPBCompileTest16.m */, + F40EE48D206BF8B00071091A /* GPBCompileTest17.m */, + F40EE48E206BF8B10071091A /* GPBCompileTest18.m */, + F40EE482206BF8AF0071091A /* GPBCompileTest19.m */, + F40EE485206BF8AF0071091A /* GPBCompileTest20.m */, + F40EE486206BF8AF0071091A /* GPBCompileTest21.m */, + F40EE48A206BF8B00071091A /* GPBCompileTest22.m */, + F40EE487206BF8B00071091A /* GPBCompileTest23.m */, + F40EE508206C06440071091A /* GPBCompileTest24.m */, + F40EE507206C06440071091A /* GPBCompileTest25.m */, 5102DABB1891A052002037B6 /* GPBConcurrencyTests.m */, F4353D1C1AB8822D005A6198 /* GPBDescriptorTests.m */, F4C4B9E21E1D974F00D3B61D /* GPBDictionaryTests.m */, @@ -562,7 +637,7 @@ attributes = { LastSwiftUpdateCheck = 0710; LastTestingUpgradeCheck = 0600; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 0930; TargetAttributes = { 8BBEA4A5147C727100C4ADB7 = { LastSwiftMigration = 0800; @@ -661,28 +736,53 @@ buildActionMask = 2147483647; files = ( 8BBEA4A9147C727D00C4ADB7 /* GPBCodedInputStreamTests.m in Sources */, + F40EE50B206C06640071091A /* GPBCompileTest24.m in Sources */, + F40EE4BE206BF8B90071091A /* GPBCompileTest20.m in Sources */, F401DC331A8E5C0200FCC765 /* GPBArrayTests.m in Sources */, + F40EE4B4206BF8B90071091A /* GPBCompileTest10.m in Sources */, F4353D361AC06F10005A6198 /* GPBDictionaryTests+Int64.m in Sources */, + F40EE4C0206BF8B90071091A /* GPBCompileTest22.m in Sources */, + F40EE4B2206BF8B90071091A /* GPBCompileTest08.m in Sources */, + F40EE4BB206BF8B90071091A /* GPBCompileTest17.m in Sources */, F4353D391AC06F10005A6198 /* GPBDictionaryTests+UInt64.m in Sources */, 8BBEA4AA147C727D00C4ADB7 /* GPBCodedOuputStreamTests.m in Sources */, + F40EE4C1206BF8B90071091A /* GPBCompileTest23.m in Sources */, 8BBEA4AC147C727D00C4ADB7 /* GPBMessageTests.m in Sources */, F4B51B1E1BBC610700744318 /* GPBObjectiveCPlusPlusTest.mm in Sources */, + F40EE4BD206BF8B90071091A /* GPBCompileTest19.m in Sources */, + F40EE4B0206BF8B90071091A /* GPBCompileTest06.m in Sources */, + F40EE4B6206BF8B90071091A /* GPBCompileTest12.m in Sources */, F4487C7F1AAF62CD00531423 /* GPBMessageTests+Serialization.m in Sources */, + F40EE4AD206BF8B90071091A /* GPBCompileTest03.m in Sources */, + F40EE4BC206BF8B90071091A /* GPBCompileTest18.m in Sources */, + F40EE4B7206BF8B90071091A /* GPBCompileTest13.m in Sources */, + F40EE4B9206BF8B90071091A /* GPBCompileTest15.m in Sources */, + F40EE4B1206BF8B90071091A /* GPBCompileTest07.m in Sources */, 8B4248DC1A92933A00BC1EC6 /* GPBWellKnownTypesTest.m in Sources */, + F40EE4BF206BF8B90071091A /* GPBCompileTest21.m in Sources */, + F40EE4B5206BF8B90071091A /* GPBCompileTest11.m in Sources */, F4F8D8831D789FD9002CE128 /* GPBUnittestProtos2.m in Sources */, F4353D1D1AB8822D005A6198 /* GPBDescriptorTests.m in Sources */, 8B4248BB1A8C256A00BC1EC6 /* GPBSwiftTests.swift in Sources */, + F40EE50C206C06640071091A /* GPBCompileTest25.m in Sources */, F4584D821ECCB52A00803AB6 /* GPBExtensionRegistryTest.m in Sources */, 5102DABC1891A073002037B6 /* GPBConcurrencyTests.m in Sources */, F4487C751AADF7F500531423 /* GPBMessageTests+Runtime.m in Sources */, + F40EE4AC206BF8B90071091A /* GPBCompileTest02.m in Sources */, F4353D351AC06F10005A6198 /* GPBDictionaryTests+Int32.m in Sources */, + F40EE4AF206BF8B90071091A /* GPBCompileTest05.m in Sources */, + F40EE4B8206BF8B90071091A /* GPBCompileTest14.m in Sources */, 8BBEA4B0147C727D00C4ADB7 /* GPBTestUtilities.m in Sources */, + F40EE4AE206BF8B90071091A /* GPBCompileTest04.m in Sources */, + F40EE4BA206BF8B90071091A /* GPBCompileTest16.m in Sources */, F41C175D1833D3310064ED4D /* GPBPerfTests.m in Sources */, F4353D341AC06F10005A6198 /* GPBDictionaryTests+Bool.m in Sources */, F4487C831AAF6AB300531423 /* GPBMessageTests+Merge.m in Sources */, + F40EE4AB206BF8B90071091A /* GPBCompileTest01.m in Sources */, 8BBEA4B6147C727D00C4ADB7 /* GPBUnknownFieldSetTest.m in Sources */, F4353D371AC06F10005A6198 /* GPBDictionaryTests+String.m in Sources */, F4353D381AC06F10005A6198 /* GPBDictionaryTests+UInt32.m in Sources */, + F40EE4B3206BF8B90071091A /* GPBCompileTest09.m in Sources */, 8BBEA4B7147C727D00C4ADB7 /* GPBUtilitiesTests.m in Sources */, F4C4B9E41E1D976300D3B61D /* GPBDictionaryTests.m in Sources */, 8BBEA4B8147C727D00C4ADB7 /* GPBWireFormatTests.m in Sources */, @@ -718,6 +818,7 @@ 7461B52F0F94FAFA00A0C422 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)"; PRODUCT_NAME = ProtocolBuffers; @@ -727,6 +828,7 @@ 7461B5300F94FAFA00A0C422 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)"; PRODUCT_NAME = ProtocolBuffers; @@ -737,6 +839,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; HEADER_SEARCH_PATHS = ( "${PROJECT_DERIVED_FILE_DIR}/protos", @@ -763,6 +866,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; HEADER_SEARCH_PATHS = ( "${PROJECT_DERIVED_FILE_DIR}/protos", @@ -925,6 +1029,7 @@ F4487C4F1A9F8E0200531423 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)"; PRODUCT_NAME = TestSingleSourceBuild; @@ -934,6 +1039,7 @@ F4487C501A9F8E0200531423 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)"; PRODUCT_NAME = TestSingleSourceBuild; @@ -943,12 +1049,14 @@ F45BBC151B0CE3C6002D064D /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Debug; }; F45BBC161B0CE3C6002D064D /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Release; }; diff --git a/objectivec/ProtocolBuffers_OSX.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/objectivec/ProtocolBuffers_OSX.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/objectivec/ProtocolBuffers_OSX.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>IDEDidComputeMac32BitWarning</key> + <true/> +</dict> +</plist> diff --git a/objectivec/ProtocolBuffers_OSX.xcodeproj/xcshareddata/xcschemes/PerformanceTests.xcscheme b/objectivec/ProtocolBuffers_OSX.xcodeproj/xcshareddata/xcschemes/PerformanceTests.xcscheme index d3c29389..6653a1b0 100644 --- a/objectivec/ProtocolBuffers_OSX.xcodeproj/xcshareddata/xcschemes/PerformanceTests.xcscheme +++ b/objectivec/ProtocolBuffers_OSX.xcodeproj/xcshareddata/xcschemes/PerformanceTests.xcscheme @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <Scheme - LastUpgradeVersion = "0900" + LastUpgradeVersion = "0930" version = "1.3"> <BuildAction parallelizeBuildables = "YES" @@ -26,7 +26,6 @@ buildConfiguration = "Release" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" shouldUseLaunchSchemeArgsEnv = "YES"> <Testables> <TestableReference @@ -301,7 +300,6 @@ buildConfiguration = "Release" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/objectivec/ProtocolBuffers_OSX.xcodeproj/xcshareddata/xcschemes/ProtocolBuffers.xcscheme b/objectivec/ProtocolBuffers_OSX.xcodeproj/xcshareddata/xcschemes/ProtocolBuffers.xcscheme index e7fb8215..328771b8 100644 --- a/objectivec/ProtocolBuffers_OSX.xcodeproj/xcshareddata/xcschemes/ProtocolBuffers.xcscheme +++ b/objectivec/ProtocolBuffers_OSX.xcodeproj/xcshareddata/xcschemes/ProtocolBuffers.xcscheme @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <Scheme - LastUpgradeVersion = "0900" + LastUpgradeVersion = "0930" version = "1.3"> <BuildAction parallelizeBuildables = "YES" @@ -54,9 +54,8 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" - shouldUseLaunchSchemeArgsEnv = "YES" - codeCoverageEnabled = "YES"> + codeCoverageEnabled = "YES" + shouldUseLaunchSchemeArgsEnv = "YES"> <Testables> <TestableReference skipped = "NO"> @@ -90,7 +89,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/objectivec/ProtocolBuffers_iOS.xcodeproj/project.pbxproj b/objectivec/ProtocolBuffers_iOS.xcodeproj/project.pbxproj index 1f1172b2..470652d0 100644 --- a/objectivec/ProtocolBuffers_iOS.xcodeproj/project.pbxproj +++ b/objectivec/ProtocolBuffers_iOS.xcodeproj/project.pbxproj @@ -25,13 +25,6 @@ 8B79657B14992E3F002FFBFC /* GPBRootObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B79657914992E3E002FFBFC /* GPBRootObject.m */; }; 8B8B615D17DF7056002EE618 /* GPBARCUnittestProtos.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B8B615C17DF7056002EE618 /* GPBARCUnittestProtos.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; }; 8B96157414C8C38C00A2AC0B /* GPBDescriptor.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B96157314C8C38C00A2AC0B /* GPBDescriptor.m */; }; - 8B9742331A89D19F00DCE92C /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8B9742321A89D19F00DCE92C /* LaunchScreen.xib */; }; - 8B9742431A8AAA7800DCE92C /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B9742421A8AAA7800DCE92C /* CoreGraphics.framework */; }; - 8B9A5EA61831993600A9D33B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; - 8B9A5EA81831993600A9D33B /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B9A5E9F1831913D00A9D33B /* UIKit.framework */; }; - 8B9A5EAE1831993600A9D33B /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8B9A5EAC1831993600A9D33B /* InfoPlist.strings */; }; - 8B9A5EB41831993600A9D33B /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B9A5EB31831993600A9D33B /* AppDelegate.m */; }; - 8B9A5EB61831993600A9D33B /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8B9A5EB51831993600A9D33B /* Images.xcassets */; }; 8B9A5EEC18330A0F00A9D33B /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B9A5E9F1831913D00A9D33B /* UIKit.framework */; }; 8BBEA4A9147C727D00C4ADB7 /* GPBCodedInputStreamTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 7461B69B0F94FDF800A0C422 /* GPBCodedInputStreamTests.m */; }; 8BBEA4AA147C727D00C4ADB7 /* GPBCodedOuputStreamTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 7461B69D0F94FDF800A0C422 /* GPBCodedOuputStreamTests.m */; }; @@ -44,6 +37,31 @@ 8BD3981F14BE59D70081D629 /* GPBUnittestProtos.m in Sources */ = {isa = PBXBuildFile; fileRef = 8BD3981E14BE59D70081D629 /* GPBUnittestProtos.m */; }; 8BF8193514A0DDA600A2C982 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; F401DC351A8E5C6F00FCC765 /* GPBArrayTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F401DC341A8E5C6F00FCC765 /* GPBArrayTests.m */; }; + F40EE4F0206BF91E0071091A /* GPBCompileTest01.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE4CD206BF9170071091A /* GPBCompileTest01.m */; }; + F40EE4F1206BF91E0071091A /* GPBCompileTest02.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE4C6206BF9170071091A /* GPBCompileTest02.m */; }; + F40EE4F2206BF91E0071091A /* GPBCompileTest03.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE4D6206BF9190071091A /* GPBCompileTest03.m */; }; + F40EE4F3206BF91E0071091A /* GPBCompileTest04.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE4C3206BF9160071091A /* GPBCompileTest04.m */; }; + F40EE4F4206BF91E0071091A /* GPBCompileTest05.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE4C4206BF9160071091A /* GPBCompileTest05.m */; }; + F40EE4F5206BF91E0071091A /* GPBCompileTest06.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE4D7206BF9190071091A /* GPBCompileTest06.m */; }; + F40EE4F6206BF91E0071091A /* GPBCompileTest07.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE4C5206BF9170071091A /* GPBCompileTest07.m */; }; + F40EE4F7206BF91E0071091A /* GPBCompileTest08.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE4C2206BF9160071091A /* GPBCompileTest08.m */; }; + F40EE4F8206BF91E0071091A /* GPBCompileTest09.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE4C9206BF9170071091A /* GPBCompileTest09.m */; }; + F40EE4F9206BF91E0071091A /* GPBCompileTest10.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE4D1206BF9180071091A /* GPBCompileTest10.m */; }; + F40EE4FA206BF91E0071091A /* GPBCompileTest11.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE4D8206BF9190071091A /* GPBCompileTest11.m */; }; + F40EE4FB206BF91E0071091A /* GPBCompileTest12.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE4D5206BF9180071091A /* GPBCompileTest12.m */; }; + F40EE4FC206BF91E0071091A /* GPBCompileTest13.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE4C8206BF9170071091A /* GPBCompileTest13.m */; }; + F40EE4FD206BF91E0071091A /* GPBCompileTest14.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE4D4206BF9180071091A /* GPBCompileTest14.m */; }; + F40EE4FE206BF91E0071091A /* GPBCompileTest15.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE4CE206BF9170071091A /* GPBCompileTest15.m */; }; + F40EE4FF206BF91E0071091A /* GPBCompileTest16.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE4D0206BF9180071091A /* GPBCompileTest16.m */; }; + F40EE500206BF91E0071091A /* GPBCompileTest17.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE4D2206BF9180071091A /* GPBCompileTest17.m */; }; + F40EE501206BF91E0071091A /* GPBCompileTest18.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE4D3206BF9180071091A /* GPBCompileTest18.m */; }; + F40EE502206BF91E0071091A /* GPBCompileTest19.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE4C7206BF9170071091A /* GPBCompileTest19.m */; }; + F40EE503206BF91E0071091A /* GPBCompileTest20.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE4CA206BF9170071091A /* GPBCompileTest20.m */; }; + F40EE504206BF91E0071091A /* GPBCompileTest21.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE4CB206BF9170071091A /* GPBCompileTest21.m */; }; + F40EE505206BF91E0071091A /* GPBCompileTest22.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE4CF206BF9170071091A /* GPBCompileTest22.m */; }; + F40EE506206BF91E0071091A /* GPBCompileTest23.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE4CC206BF9170071091A /* GPBCompileTest23.m */; }; + F40EE511206C068D0071091A /* GPBCompileTest24.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE50E206C06880071091A /* GPBCompileTest24.m */; }; + F40EE512206C068D0071091A /* GPBCompileTest25.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE50D206C06880071091A /* GPBCompileTest25.m */; }; F41C175D1833D3310064ED4D /* GPBPerfTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F41C175C1833D3310064ED4D /* GPBPerfTests.m */; }; F4353D1F1AB88243005A6198 /* GPBDescriptorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F4353D1E1AB88243005A6198 /* GPBDescriptorTests.m */; }; F4353D271ABB156F005A6198 /* GPBDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = F4353D251ABB156F005A6198 /* GPBDictionary.m */; }; @@ -79,13 +97,6 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 8B9A5ED01831994600A9D33B /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; - proxyType = 1; - remoteGlobalIDString = 8B9A5EA41831993600A9D33B; - remoteInfo = iOSTestHarness; - }; 8BBEA4BC147C729A00C4ADB7 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; @@ -163,14 +174,8 @@ 8B8B615C17DF7056002EE618 /* GPBARCUnittestProtos.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBARCUnittestProtos.m; sourceTree = "<group>"; }; 8B96157214C8B06000A2AC0B /* GPBDescriptor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPBDescriptor.h; sourceTree = "<group>"; }; 8B96157314C8C38C00A2AC0B /* GPBDescriptor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBDescriptor.m; sourceTree = "<group>"; }; - 8B9742321A89D19F00DCE92C /* LaunchScreen.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LaunchScreen.xib; sourceTree = "<group>"; }; 8B9742421A8AAA7800DCE92C /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 8B9A5E9F1831913D00A9D33B /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - 8B9A5EA51831993600A9D33B /* iOSTestHarness.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iOSTestHarness.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 8B9A5EAB1831993600A9D33B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; - 8B9A5EAD1831993600A9D33B /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; }; - 8B9A5EB31831993600A9D33B /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; }; - 8B9A5EB51831993600A9D33B /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; }; 8BBD9DB016DD1DC8008E1EC1 /* unittest_lite.proto */ = {isa = PBXFileReference; lastKnownFileType = text; name = unittest_lite.proto; path = ../../src/google/protobuf/unittest_lite.proto; sourceTree = "<group>"; }; 8BBEA4A6147C727100C4ADB7 /* UnitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = UnitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 8BCF338814ED799900BC5317 /* GPBProtocolBuffers.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GPBProtocolBuffers.m; sourceTree = "<group>"; }; @@ -178,6 +183,31 @@ 8BD3981E14BE59D70081D629 /* GPBUnittestProtos.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBUnittestProtos.m; sourceTree = "<group>"; }; 8BEB5AE01498033E0078BF9D /* GPBRuntimeTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPBRuntimeTypes.h; sourceTree = "<group>"; }; F401DC341A8E5C6F00FCC765 /* GPBArrayTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBArrayTests.m; sourceTree = "<group>"; }; + F40EE4C2206BF9160071091A /* GPBCompileTest08.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest08.m; sourceTree = "<group>"; }; + F40EE4C3206BF9160071091A /* GPBCompileTest04.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest04.m; sourceTree = "<group>"; }; + F40EE4C4206BF9160071091A /* GPBCompileTest05.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest05.m; sourceTree = "<group>"; }; + F40EE4C5206BF9170071091A /* GPBCompileTest07.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest07.m; sourceTree = "<group>"; }; + F40EE4C6206BF9170071091A /* GPBCompileTest02.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest02.m; sourceTree = "<group>"; }; + F40EE4C7206BF9170071091A /* GPBCompileTest19.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest19.m; sourceTree = "<group>"; }; + F40EE4C8206BF9170071091A /* GPBCompileTest13.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest13.m; sourceTree = "<group>"; }; + F40EE4C9206BF9170071091A /* GPBCompileTest09.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest09.m; sourceTree = "<group>"; }; + F40EE4CA206BF9170071091A /* GPBCompileTest20.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest20.m; sourceTree = "<group>"; }; + F40EE4CB206BF9170071091A /* GPBCompileTest21.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest21.m; sourceTree = "<group>"; }; + F40EE4CC206BF9170071091A /* GPBCompileTest23.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest23.m; sourceTree = "<group>"; }; + F40EE4CD206BF9170071091A /* GPBCompileTest01.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest01.m; sourceTree = "<group>"; }; + F40EE4CE206BF9170071091A /* GPBCompileTest15.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest15.m; sourceTree = "<group>"; }; + F40EE4CF206BF9170071091A /* GPBCompileTest22.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest22.m; sourceTree = "<group>"; }; + F40EE4D0206BF9180071091A /* GPBCompileTest16.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest16.m; sourceTree = "<group>"; }; + F40EE4D1206BF9180071091A /* GPBCompileTest10.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest10.m; sourceTree = "<group>"; }; + F40EE4D2206BF9180071091A /* GPBCompileTest17.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest17.m; sourceTree = "<group>"; }; + F40EE4D3206BF9180071091A /* GPBCompileTest18.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest18.m; sourceTree = "<group>"; }; + F40EE4D4206BF9180071091A /* GPBCompileTest14.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest14.m; sourceTree = "<group>"; }; + F40EE4D5206BF9180071091A /* GPBCompileTest12.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest12.m; sourceTree = "<group>"; }; + F40EE4D6206BF9190071091A /* GPBCompileTest03.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest03.m; sourceTree = "<group>"; }; + F40EE4D7206BF9190071091A /* GPBCompileTest06.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest06.m; sourceTree = "<group>"; }; + F40EE4D8206BF9190071091A /* GPBCompileTest11.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest11.m; sourceTree = "<group>"; }; + F40EE50D206C06880071091A /* GPBCompileTest25.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest25.m; sourceTree = "<group>"; }; + F40EE50E206C06880071091A /* GPBCompileTest24.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest24.m; sourceTree = "<group>"; }; F41C175C1833D3310064ED4D /* GPBPerfTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBPerfTests.m; sourceTree = "<group>"; }; F4353D1E1AB88243005A6198 /* GPBDescriptorTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBDescriptorTests.m; sourceTree = "<group>"; }; F4353D241ABB156F005A6198 /* GPBDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPBDictionary.h; sourceTree = "<group>"; }; @@ -251,16 +281,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 8B9A5EA21831993600A9D33B /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 8B9742431A8AAA7800DCE92C /* CoreGraphics.framework in Frameworks */, - 8B9A5EA81831993600A9D33B /* UIKit.framework in Frameworks */, - 8B9A5EA61831993600A9D33B /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 8BBEA4A3147C727100C4ADB7 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -303,7 +323,6 @@ children = ( 7461B52E0F94FAF800A0C422 /* libProtocolBuffers.a */, 8BBEA4A6147C727100C4ADB7 /* UnitTests.xctest */, - 8B9A5EA51831993600A9D33B /* iOSTestHarness.app */, F4487C6E1A9F8F8100531423 /* libTestSingleSourceBuild.a */, ); name = Products; @@ -425,7 +444,6 @@ 7461B6940F94FDDD00A0C422 /* Tests */ = { isa = PBXGroup; children = ( - 8B9A5EA91831993600A9D33B /* iOSTestHarness */, 8B4248B71A8BDD9600BC1EC6 /* protobuf */, 8B210CCD159383D60032D72D /* golden_message */, 8B210CCF159386920032D72D /* golden_packed_fields_message */, @@ -433,6 +451,31 @@ F401DC341A8E5C6F00FCC765 /* GPBArrayTests.m */, 7461B69B0F94FDF800A0C422 /* GPBCodedInputStreamTests.m */, 7461B69D0F94FDF800A0C422 /* GPBCodedOuputStreamTests.m */, + F40EE4CD206BF9170071091A /* GPBCompileTest01.m */, + F40EE4C6206BF9170071091A /* GPBCompileTest02.m */, + F40EE4D6206BF9190071091A /* GPBCompileTest03.m */, + F40EE4C3206BF9160071091A /* GPBCompileTest04.m */, + F40EE4C4206BF9160071091A /* GPBCompileTest05.m */, + F40EE4D7206BF9190071091A /* GPBCompileTest06.m */, + F40EE4C5206BF9170071091A /* GPBCompileTest07.m */, + F40EE4C2206BF9160071091A /* GPBCompileTest08.m */, + F40EE4C9206BF9170071091A /* GPBCompileTest09.m */, + F40EE4D1206BF9180071091A /* GPBCompileTest10.m */, + F40EE4D8206BF9190071091A /* GPBCompileTest11.m */, + F40EE4D5206BF9180071091A /* GPBCompileTest12.m */, + F40EE4C8206BF9170071091A /* GPBCompileTest13.m */, + F40EE4D4206BF9180071091A /* GPBCompileTest14.m */, + F40EE4CE206BF9170071091A /* GPBCompileTest15.m */, + F40EE4D0206BF9180071091A /* GPBCompileTest16.m */, + F40EE4D2206BF9180071091A /* GPBCompileTest17.m */, + F40EE4D3206BF9180071091A /* GPBCompileTest18.m */, + F40EE4C7206BF9170071091A /* GPBCompileTest19.m */, + F40EE4CA206BF9170071091A /* GPBCompileTest20.m */, + F40EE4CB206BF9170071091A /* GPBCompileTest21.m */, + F40EE4CF206BF9170071091A /* GPBCompileTest22.m */, + F40EE4CC206BF9170071091A /* GPBCompileTest23.m */, + F40EE50E206C06880071091A /* GPBCompileTest24.m */, + F40EE50D206C06880071091A /* GPBCompileTest25.m */, 5102DABB1891A052002037B6 /* GPBConcurrencyTests.m */, F4353D1E1AB88243005A6198 /* GPBDescriptorTests.m */, F4C4B9E51E1D97BB00D3B61D /* GPBDictionaryTests.m */, @@ -482,26 +525,6 @@ path = Tests; sourceTree = "<group>"; }; - 8B9A5EA91831993600A9D33B /* iOSTestHarness */ = { - isa = PBXGroup; - children = ( - 8B9A5EB31831993600A9D33B /* AppDelegate.m */, - 8B9A5EB51831993600A9D33B /* Images.xcassets */, - 8B9A5EAA1831993600A9D33B /* Supporting Files */, - 8B9742321A89D19F00DCE92C /* LaunchScreen.xib */, - ); - path = iOSTestHarness; - sourceTree = "<group>"; - }; - 8B9A5EAA1831993600A9D33B /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 8B9A5EAB1831993600A9D33B /* Info.plist */, - 8B9A5EAC1831993600A9D33B /* InfoPlist.strings */, - ); - name = "Supporting Files"; - sourceTree = "<group>"; - }; 8BCF334414ED727300BC5317 /* Support */ = { isa = PBXGroup; children = ( @@ -576,23 +599,6 @@ productReference = 7461B52E0F94FAF800A0C422 /* libProtocolBuffers.a */; productType = "com.apple.product-type.library.static"; }; - 8B9A5EA41831993600A9D33B /* iOSTestHarness */ = { - isa = PBXNativeTarget; - buildConfigurationList = 8B9A5ECA1831993600A9D33B /* Build configuration list for PBXNativeTarget "iOSTestHarness" */; - buildPhases = ( - 8B9A5EA11831993600A9D33B /* Sources */, - 8B9A5EA21831993600A9D33B /* Frameworks */, - 8B9A5EA31831993600A9D33B /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = iOSTestHarness; - productName = iOSTestHarness; - productReference = 8B9A5EA51831993600A9D33B /* iOSTestHarness.app */; - productType = "com.apple.product-type.application"; - }; 8BBEA4A5147C727100C4ADB7 /* UnitTests */ = { isa = PBXNativeTarget; buildConfigurationList = 8BBEA4BA147C728600C4ADB7 /* Build configuration list for PBXNativeTarget "UnitTests" */; @@ -607,7 +613,6 @@ dependencies = ( 8BBEA4BD147C729A00C4ADB7 /* PBXTargetDependency */, F45BBC131B0CDBBA002D064D /* PBXTargetDependency */, - 8B9A5ED11831994600A9D33B /* PBXTargetDependency */, ); name = UnitTests; productName = UnitTests; @@ -639,7 +644,7 @@ attributes = { LastSwiftUpdateCheck = 0710; LastTestingUpgradeCheck = 0600; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 0930; TargetAttributes = { 8BBEA4A5147C727100C4ADB7 = { LastSwiftMigration = 0800; @@ -663,7 +668,6 @@ targets = ( 7461B52D0F94FAF800A0C422 /* ProtocolBuffers */, 8BBEA4A5147C727100C4ADB7 /* UnitTests */, - 8B9A5EA41831993600A9D33B /* iOSTestHarness */, F4487C551A9F8F8100531423 /* TestSingleSourceBuild */, F45BBC0E1B0CDB50002D064D /* Compile Unittest Protos */, ); @@ -671,16 +675,6 @@ /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 8B9A5EA31831993600A9D33B /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 8B9A5EAE1831993600A9D33B /* InfoPlist.strings in Resources */, - 8B9A5EB61831993600A9D33B /* Images.xcassets in Resources */, - 8B9742331A89D19F00DCE92C /* LaunchScreen.xib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 8BBEA4A1147C727100C4ADB7 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -744,41 +738,58 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 8B9A5EA11831993600A9D33B /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 8B9A5EB41831993600A9D33B /* AppDelegate.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 8BBEA4A2147C727100C4ADB7 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 8BBEA4A9147C727D00C4ADB7 /* GPBCodedInputStreamTests.m in Sources */, + F40EE511206C068D0071091A /* GPBCompileTest24.m in Sources */, + F40EE503206BF91E0071091A /* GPBCompileTest20.m in Sources */, F401DC351A8E5C6F00FCC765 /* GPBArrayTests.m in Sources */, + F40EE4F9206BF91E0071091A /* GPBCompileTest10.m in Sources */, F4353D441AC06F31005A6198 /* GPBDictionaryTests+Int64.m in Sources */, + F40EE505206BF91E0071091A /* GPBCompileTest22.m in Sources */, + F40EE4F7206BF91E0071091A /* GPBCompileTest08.m in Sources */, + F40EE500206BF91E0071091A /* GPBCompileTest17.m in Sources */, F4353D471AC06F31005A6198 /* GPBDictionaryTests+UInt64.m in Sources */, 8BBEA4AA147C727D00C4ADB7 /* GPBCodedOuputStreamTests.m in Sources */, + F40EE506206BF91E0071091A /* GPBCompileTest23.m in Sources */, 8BBEA4AC147C727D00C4ADB7 /* GPBMessageTests.m in Sources */, F4487C811AAF62FC00531423 /* GPBMessageTests+Serialization.m in Sources */, + F40EE502206BF91E0071091A /* GPBCompileTest19.m in Sources */, + F40EE4F5206BF91E0071091A /* GPBCompileTest06.m in Sources */, + F40EE4FB206BF91E0071091A /* GPBCompileTest12.m in Sources */, 8B4248E61A929C9900BC1EC6 /* GPBWellKnownTypesTest.m in Sources */, + F40EE4F2206BF91E0071091A /* GPBCompileTest03.m in Sources */, + F40EE501206BF91E0071091A /* GPBCompileTest18.m in Sources */, + F40EE4FC206BF91E0071091A /* GPBCompileTest13.m in Sources */, + F40EE4FE206BF91E0071091A /* GPBCompileTest15.m in Sources */, + F40EE4F6206BF91E0071091A /* GPBCompileTest07.m in Sources */, F4353D1F1AB88243005A6198 /* GPBDescriptorTests.m in Sources */, + F40EE504206BF91E0071091A /* GPBCompileTest21.m in Sources */, + F40EE4FA206BF91E0071091A /* GPBCompileTest11.m in Sources */, F4F8D8861D78A193002CE128 /* GPBUnittestProtos2.m in Sources */, F4B51B1C1BBC5C7100744318 /* GPBObjectiveCPlusPlusTest.mm in Sources */, 8B4248B41A8BD96E00BC1EC6 /* GPBSwiftTests.swift in Sources */, + F40EE512206C068D0071091A /* GPBCompileTest25.m in Sources */, F4584D831ECCB53600803AB6 /* GPBExtensionRegistryTest.m in Sources */, 5102DABC1891A073002037B6 /* GPBConcurrencyTests.m in Sources */, F4487C771AADF84900531423 /* GPBMessageTests+Runtime.m in Sources */, + F40EE4F1206BF91E0071091A /* GPBCompileTest02.m in Sources */, F4353D431AC06F31005A6198 /* GPBDictionaryTests+Int32.m in Sources */, + F40EE4F4206BF91E0071091A /* GPBCompileTest05.m in Sources */, + F40EE4FD206BF91E0071091A /* GPBCompileTest14.m in Sources */, 8BBEA4B0147C727D00C4ADB7 /* GPBTestUtilities.m in Sources */, + F40EE4F3206BF91E0071091A /* GPBCompileTest04.m in Sources */, + F40EE4FF206BF91E0071091A /* GPBCompileTest16.m in Sources */, F41C175D1833D3310064ED4D /* GPBPerfTests.m in Sources */, F4353D421AC06F31005A6198 /* GPBDictionaryTests+Bool.m in Sources */, F4487C851AAF6AC500531423 /* GPBMessageTests+Merge.m in Sources */, + F40EE4F0206BF91E0071091A /* GPBCompileTest01.m in Sources */, 8BBEA4B6147C727D00C4ADB7 /* GPBUnknownFieldSetTest.m in Sources */, F4353D451AC06F31005A6198 /* GPBDictionaryTests+String.m in Sources */, F4353D461AC06F31005A6198 /* GPBDictionaryTests+UInt32.m in Sources */, + F40EE4F8206BF91E0071091A /* GPBCompileTest09.m in Sources */, 8BBEA4B7147C727D00C4ADB7 /* GPBUtilitiesTests.m in Sources */, F4C4B9E71E1D97BF00D3B61D /* GPBDictionaryTests.m in Sources */, 8BBEA4B8147C727D00C4ADB7 /* GPBWireFormatTests.m in Sources */, @@ -798,11 +809,6 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 8B9A5ED11831994600A9D33B /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 8B9A5EA41831993600A9D33B /* iOSTestHarness */; - targetProxy = 8B9A5ED01831994600A9D33B /* PBXContainerItemProxy */; - }; 8BBEA4BD147C729A00C4ADB7 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 7461B52D0F94FAF800A0C422 /* ProtocolBuffers */; @@ -815,21 +821,11 @@ }; /* End PBXTargetDependency section */ -/* Begin PBXVariantGroup section */ - 8B9A5EAC1831993600A9D33B /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 8B9A5EAD1831993600A9D33B /* en */, - ); - name = InfoPlist.strings; - sourceTree = "<group>"; - }; -/* End PBXVariantGroup section */ - /* Begin XCBuildConfiguration section */ 7461B52F0F94FAFA00A0C422 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)"; PRODUCT_NAME = ProtocolBuffers; TARGETED_DEVICE_FAMILY = "1,2"; @@ -839,48 +835,19 @@ 7461B5300F94FAFA00A0C422 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)"; PRODUCT_NAME = ProtocolBuffers; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; }; - 8B9A5ECB1831993600A9D33B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CLANG_ENABLE_OBJC_ARC = YES; - INFOPLIST_FILE = "$(SRCROOT)/Tests/iOSTestHarness/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - PRODUCT_BUNDLE_IDENTIFIER = "com.google.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = "1,2"; - WRAPPER_EXTENSION = app; - }; - name = Debug; - }; - 8B9A5ECC1831993600A9D33B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CLANG_ENABLE_OBJC_ARC = YES; - INFOPLIST_FILE = "$(SRCROOT)/Tests/iOSTestHarness/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - PRODUCT_BUNDLE_IDENTIFIER = "com.google.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = "1,2"; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; 8BBEA4A7147C727100C4ADB7 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_WEAK = YES; FRAMEWORK_SEARCH_PATHS = ( - "\"$(SDKROOT)/Developer/Library/Frameworks\"", "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", "$(inherited)", ); @@ -901,7 +868,6 @@ SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/iOSTestHarness.app/iOSTestHarness"; WARNING_CFLAGS = ( "$(inherited)", "-Wno-documentation-unknown-command", @@ -915,8 +881,8 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_WEAK = YES; FRAMEWORK_SEARCH_PATHS = ( - "\"$(SDKROOT)/Developer/Library/Frameworks\"", "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", "$(inherited)", ); @@ -936,7 +902,6 @@ SWIFT_OBJC_BRIDGING_HEADER = "Tests/UnitTests-Bridging-Header.h"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/iOSTestHarness.app/iOSTestHarness"; WARNING_CFLAGS = ( "$(inherited)", "-Wno-documentation-unknown-command", @@ -1089,6 +1054,7 @@ F4487C6C1A9F8F8100531423 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)"; PRODUCT_NAME = TestSingleSourceBuild; TARGETED_DEVICE_FAMILY = "1,2"; @@ -1098,6 +1064,7 @@ F4487C6D1A9F8F8100531423 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; HEADER_SEARCH_PATHS = "$(SRCROOT)"; PRODUCT_NAME = TestSingleSourceBuild; TARGETED_DEVICE_FAMILY = "1,2"; @@ -1107,12 +1074,14 @@ F45BBC0F1B0CDB50002D064D /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Debug; }; F45BBC101B0CDB50002D064D /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; }; name = Release; }; @@ -1128,15 +1097,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 8B9A5ECA1831993600A9D33B /* Build configuration list for PBXNativeTarget "iOSTestHarness" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 8B9A5ECB1831993600A9D33B /* Debug */, - 8B9A5ECC1831993600A9D33B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; 8BBEA4BA147C728600C4ADB7 /* Build configuration list for PBXNativeTarget "UnitTests" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/objectivec/ProtocolBuffers_iOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/objectivec/ProtocolBuffers_iOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/objectivec/ProtocolBuffers_iOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>IDEDidComputeMac32BitWarning</key> + <true/> +</dict> +</plist> diff --git a/objectivec/ProtocolBuffers_iOS.xcodeproj/xcshareddata/xcschemes/PerformanceTests.xcscheme b/objectivec/ProtocolBuffers_iOS.xcodeproj/xcshareddata/xcschemes/PerformanceTests.xcscheme index 03acb083..77483d38 100644 --- a/objectivec/ProtocolBuffers_iOS.xcodeproj/xcshareddata/xcschemes/PerformanceTests.xcscheme +++ b/objectivec/ProtocolBuffers_iOS.xcodeproj/xcshareddata/xcschemes/PerformanceTests.xcscheme @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <Scheme - LastUpgradeVersion = "0900" + LastUpgradeVersion = "0930" version = "1.3"> <BuildAction parallelizeBuildables = "YES" @@ -26,7 +26,6 @@ buildConfiguration = "Release" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" shouldUseLaunchSchemeArgsEnv = "YES"> <Testables> <TestableReference @@ -310,7 +309,6 @@ buildConfiguration = "Release" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/objectivec/ProtocolBuffers_iOS.xcodeproj/xcshareddata/xcschemes/ProtocolBuffers.xcscheme b/objectivec/ProtocolBuffers_iOS.xcodeproj/xcshareddata/xcschemes/ProtocolBuffers.xcscheme index 98bcd562..bacbcba3 100644 --- a/objectivec/ProtocolBuffers_iOS.xcodeproj/xcshareddata/xcschemes/ProtocolBuffers.xcscheme +++ b/objectivec/ProtocolBuffers_iOS.xcodeproj/xcshareddata/xcschemes/ProtocolBuffers.xcscheme @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <Scheme - LastUpgradeVersion = "0900" + LastUpgradeVersion = "0930" version = "1.3"> <BuildAction parallelizeBuildables = "YES" @@ -54,9 +54,8 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" - shouldUseLaunchSchemeArgsEnv = "YES" - codeCoverageEnabled = "YES"> + codeCoverageEnabled = "YES" + shouldUseLaunchSchemeArgsEnv = "YES"> <Testables> <TestableReference skipped = "NO"> @@ -90,23 +89,21 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" debugServiceExtension = "internal" allowLocationSimulation = "YES"> - <BuildableProductRunnable - runnableDebuggingMode = "0"> + <MacroExpansion> <BuildableReference BuildableIdentifier = "primary" - BlueprintIdentifier = "8B9A5EA41831993600A9D33B" - BuildableName = "iOSTestHarness.app" - BlueprintName = "iOSTestHarness" + BlueprintIdentifier = "7461B52D0F94FAF800A0C422" + BuildableName = "libProtocolBuffers.a" + BlueprintName = "ProtocolBuffers" ReferencedContainer = "container:ProtocolBuffers_iOS.xcodeproj"> </BuildableReference> - </BuildableProductRunnable> + </MacroExpansion> <AdditionalOptions> </AdditionalOptions> </LaunchAction> diff --git a/objectivec/README.md b/objectivec/README.md index 7226f0b9..21ac07d8 100644 --- a/objectivec/README.md +++ b/objectivec/README.md @@ -13,16 +13,17 @@ Requirements The Objective C implementation requires: - Objective C 2.0 Runtime (32bit & 64bit iOS, 64bit OS X). -- Xcode 7.0 (or later). +- Xcode 8.0 (or later). - The library code does *not* use ARC (for performance reasons), but it all can be called from ARC code. Installation ------------ -The full distribution pulled from github includes the sources for both the -compiler (protoc) and the runtime (this directory). To build the compiler -and run the runtime tests, you can use: +The distribution pulled from github includes the sources for both the +compiler (protoc) and the runtime (this directory). After cloning the distribution +and needed submodules ([see the src directory's README](../src/README.md)), +to build the compiler and run the runtime tests, you can use: $ objectivec/DevTools/full_mac_build.sh @@ -33,19 +34,21 @@ Building There are two ways to include the Runtime sources in your project: -Add `objectivec/\*.h` & `objectivec/GPBProtocolBuffers.m` to your project. +Add `objectivec/*.h`, `objectivec/google/protobuf/*.pbobjc.h`, and +`objectivec/GPBProtocolBuffers.m` to your project. *or* -Add `objectivec/\*.h` & `objectivec/\*.m` except for +Add `objectivec/*.h`, `objectivec/google/protobuf/*.pbobjc.h`, +`objectivec/google/protobuf/*.pbobjc.m`, and `objectivec/*.m` except for `objectivec/GPBProtocolBuffers.m` to your project. If the target is using ARC, remember to turn off ARC (`-fno-objc-arc`) for the `.m` files. -The files generated by `protoc` for the `*.proto` files (`\*.pbobjc.h` and -`\*.pbobjc.m`) are then also added to the target. +The files generated by `protoc` for the `*.proto` files (`*.pbobjc.h` and +`*.pbobjc.m`) are then also added to the target. Usage ----- diff --git a/objectivec/Tests/GPBCodedInputStreamTests.m b/objectivec/Tests/GPBCodedInputStreamTests.m index d8e128f7..f5aa6903 100644 --- a/objectivec/Tests/GPBCodedInputStreamTests.m +++ b/objectivec/Tests/GPBCodedInputStreamTests.m @@ -220,7 +220,7 @@ 0xa6, 0x01) value:(0x1b << 0) | (0x28 << 7) | (0x79 << 14) | (0x42 << 21) | (0x3bLL << 28) | (0x56LL << 35) | (0x00LL << 42) | - (0x05LL << 49) | (0x26LL << 56) | (0x01LL << 63)]; + (0x05LL << 49) | (0x26LL << 56) | (0x01ULL << 63)]; // Failures [self assertReadVarintFailure:bytes(0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, @@ -261,7 +261,7 @@ GPBCodedInputStream* input32 = [GPBCodedInputStream streamWithData:data]; XCTAssertEqual(value32, [input32 readInt32]); - int64_t value64 = INT64_MIN | (0x01L << 31); + int64_t value64 = INT64_MIN | (0x01LL << 31); GPBCodedInputStream* input64 = [GPBCodedInputStream streamWithData:data]; XCTAssertEqual(value64, [input64 readInt64]); } diff --git a/objectivec/Tests/GPBCodedOuputStreamTests.m b/objectivec/Tests/GPBCodedOuputStreamTests.m index 2ad326be..109239d5 100644 --- a/objectivec/Tests/GPBCodedOuputStreamTests.m +++ b/objectivec/Tests/GPBCodedOuputStreamTests.m @@ -266,7 +266,7 @@ value:(0x1b << 0) | (0x28 << 7) | (0x79 << 14) | (0x42 << 21) | (0x3bLL << 28) | (0x56LL << 35) | (0x00LL << 42) | (0x05LL << 49) | (0x26LL << 56) | - (0x01LL << 63)]; + (0x01ULL << 63)]; } - (void)testWriteLittleEndian { @@ -423,4 +423,14 @@ } } +- (void)testThatItThrowsWhenWriteRawPtrFails { + NSOutputStream *output = [NSOutputStream outputStreamToMemory]; + GPBCodedOutputStream *codedOutput = + [GPBCodedOutputStream streamWithOutputStream:output bufferSize:0]; // Skip buffering. + [output close]; // Close the output stream to force failure on write. + const char *cString = "raw"; + XCTAssertThrowsSpecificNamed([codedOutput writeRawPtr:cString offset:0 length:strlen(cString)], + NSException, GPBCodedOutputStreamException_WriteFailed); +} + @end diff --git a/objectivec/Tests/GPBCompileTest01.m b/objectivec/Tests/GPBCompileTest01.m new file mode 100644 index 00000000..c8bc433a --- /dev/null +++ b/objectivec/Tests/GPBCompileTest01.m @@ -0,0 +1,40 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +// This is a test including a single public header to ensure things build. +// It helps test that imports are complete/ordered correctly. + +#import "GPBArray.h" + + +// Something in the body of this file so the compiler/linker won't complain +// about an empty .o file. +__attribute__((visibility("default"))) char dummy_symbol_1 = 0; diff --git a/objectivec/Tests/GPBCompileTest02.m b/objectivec/Tests/GPBCompileTest02.m new file mode 100644 index 00000000..c44e201a --- /dev/null +++ b/objectivec/Tests/GPBCompileTest02.m @@ -0,0 +1,40 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +// This is a test including a single public header to ensure things build. +// It helps test that imports are complete/ordered correctly. + +#import "GPBCodedInputStream.h" + + +// Something in the body of this file so the compiler/linker won't complain +// about an empty .o file. +__attribute__((visibility("default"))) char dummy_symbol_2 = 0; diff --git a/objectivec/Tests/GPBCompileTest03.m b/objectivec/Tests/GPBCompileTest03.m new file mode 100644 index 00000000..41994f94 --- /dev/null +++ b/objectivec/Tests/GPBCompileTest03.m @@ -0,0 +1,40 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +// This is a test including a single public header to ensure things build. +// It helps test that imports are complete/ordered correctly. + +#import "GPBCodedOutputStream.h" + + +// Something in the body of this file so the compiler/linker won't complain +// about an empty .o file. +__attribute__((visibility("default"))) char dummy_symbol_3 = 0; diff --git a/objectivec/Tests/GPBCompileTest04.m b/objectivec/Tests/GPBCompileTest04.m new file mode 100644 index 00000000..c31498f1 --- /dev/null +++ b/objectivec/Tests/GPBCompileTest04.m @@ -0,0 +1,40 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +// This is a test including a single public header to ensure things build. +// It helps test that imports are complete/ordered correctly. + +#import "GPBDescriptor.h" + + +// Something in the body of this file so the compiler/linker won't complain +// about an empty .o file. +__attribute__((visibility("default"))) char dummy_symbol_4 = 0; diff --git a/objectivec/Tests/GPBCompileTest05.m b/objectivec/Tests/GPBCompileTest05.m new file mode 100644 index 00000000..adb72252 --- /dev/null +++ b/objectivec/Tests/GPBCompileTest05.m @@ -0,0 +1,40 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +// This is a test including a single public header to ensure things build. +// It helps test that imports are complete/ordered correctly. + +#import "GPBDictionary.h" + + +// Something in the body of this file so the compiler/linker won't complain +// about an empty .o file. +__attribute__((visibility("default"))) char dummy_symbol_5 = 0; diff --git a/objectivec/Tests/GPBCompileTest06.m b/objectivec/Tests/GPBCompileTest06.m new file mode 100644 index 00000000..b7505b02 --- /dev/null +++ b/objectivec/Tests/GPBCompileTest06.m @@ -0,0 +1,40 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +// This is a test including a single public header to ensure things build. +// It helps test that imports are complete/ordered correctly. + +#import "GPBExtensionRegistry.h" + + +// Something in the body of this file so the compiler/linker won't complain +// about an empty .o file. +__attribute__((visibility("default"))) char dummy_symbol_6 = 0; diff --git a/objectivec/Tests/GPBCompileTest07.m b/objectivec/Tests/GPBCompileTest07.m new file mode 100644 index 00000000..939bb709 --- /dev/null +++ b/objectivec/Tests/GPBCompileTest07.m @@ -0,0 +1,40 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +// This is a test including a single public header to ensure things build. +// It helps test that imports are complete/ordered correctly. + +#import "GPBMessage.h" + + +// Something in the body of this file so the compiler/linker won't complain +// about an empty .o file. +__attribute__((visibility("default"))) char dummy_symbol_7 = 0; diff --git a/objectivec/Tests/GPBCompileTest08.m b/objectivec/Tests/GPBCompileTest08.m new file mode 100644 index 00000000..a84f38cf --- /dev/null +++ b/objectivec/Tests/GPBCompileTest08.m @@ -0,0 +1,40 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +// This is a test including a single public header to ensure things build. +// It helps test that imports are complete/ordered correctly. + +#import "GPBRootObject.h" + + +// Something in the body of this file so the compiler/linker won't complain +// about an empty .o file. +__attribute__((visibility("default"))) char dummy_symbol_8 = 0; diff --git a/objectivec/Tests/GPBCompileTest09.m b/objectivec/Tests/GPBCompileTest09.m new file mode 100644 index 00000000..f8ccb4a0 --- /dev/null +++ b/objectivec/Tests/GPBCompileTest09.m @@ -0,0 +1,40 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +// This is a test including a single public header to ensure things build. +// It helps test that imports are complete/ordered correctly. + +#import "GPBUnknownField.h" + + +// Something in the body of this file so the compiler/linker won't complain +// about an empty .o file. +__attribute__((visibility("default"))) char dummy_symbol_9 = 0; diff --git a/objectivec/Tests/GPBCompileTest10.m b/objectivec/Tests/GPBCompileTest10.m new file mode 100644 index 00000000..d8318678 --- /dev/null +++ b/objectivec/Tests/GPBCompileTest10.m @@ -0,0 +1,40 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +// This is a test including a single public header to ensure things build. +// It helps test that imports are complete/ordered correctly. + +#import "GPBUnknownFieldSet.h" + + +// Something in the body of this file so the compiler/linker won't complain +// about an empty .o file. +__attribute__((visibility("default"))) char dummy_symbol_10 = 0; diff --git a/objectivec/Tests/GPBCompileTest11.m b/objectivec/Tests/GPBCompileTest11.m new file mode 100644 index 00000000..9f2c6b11 --- /dev/null +++ b/objectivec/Tests/GPBCompileTest11.m @@ -0,0 +1,40 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +// This is a test including a single public header to ensure things build. +// It helps test that imports are complete/ordered correctly. + +#import "GPBUtilities.h" + + +// Something in the body of this file so the compiler/linker won't complain +// about an empty .o file. +__attribute__((visibility("default"))) char dummy_symbol_11 = 0; diff --git a/objectivec/Tests/GPBCompileTest12.m b/objectivec/Tests/GPBCompileTest12.m new file mode 100644 index 00000000..3aa29b31 --- /dev/null +++ b/objectivec/Tests/GPBCompileTest12.m @@ -0,0 +1,40 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +// This is a test including a single public header to ensure things build. +// It helps test that imports are complete/ordered correctly. + +#import "GPBWellKnownTypes.h" + + +// Something in the body of this file so the compiler/linker won't complain +// about an empty .o file. +__attribute__((visibility("default"))) char dummy_symbol_12 = 0; diff --git a/objectivec/Tests/GPBCompileTest13.m b/objectivec/Tests/GPBCompileTest13.m new file mode 100644 index 00000000..fef2af5f --- /dev/null +++ b/objectivec/Tests/GPBCompileTest13.m @@ -0,0 +1,40 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +// This is a test including a single public header to ensure things build. +// It helps test that imports are complete/ordered correctly. + +#import "GPBWireFormat.h" + + +// Something in the body of this file so the compiler/linker won't complain +// about an empty .o file. +__attribute__((visibility("default"))) char dummy_symbol_13 = 0; diff --git a/objectivec/Tests/GPBCompileTest14.m b/objectivec/Tests/GPBCompileTest14.m new file mode 100644 index 00000000..ae04349a --- /dev/null +++ b/objectivec/Tests/GPBCompileTest14.m @@ -0,0 +1,40 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +// This is a test including a single public header to ensure things build. +// It helps test that imports are complete/ordered correctly. + +#import "google/protobuf/Any.pbobjc.h" + + +// Something in the body of this file so the compiler/linker won't complain +// about an empty .o file. +__attribute__((visibility("default"))) char dummy_symbol_14 = 0; diff --git a/objectivec/Tests/GPBCompileTest15.m b/objectivec/Tests/GPBCompileTest15.m new file mode 100644 index 00000000..889243aa --- /dev/null +++ b/objectivec/Tests/GPBCompileTest15.m @@ -0,0 +1,40 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +// This is a test including a single public header to ensure things build. +// It helps test that imports are complete/ordered correctly. + +#import "google/protobuf/Api.pbobjc.h" + + +// Something in the body of this file so the compiler/linker won't complain +// about an empty .o file. +__attribute__((visibility("default"))) char dummy_symbol_15 = 0; diff --git a/objectivec/Tests/GPBCompileTest16.m b/objectivec/Tests/GPBCompileTest16.m new file mode 100644 index 00000000..c5aaf14f --- /dev/null +++ b/objectivec/Tests/GPBCompileTest16.m @@ -0,0 +1,40 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +// This is a test including a single public header to ensure things build. +// It helps test that imports are complete/ordered correctly. + +#import "google/protobuf/Duration.pbobjc.h" + + +// Something in the body of this file so the compiler/linker won't complain +// about an empty .o file. +__attribute__((visibility("default"))) char dummy_symbol_16 = 0; diff --git a/objectivec/Tests/GPBCompileTest17.m b/objectivec/Tests/GPBCompileTest17.m new file mode 100644 index 00000000..feb64d66 --- /dev/null +++ b/objectivec/Tests/GPBCompileTest17.m @@ -0,0 +1,40 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +// This is a test including a single public header to ensure things build. +// It helps test that imports are complete/ordered correctly. + +#import "google/protobuf/Empty.pbobjc.h" + + +// Something in the body of this file so the compiler/linker won't complain +// about an empty .o file. +__attribute__((visibility("default"))) char dummy_symbol_17 = 0; diff --git a/objectivec/Tests/GPBCompileTest18.m b/objectivec/Tests/GPBCompileTest18.m new file mode 100644 index 00000000..66784c4f --- /dev/null +++ b/objectivec/Tests/GPBCompileTest18.m @@ -0,0 +1,40 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +// This is a test including a single public header to ensure things build. +// It helps test that imports are complete/ordered correctly. + +#import "google/protobuf/FieldMask.pbobjc.h" + + +// Something in the body of this file so the compiler/linker won't complain +// about an empty .o file. +__attribute__((visibility("default"))) char dummy_symbol_18 = 0; diff --git a/objectivec/Tests/GPBCompileTest19.m b/objectivec/Tests/GPBCompileTest19.m new file mode 100644 index 00000000..435dea01 --- /dev/null +++ b/objectivec/Tests/GPBCompileTest19.m @@ -0,0 +1,40 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +// This is a test including a single public header to ensure things build. +// It helps test that imports are complete/ordered correctly. + +#import "google/protobuf/SourceContext.pbobjc.h" + + +// Something in the body of this file so the compiler/linker won't complain +// about an empty .o file. +__attribute__((visibility("default"))) char dummy_symbol_19 = 0; diff --git a/objectivec/Tests/GPBCompileTest20.m b/objectivec/Tests/GPBCompileTest20.m new file mode 100644 index 00000000..c2da8066 --- /dev/null +++ b/objectivec/Tests/GPBCompileTest20.m @@ -0,0 +1,40 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +// This is a test including a single public header to ensure things build. +// It helps test that imports are complete/ordered correctly. + +#import "google/protobuf/Struct.pbobjc.h" + + +// Something in the body of this file so the compiler/linker won't complain +// about an empty .o file. +__attribute__((visibility("default"))) char dummy_symbol_20 = 0; diff --git a/objectivec/Tests/GPBCompileTest21.m b/objectivec/Tests/GPBCompileTest21.m new file mode 100644 index 00000000..d7110b93 --- /dev/null +++ b/objectivec/Tests/GPBCompileTest21.m @@ -0,0 +1,40 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +// This is a test including a single public header to ensure things build. +// It helps test that imports are complete/ordered correctly. + +#import "google/protobuf/Timestamp.pbobjc.h" + + +// Something in the body of this file so the compiler/linker won't complain +// about an empty .o file. +__attribute__((visibility("default"))) char dummy_symbol_21 = 0; diff --git a/objectivec/Tests/GPBCompileTest22.m b/objectivec/Tests/GPBCompileTest22.m new file mode 100644 index 00000000..17380618 --- /dev/null +++ b/objectivec/Tests/GPBCompileTest22.m @@ -0,0 +1,40 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +// This is a test including a single public header to ensure things build. +// It helps test that imports are complete/ordered correctly. + +#import "google/protobuf/Type.pbobjc.h" + + +// Something in the body of this file so the compiler/linker won't complain +// about an empty .o file. +__attribute__((visibility("default"))) char dummy_symbol_22 = 0; diff --git a/objectivec/Tests/GPBCompileTest23.m b/objectivec/Tests/GPBCompileTest23.m new file mode 100644 index 00000000..f22f9bdd --- /dev/null +++ b/objectivec/Tests/GPBCompileTest23.m @@ -0,0 +1,40 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +// This is a test including a single public header to ensure things build. +// It helps test that imports are complete/ordered correctly. + +#import "google/protobuf/Wrappers.pbobjc.h" + + +// Something in the body of this file so the compiler/linker won't complain +// about an empty .o file. +__attribute__((visibility("default"))) char dummy_symbol_23 = 0; diff --git a/objectivec/Tests/GPBCompileTest24.m b/objectivec/Tests/GPBCompileTest24.m new file mode 100644 index 00000000..c81ea732 --- /dev/null +++ b/objectivec/Tests/GPBCompileTest24.m @@ -0,0 +1,42 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +// This is a test including a single header to ensure things build. This +// is NOT a public header of the library, but uses a file that defines +// proto2 syntax messages that are extendable, so it can need more things +// that the proto3 syntax WKTs bundled with the library. + +#import "google/protobuf/Descriptor.pbobjc.h" + + +// Something in the body of this file so the compiler/linker won't complain +// about an empty .o file. +__attribute__((visibility("default"))) char dummy_symbol_24 = 0; diff --git a/objectivec/Tests/GPBCompileTest25.m b/objectivec/Tests/GPBCompileTest25.m new file mode 100644 index 00000000..7a482b51 --- /dev/null +++ b/objectivec/Tests/GPBCompileTest25.m @@ -0,0 +1,42 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +// This is a test including a single header to ensure things build. This +// is NOT a public header of the library, but uses a file that defines +// extensions to proto2 syntax messages, so it can need more things +// that the proto3 syntax WKTs bundled with the library. + +#import "google/protobuf/UnittestCustomOptions.pbobjc.h" + + +// Something in the body of this file so the compiler/linker won't complain +// about an empty .o file. +__attribute__((visibility("default"))) char dummy_symbol_25 = 0; diff --git a/objectivec/Tests/GPBDescriptorTests.m b/objectivec/Tests/GPBDescriptorTests.m index 199ea655..d47cc30f 100644 --- a/objectivec/Tests/GPBDescriptorTests.m +++ b/objectivec/Tests/GPBDescriptorTests.m @@ -190,6 +190,63 @@ XCTAssertFalse([descriptor getValue:&value forEnumTextFormatName:@"Unknown"]); } +- (void)testEnumDescriptorIntrospection { + GPBEnumDescriptor *descriptor = TestAllTypes_NestedEnum_EnumDescriptor(); + + XCTAssertEqual(descriptor.enumNameCount, 4U); + XCTAssertEqualObjects([descriptor getEnumNameForIndex:0], + @"TestAllTypes_NestedEnum_Foo"); + XCTAssertEqualObjects([descriptor getEnumTextFormatNameForIndex:0], @"FOO"); + XCTAssertEqualObjects([descriptor getEnumNameForIndex:1], + @"TestAllTypes_NestedEnum_Bar"); + XCTAssertEqualObjects([descriptor getEnumTextFormatNameForIndex:1], @"BAR"); + XCTAssertEqualObjects([descriptor getEnumNameForIndex:2], + @"TestAllTypes_NestedEnum_Baz"); + XCTAssertEqualObjects([descriptor getEnumTextFormatNameForIndex:2], @"BAZ"); + XCTAssertEqualObjects([descriptor getEnumNameForIndex:3], + @"TestAllTypes_NestedEnum_Neg"); + XCTAssertEqualObjects([descriptor getEnumTextFormatNameForIndex:3], @"NEG"); +} + +- (void)testEnumDescriptorIntrospectionWithAlias { + GPBEnumDescriptor *descriptor = TestEnumWithDupValue_EnumDescriptor(); + NSString *enumName; + int32_t value; + + XCTAssertEqual(descriptor.enumNameCount, 5U); + + enumName = [descriptor getEnumNameForIndex:0]; + XCTAssertEqualObjects(enumName, @"TestEnumWithDupValue_Foo1"); + XCTAssertTrue([descriptor getValue:&value forEnumName:enumName]); + XCTAssertEqual(value, 1); + XCTAssertEqualObjects([descriptor getEnumTextFormatNameForIndex:0], @"FOO1"); + + enumName = [descriptor getEnumNameForIndex:1]; + XCTAssertEqualObjects(enumName, @"TestEnumWithDupValue_Bar1"); + XCTAssertTrue([descriptor getValue:&value forEnumName:enumName]); + XCTAssertEqual(value, 2); + XCTAssertEqualObjects([descriptor getEnumTextFormatNameForIndex:1], @"BAR1"); + + enumName = [descriptor getEnumNameForIndex:2]; + XCTAssertEqualObjects(enumName, @"TestEnumWithDupValue_Baz"); + XCTAssertTrue([descriptor getValue:&value forEnumName:enumName]); + XCTAssertEqual(value, 3); + XCTAssertEqualObjects([descriptor getEnumTextFormatNameForIndex:2], @"BAZ"); + + enumName = [descriptor getEnumNameForIndex:3]; + XCTAssertEqualObjects(enumName, @"TestEnumWithDupValue_Foo2"); + XCTAssertTrue([descriptor getValue:&value forEnumName:enumName]); + XCTAssertEqual(value, 1); + XCTAssertEqualObjects([descriptor getEnumTextFormatNameForIndex:3], @"FOO2"); + + enumName = [descriptor getEnumNameForIndex:4]; + XCTAssertEqualObjects(enumName, @"TestEnumWithDupValue_Bar2"); + XCTAssertTrue([descriptor getValue:&value forEnumName:enumName]); + XCTAssertEqual(value, 2); + XCTAssertEqualObjects([descriptor getEnumTextFormatNameForIndex:4], @"BAR2"); + +} + - (void)testEnumValueValidator { GPBDescriptor *descriptor = [TestAllTypes descriptor]; GPBFieldDescriptor *fieldDescriptor = diff --git a/objectivec/Tests/GPBDictionaryTests+Bool.m b/objectivec/Tests/GPBDictionaryTests+Bool.m index 0dbe07b6..0af0c815 100644 --- a/objectivec/Tests/GPBDictionaryTests+Bool.m +++ b/objectivec/Tests/GPBDictionaryTests+Bool.m @@ -63,7 +63,8 @@ } - (void)testOne { - GPBBoolUInt32Dictionary *dict = [GPBBoolUInt32Dictionary dictionaryWithUInt32:100U forKey:YES]; + GPBBoolUInt32Dictionary *dict = [[GPBBoolUInt32Dictionary alloc] init]; + [dict setUInt32:100U forKey:YES]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); uint32_t value; @@ -76,6 +77,7 @@ XCTAssertEqual(aValue, 100U); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -214,17 +216,18 @@ XCTAssertNotNil(dict); GPBBoolUInt32Dictionary *dict2 = - [GPBBoolUInt32Dictionary dictionaryWithDictionary:dict]; + [[GPBBoolUInt32Dictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBBoolUInt32Dictionary *dict = [GPBBoolUInt32Dictionary dictionary]; + GPBBoolUInt32Dictionary *dict = [[GPBBoolUInt32Dictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -249,6 +252,7 @@ XCTAssertTrue([dict getUInt32:&value forKey:NO]); XCTAssertEqual(value, 101U); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -364,7 +368,8 @@ } - (void)testOne { - GPBBoolInt32Dictionary *dict = [GPBBoolInt32Dictionary dictionaryWithInt32:200 forKey:YES]; + GPBBoolInt32Dictionary *dict = [[GPBBoolInt32Dictionary alloc] init]; + [dict setInt32:200 forKey:YES]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); int32_t value; @@ -377,6 +382,7 @@ XCTAssertEqual(aValue, 200); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -515,17 +521,18 @@ XCTAssertNotNil(dict); GPBBoolInt32Dictionary *dict2 = - [GPBBoolInt32Dictionary dictionaryWithDictionary:dict]; + [[GPBBoolInt32Dictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBBoolInt32Dictionary *dict = [GPBBoolInt32Dictionary dictionary]; + GPBBoolInt32Dictionary *dict = [[GPBBoolInt32Dictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -550,6 +557,7 @@ XCTAssertTrue([dict getInt32:&value forKey:NO]); XCTAssertEqual(value, 201); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -665,7 +673,8 @@ } - (void)testOne { - GPBBoolUInt64Dictionary *dict = [GPBBoolUInt64Dictionary dictionaryWithUInt64:300U forKey:YES]; + GPBBoolUInt64Dictionary *dict = [[GPBBoolUInt64Dictionary alloc] init]; + [dict setUInt64:300U forKey:YES]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); uint64_t value; @@ -678,6 +687,7 @@ XCTAssertEqual(aValue, 300U); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -816,17 +826,18 @@ XCTAssertNotNil(dict); GPBBoolUInt64Dictionary *dict2 = - [GPBBoolUInt64Dictionary dictionaryWithDictionary:dict]; + [[GPBBoolUInt64Dictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBBoolUInt64Dictionary *dict = [GPBBoolUInt64Dictionary dictionary]; + GPBBoolUInt64Dictionary *dict = [[GPBBoolUInt64Dictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -851,6 +862,7 @@ XCTAssertTrue([dict getUInt64:&value forKey:NO]); XCTAssertEqual(value, 301U); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -966,7 +978,8 @@ } - (void)testOne { - GPBBoolInt64Dictionary *dict = [GPBBoolInt64Dictionary dictionaryWithInt64:400 forKey:YES]; + GPBBoolInt64Dictionary *dict = [[GPBBoolInt64Dictionary alloc] init]; + [dict setInt64:400 forKey:YES]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); int64_t value; @@ -979,6 +992,7 @@ XCTAssertEqual(aValue, 400); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -1117,17 +1131,18 @@ XCTAssertNotNil(dict); GPBBoolInt64Dictionary *dict2 = - [GPBBoolInt64Dictionary dictionaryWithDictionary:dict]; + [[GPBBoolInt64Dictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBBoolInt64Dictionary *dict = [GPBBoolInt64Dictionary dictionary]; + GPBBoolInt64Dictionary *dict = [[GPBBoolInt64Dictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -1152,6 +1167,7 @@ XCTAssertTrue([dict getInt64:&value forKey:NO]); XCTAssertEqual(value, 401); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -1267,7 +1283,8 @@ } - (void)testOne { - GPBBoolBoolDictionary *dict = [GPBBoolBoolDictionary dictionaryWithBool:NO forKey:YES]; + GPBBoolBoolDictionary *dict = [[GPBBoolBoolDictionary alloc] init]; + [dict setBool:NO forKey:YES]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); BOOL value; @@ -1280,6 +1297,7 @@ XCTAssertEqual(aValue, NO); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -1418,17 +1436,18 @@ XCTAssertNotNil(dict); GPBBoolBoolDictionary *dict2 = - [GPBBoolBoolDictionary dictionaryWithDictionary:dict]; + [[GPBBoolBoolDictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBBoolBoolDictionary *dict = [GPBBoolBoolDictionary dictionary]; + GPBBoolBoolDictionary *dict = [[GPBBoolBoolDictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -1453,6 +1472,7 @@ XCTAssertTrue([dict getBool:&value forKey:NO]); XCTAssertEqual(value, YES); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -1568,7 +1588,8 @@ } - (void)testOne { - GPBBoolFloatDictionary *dict = [GPBBoolFloatDictionary dictionaryWithFloat:500.f forKey:YES]; + GPBBoolFloatDictionary *dict = [[GPBBoolFloatDictionary alloc] init]; + [dict setFloat:500.f forKey:YES]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); float value; @@ -1581,6 +1602,7 @@ XCTAssertEqual(aValue, 500.f); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -1719,17 +1741,18 @@ XCTAssertNotNil(dict); GPBBoolFloatDictionary *dict2 = - [GPBBoolFloatDictionary dictionaryWithDictionary:dict]; + [[GPBBoolFloatDictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBBoolFloatDictionary *dict = [GPBBoolFloatDictionary dictionary]; + GPBBoolFloatDictionary *dict = [[GPBBoolFloatDictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -1754,6 +1777,7 @@ XCTAssertTrue([dict getFloat:&value forKey:NO]); XCTAssertEqual(value, 501.f); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -1869,7 +1893,8 @@ } - (void)testOne { - GPBBoolDoubleDictionary *dict = [GPBBoolDoubleDictionary dictionaryWithDouble:600. forKey:YES]; + GPBBoolDoubleDictionary *dict = [[GPBBoolDoubleDictionary alloc] init]; + [dict setDouble:600. forKey:YES]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); double value; @@ -1882,6 +1907,7 @@ XCTAssertEqual(aValue, 600.); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -2020,17 +2046,18 @@ XCTAssertNotNil(dict); GPBBoolDoubleDictionary *dict2 = - [GPBBoolDoubleDictionary dictionaryWithDictionary:dict]; + [[GPBBoolDoubleDictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBBoolDoubleDictionary *dict = [GPBBoolDoubleDictionary dictionary]; + GPBBoolDoubleDictionary *dict = [[GPBBoolDoubleDictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -2055,6 +2082,7 @@ XCTAssertTrue([dict getDouble:&value forKey:NO]); XCTAssertEqual(value, 601.); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -2170,7 +2198,8 @@ } - (void)testOne { - GPBBoolObjectDictionary<NSString*> *dict = [GPBBoolObjectDictionary dictionaryWithObject:@"abc" forKey:YES]; + GPBBoolObjectDictionary<NSString*> *dict = [[GPBBoolObjectDictionary alloc] init]; + [dict setObject:@"abc" forKey:YES]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); XCTAssertEqualObjects([dict objectForKey:YES], @"abc"); @@ -2180,6 +2209,7 @@ XCTAssertEqualObjects(aObject, @"abc"); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -2313,17 +2343,18 @@ XCTAssertNotNil(dict); GPBBoolObjectDictionary<NSString*> *dict2 = - [GPBBoolObjectDictionary dictionaryWithDictionary:dict]; + [[GPBBoolObjectDictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBBoolObjectDictionary<NSString*> *dict = [GPBBoolObjectDictionary dictionary]; + GPBBoolObjectDictionary<NSString*> *dict = [[GPBBoolObjectDictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -2343,6 +2374,7 @@ XCTAssertEqualObjects([dict objectForKey:YES], @"abc"); XCTAssertEqualObjects([dict objectForKey:NO], @"def"); [dict2 release]; + [dict release]; } - (void)testRemove { diff --git a/objectivec/Tests/GPBDictionaryTests+Int32.m b/objectivec/Tests/GPBDictionaryTests+Int32.m index c539bdc2..4ba30203 100644 --- a/objectivec/Tests/GPBDictionaryTests+Int32.m +++ b/objectivec/Tests/GPBDictionaryTests+Int32.m @@ -45,7 +45,6 @@ // To let the testing macros work, add some extra methods to simplify things. @interface GPBInt32EnumDictionary (TestingTweak) -+ (instancetype)dictionaryWithEnum:(int32_t)value forKey:(int32_t)key; - (instancetype)initWithEnums:(const int32_t [])values forKeys:(const int32_t [])keys count:(NSUInteger)count; @@ -64,14 +63,6 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } @implementation GPBInt32EnumDictionary (TestingTweak) -+ (instancetype)dictionaryWithEnum:(int32_t)value forKey:(int32_t)key { - // Cast is needed to compiler knows what class we are invoking initWithValues: on to get the - // type correct. - return [[(GPBInt32EnumDictionary*)[self alloc] initWithValidationFunction:TestingEnum_IsValidValue - rawValues:&value - forKeys:&key - count:1] autorelease]; -} - (instancetype)initWithEnums:(const int32_t [])values forKeys:(const int32_t [])keys count:(NSUInteger)count { @@ -103,7 +94,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBInt32UInt32Dictionary *dict = [GPBInt32UInt32Dictionary dictionaryWithUInt32:100U forKey:11]; + GPBInt32UInt32Dictionary *dict = [[GPBInt32UInt32Dictionary alloc] init]; + [dict setUInt32:100U forKey:11]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); uint32_t value; @@ -116,6 +108,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 100U); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -258,17 +251,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBInt32UInt32Dictionary *dict2 = - [GPBInt32UInt32Dictionary dictionaryWithDictionary:dict]; + [[GPBInt32UInt32Dictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBInt32UInt32Dictionary *dict = [GPBInt32UInt32Dictionary dictionary]; + GPBInt32UInt32Dictionary *dict = [[GPBInt32UInt32Dictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -299,6 +293,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getUInt32:&value forKey:14]); XCTAssertEqual(value, 103U); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -460,7 +455,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBInt32Int32Dictionary *dict = [GPBInt32Int32Dictionary dictionaryWithInt32:200 forKey:11]; + GPBInt32Int32Dictionary *dict = [[GPBInt32Int32Dictionary alloc] init]; + [dict setInt32:200 forKey:11]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); int32_t value; @@ -473,6 +469,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 200); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -615,17 +612,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBInt32Int32Dictionary *dict2 = - [GPBInt32Int32Dictionary dictionaryWithDictionary:dict]; + [[GPBInt32Int32Dictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBInt32Int32Dictionary *dict = [GPBInt32Int32Dictionary dictionary]; + GPBInt32Int32Dictionary *dict = [[GPBInt32Int32Dictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -656,6 +654,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getInt32:&value forKey:14]); XCTAssertEqual(value, 203); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -817,7 +816,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBInt32UInt64Dictionary *dict = [GPBInt32UInt64Dictionary dictionaryWithUInt64:300U forKey:11]; + GPBInt32UInt64Dictionary *dict = [[GPBInt32UInt64Dictionary alloc] init]; + [dict setUInt64:300U forKey:11]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); uint64_t value; @@ -830,6 +830,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 300U); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -972,17 +973,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBInt32UInt64Dictionary *dict2 = - [GPBInt32UInt64Dictionary dictionaryWithDictionary:dict]; + [[GPBInt32UInt64Dictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBInt32UInt64Dictionary *dict = [GPBInt32UInt64Dictionary dictionary]; + GPBInt32UInt64Dictionary *dict = [[GPBInt32UInt64Dictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -1013,6 +1015,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getUInt64:&value forKey:14]); XCTAssertEqual(value, 303U); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -1174,7 +1177,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBInt32Int64Dictionary *dict = [GPBInt32Int64Dictionary dictionaryWithInt64:400 forKey:11]; + GPBInt32Int64Dictionary *dict = [[GPBInt32Int64Dictionary alloc] init]; + [dict setInt64:400 forKey:11]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); int64_t value; @@ -1187,6 +1191,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 400); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -1329,17 +1334,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBInt32Int64Dictionary *dict2 = - [GPBInt32Int64Dictionary dictionaryWithDictionary:dict]; + [[GPBInt32Int64Dictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBInt32Int64Dictionary *dict = [GPBInt32Int64Dictionary dictionary]; + GPBInt32Int64Dictionary *dict = [[GPBInt32Int64Dictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -1370,6 +1376,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getInt64:&value forKey:14]); XCTAssertEqual(value, 403); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -1531,7 +1538,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBInt32BoolDictionary *dict = [GPBInt32BoolDictionary dictionaryWithBool:YES forKey:11]; + GPBInt32BoolDictionary *dict = [[GPBInt32BoolDictionary alloc] init]; + [dict setBool:YES forKey:11]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); BOOL value; @@ -1544,6 +1552,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, YES); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -1686,17 +1695,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBInt32BoolDictionary *dict2 = - [GPBInt32BoolDictionary dictionaryWithDictionary:dict]; + [[GPBInt32BoolDictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBInt32BoolDictionary *dict = [GPBInt32BoolDictionary dictionary]; + GPBInt32BoolDictionary *dict = [[GPBInt32BoolDictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -1727,6 +1737,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getBool:&value forKey:14]); XCTAssertEqual(value, NO); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -1888,7 +1899,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBInt32FloatDictionary *dict = [GPBInt32FloatDictionary dictionaryWithFloat:500.f forKey:11]; + GPBInt32FloatDictionary *dict = [[GPBInt32FloatDictionary alloc] init]; + [dict setFloat:500.f forKey:11]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); float value; @@ -1901,6 +1913,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 500.f); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -2043,17 +2056,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBInt32FloatDictionary *dict2 = - [GPBInt32FloatDictionary dictionaryWithDictionary:dict]; + [[GPBInt32FloatDictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBInt32FloatDictionary *dict = [GPBInt32FloatDictionary dictionary]; + GPBInt32FloatDictionary *dict = [[GPBInt32FloatDictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -2084,6 +2098,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getFloat:&value forKey:14]); XCTAssertEqual(value, 503.f); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -2245,7 +2260,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBInt32DoubleDictionary *dict = [GPBInt32DoubleDictionary dictionaryWithDouble:600. forKey:11]; + GPBInt32DoubleDictionary *dict = [[GPBInt32DoubleDictionary alloc] init]; + [dict setDouble:600. forKey:11]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); double value; @@ -2258,6 +2274,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 600.); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -2400,17 +2417,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBInt32DoubleDictionary *dict2 = - [GPBInt32DoubleDictionary dictionaryWithDictionary:dict]; + [[GPBInt32DoubleDictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBInt32DoubleDictionary *dict = [GPBInt32DoubleDictionary dictionary]; + GPBInt32DoubleDictionary *dict = [[GPBInt32DoubleDictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -2441,6 +2459,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getDouble:&value forKey:14]); XCTAssertEqual(value, 603.); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -2602,7 +2621,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBInt32EnumDictionary *dict = [GPBInt32EnumDictionary dictionaryWithEnum:700 forKey:11]; + GPBInt32EnumDictionary *dict = [[GPBInt32EnumDictionary alloc] init]; + [dict setEnum:700 forKey:11]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); int32_t value; @@ -2615,6 +2635,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 700); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -2757,17 +2778,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBInt32EnumDictionary *dict2 = - [GPBInt32EnumDictionary dictionaryWithDictionary:dict]; + [[GPBInt32EnumDictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBInt32EnumDictionary *dict = [GPBInt32EnumDictionary dictionary]; + GPBInt32EnumDictionary *dict = [[GPBInt32EnumDictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -2798,6 +2820,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getEnum:&value forKey:14]); XCTAssertEqual(value, 703); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -3120,19 +3143,20 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBInt32EnumDictionary *dict2 = - [GPBInt32EnumDictionary dictionaryWithDictionary:dict]; + [[GPBInt32EnumDictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); XCTAssertEqual(dict.validationFunc, dict2.validationFunc); // Pointer comparison + [dict2 release]; [dict release]; } - (void)testUnknownAdds { GPBInt32EnumDictionary *dict = - [GPBInt32EnumDictionary dictionaryWithValidationFunction:TestingEnum_IsValidValue]; + [[GPBInt32EnumDictionary alloc] initWithValidationFunction:TestingEnum_IsValidValue]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -3172,6 +3196,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getRawValue:&value forKey:14]); XCTAssertEqual(value, 803); [dict2 release]; + [dict release]; } - (void)testUnknownRemove { @@ -3375,7 +3400,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBInt32ObjectDictionary<NSString*> *dict = [GPBInt32ObjectDictionary dictionaryWithObject:@"abc" forKey:11]; + GPBInt32ObjectDictionary<NSString*> *dict = [[GPBInt32ObjectDictionary alloc] init]; + [dict setObject:@"abc" forKey:11]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); XCTAssertEqualObjects([dict objectForKey:11], @"abc"); @@ -3385,6 +3411,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqualObjects(aObject, @"abc"); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -3520,17 +3547,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBInt32ObjectDictionary<NSString*> *dict2 = - [GPBInt32ObjectDictionary dictionaryWithDictionary:dict]; + [[GPBInt32ObjectDictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBInt32ObjectDictionary<NSString*> *dict = [GPBInt32ObjectDictionary dictionary]; + GPBInt32ObjectDictionary<NSString*> *dict = [[GPBInt32ObjectDictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -3552,6 +3580,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqualObjects([dict objectForKey:13], @"ghi"); XCTAssertEqualObjects([dict objectForKey:14], @"jkl"); [dict2 release]; + [dict release]; } - (void)testRemove { diff --git a/objectivec/Tests/GPBDictionaryTests+Int64.m b/objectivec/Tests/GPBDictionaryTests+Int64.m index b90cdf8c..966024b7 100644 --- a/objectivec/Tests/GPBDictionaryTests+Int64.m +++ b/objectivec/Tests/GPBDictionaryTests+Int64.m @@ -45,7 +45,6 @@ // To let the testing macros work, add some extra methods to simplify things. @interface GPBInt64EnumDictionary (TestingTweak) -+ (instancetype)dictionaryWithEnum:(int32_t)value forKey:(int64_t)key; - (instancetype)initWithEnums:(const int32_t [])values forKeys:(const int64_t [])keys count:(NSUInteger)count; @@ -64,14 +63,6 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } @implementation GPBInt64EnumDictionary (TestingTweak) -+ (instancetype)dictionaryWithEnum:(int32_t)value forKey:(int64_t)key { - // Cast is needed to compiler knows what class we are invoking initWithValues: on to get the - // type correct. - return [[(GPBInt64EnumDictionary*)[self alloc] initWithValidationFunction:TestingEnum_IsValidValue - rawValues:&value - forKeys:&key - count:1] autorelease]; -} - (instancetype)initWithEnums:(const int32_t [])values forKeys:(const int64_t [])keys count:(NSUInteger)count { @@ -103,7 +94,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBInt64UInt32Dictionary *dict = [GPBInt64UInt32Dictionary dictionaryWithUInt32:100U forKey:21LL]; + GPBInt64UInt32Dictionary *dict = [[GPBInt64UInt32Dictionary alloc] init]; + [dict setUInt32:100U forKey:21LL]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); uint32_t value; @@ -116,6 +108,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 100U); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -258,17 +251,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBInt64UInt32Dictionary *dict2 = - [GPBInt64UInt32Dictionary dictionaryWithDictionary:dict]; + [[GPBInt64UInt32Dictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBInt64UInt32Dictionary *dict = [GPBInt64UInt32Dictionary dictionary]; + GPBInt64UInt32Dictionary *dict = [[GPBInt64UInt32Dictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -299,6 +293,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getUInt32:&value forKey:24LL]); XCTAssertEqual(value, 103U); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -460,7 +455,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBInt64Int32Dictionary *dict = [GPBInt64Int32Dictionary dictionaryWithInt32:200 forKey:21LL]; + GPBInt64Int32Dictionary *dict = [[GPBInt64Int32Dictionary alloc] init]; + [dict setInt32:200 forKey:21LL]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); int32_t value; @@ -473,6 +469,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 200); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -615,17 +612,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBInt64Int32Dictionary *dict2 = - [GPBInt64Int32Dictionary dictionaryWithDictionary:dict]; + [[GPBInt64Int32Dictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBInt64Int32Dictionary *dict = [GPBInt64Int32Dictionary dictionary]; + GPBInt64Int32Dictionary *dict = [[GPBInt64Int32Dictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -656,6 +654,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getInt32:&value forKey:24LL]); XCTAssertEqual(value, 203); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -817,7 +816,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBInt64UInt64Dictionary *dict = [GPBInt64UInt64Dictionary dictionaryWithUInt64:300U forKey:21LL]; + GPBInt64UInt64Dictionary *dict = [[GPBInt64UInt64Dictionary alloc] init]; + [dict setUInt64:300U forKey:21LL]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); uint64_t value; @@ -830,6 +830,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 300U); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -972,17 +973,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBInt64UInt64Dictionary *dict2 = - [GPBInt64UInt64Dictionary dictionaryWithDictionary:dict]; + [[GPBInt64UInt64Dictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBInt64UInt64Dictionary *dict = [GPBInt64UInt64Dictionary dictionary]; + GPBInt64UInt64Dictionary *dict = [[GPBInt64UInt64Dictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -1013,6 +1015,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getUInt64:&value forKey:24LL]); XCTAssertEqual(value, 303U); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -1174,7 +1177,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBInt64Int64Dictionary *dict = [GPBInt64Int64Dictionary dictionaryWithInt64:400 forKey:21LL]; + GPBInt64Int64Dictionary *dict = [[GPBInt64Int64Dictionary alloc] init]; + [dict setInt64:400 forKey:21LL]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); int64_t value; @@ -1187,6 +1191,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 400); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -1329,17 +1334,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBInt64Int64Dictionary *dict2 = - [GPBInt64Int64Dictionary dictionaryWithDictionary:dict]; + [[GPBInt64Int64Dictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBInt64Int64Dictionary *dict = [GPBInt64Int64Dictionary dictionary]; + GPBInt64Int64Dictionary *dict = [[GPBInt64Int64Dictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -1370,6 +1376,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getInt64:&value forKey:24LL]); XCTAssertEqual(value, 403); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -1531,7 +1538,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBInt64BoolDictionary *dict = [GPBInt64BoolDictionary dictionaryWithBool:YES forKey:21LL]; + GPBInt64BoolDictionary *dict = [[GPBInt64BoolDictionary alloc] init]; + [dict setBool:YES forKey:21LL]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); BOOL value; @@ -1544,6 +1552,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, YES); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -1686,17 +1695,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBInt64BoolDictionary *dict2 = - [GPBInt64BoolDictionary dictionaryWithDictionary:dict]; + [[GPBInt64BoolDictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBInt64BoolDictionary *dict = [GPBInt64BoolDictionary dictionary]; + GPBInt64BoolDictionary *dict = [[GPBInt64BoolDictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -1727,6 +1737,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getBool:&value forKey:24LL]); XCTAssertEqual(value, NO); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -1888,7 +1899,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBInt64FloatDictionary *dict = [GPBInt64FloatDictionary dictionaryWithFloat:500.f forKey:21LL]; + GPBInt64FloatDictionary *dict = [[GPBInt64FloatDictionary alloc] init]; + [dict setFloat:500.f forKey:21LL]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); float value; @@ -1901,6 +1913,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 500.f); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -2043,17 +2056,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBInt64FloatDictionary *dict2 = - [GPBInt64FloatDictionary dictionaryWithDictionary:dict]; + [[GPBInt64FloatDictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBInt64FloatDictionary *dict = [GPBInt64FloatDictionary dictionary]; + GPBInt64FloatDictionary *dict = [[GPBInt64FloatDictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -2084,6 +2098,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getFloat:&value forKey:24LL]); XCTAssertEqual(value, 503.f); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -2245,7 +2260,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBInt64DoubleDictionary *dict = [GPBInt64DoubleDictionary dictionaryWithDouble:600. forKey:21LL]; + GPBInt64DoubleDictionary *dict = [[GPBInt64DoubleDictionary alloc] init]; + [dict setDouble:600. forKey:21LL]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); double value; @@ -2258,6 +2274,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 600.); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -2400,17 +2417,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBInt64DoubleDictionary *dict2 = - [GPBInt64DoubleDictionary dictionaryWithDictionary:dict]; + [[GPBInt64DoubleDictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBInt64DoubleDictionary *dict = [GPBInt64DoubleDictionary dictionary]; + GPBInt64DoubleDictionary *dict = [[GPBInt64DoubleDictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -2441,6 +2459,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getDouble:&value forKey:24LL]); XCTAssertEqual(value, 603.); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -2602,7 +2621,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBInt64EnumDictionary *dict = [GPBInt64EnumDictionary dictionaryWithEnum:700 forKey:21LL]; + GPBInt64EnumDictionary *dict = [[GPBInt64EnumDictionary alloc] init]; + [dict setEnum:700 forKey:21LL]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); int32_t value; @@ -2615,6 +2635,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 700); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -2757,17 +2778,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBInt64EnumDictionary *dict2 = - [GPBInt64EnumDictionary dictionaryWithDictionary:dict]; + [[GPBInt64EnumDictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBInt64EnumDictionary *dict = [GPBInt64EnumDictionary dictionary]; + GPBInt64EnumDictionary *dict = [[GPBInt64EnumDictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -2798,6 +2820,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getEnum:&value forKey:24LL]); XCTAssertEqual(value, 703); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -3120,19 +3143,20 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBInt64EnumDictionary *dict2 = - [GPBInt64EnumDictionary dictionaryWithDictionary:dict]; + [[GPBInt64EnumDictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); XCTAssertEqual(dict.validationFunc, dict2.validationFunc); // Pointer comparison + [dict2 release]; [dict release]; } - (void)testUnknownAdds { GPBInt64EnumDictionary *dict = - [GPBInt64EnumDictionary dictionaryWithValidationFunction:TestingEnum_IsValidValue]; + [[GPBInt64EnumDictionary alloc] initWithValidationFunction:TestingEnum_IsValidValue]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -3172,6 +3196,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getRawValue:&value forKey:24LL]); XCTAssertEqual(value, 803); [dict2 release]; + [dict release]; } - (void)testUnknownRemove { @@ -3375,7 +3400,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBInt64ObjectDictionary<NSString*> *dict = [GPBInt64ObjectDictionary dictionaryWithObject:@"abc" forKey:21LL]; + GPBInt64ObjectDictionary<NSString*> *dict = [[GPBInt64ObjectDictionary alloc] init]; + [dict setObject:@"abc" forKey:21LL]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); XCTAssertEqualObjects([dict objectForKey:21LL], @"abc"); @@ -3385,6 +3411,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqualObjects(aObject, @"abc"); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -3520,17 +3547,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBInt64ObjectDictionary<NSString*> *dict2 = - [GPBInt64ObjectDictionary dictionaryWithDictionary:dict]; + [[GPBInt64ObjectDictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBInt64ObjectDictionary<NSString*> *dict = [GPBInt64ObjectDictionary dictionary]; + GPBInt64ObjectDictionary<NSString*> *dict = [[GPBInt64ObjectDictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -3552,6 +3580,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqualObjects([dict objectForKey:23LL], @"ghi"); XCTAssertEqualObjects([dict objectForKey:24LL], @"jkl"); [dict2 release]; + [dict release]; } - (void)testRemove { diff --git a/objectivec/Tests/GPBDictionaryTests+String.m b/objectivec/Tests/GPBDictionaryTests+String.m index 5df1d51d..82d7952b 100644 --- a/objectivec/Tests/GPBDictionaryTests+String.m +++ b/objectivec/Tests/GPBDictionaryTests+String.m @@ -45,7 +45,6 @@ // To let the testing macros work, add some extra methods to simplify things. @interface GPBStringEnumDictionary (TestingTweak) -+ (instancetype)dictionaryWithEnum:(int32_t)value forKey:(NSString *)key; - (instancetype)initWithEnums:(const int32_t [])values forKeys:(const NSString * [])keys count:(NSUInteger)count; @@ -64,14 +63,6 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } @implementation GPBStringEnumDictionary (TestingTweak) -+ (instancetype)dictionaryWithEnum:(int32_t)value forKey:(NSString *)key { - // Cast is needed to compiler knows what class we are invoking initWithValues: on to get the - // type correct. - return [[(GPBStringEnumDictionary*)[self alloc] initWithValidationFunction:TestingEnum_IsValidValue - rawValues:&value - forKeys:&key - count:1] autorelease]; -} - (instancetype)initWithEnums:(const int32_t [])values forKeys:(const NSString * [])keys count:(NSUInteger)count { @@ -103,7 +94,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBStringUInt32Dictionary *dict = [GPBStringUInt32Dictionary dictionaryWithUInt32:100U forKey:@"foo"]; + GPBStringUInt32Dictionary *dict = [[GPBStringUInt32Dictionary alloc] init]; + [dict setUInt32:100U forKey:@"foo"]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); uint32_t value; @@ -116,6 +108,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 100U); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -258,17 +251,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBStringUInt32Dictionary *dict2 = - [GPBStringUInt32Dictionary dictionaryWithDictionary:dict]; + [[GPBStringUInt32Dictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBStringUInt32Dictionary *dict = [GPBStringUInt32Dictionary dictionary]; + GPBStringUInt32Dictionary *dict = [[GPBStringUInt32Dictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -299,6 +293,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getUInt32:&value forKey:@"mumble"]); XCTAssertEqual(value, 103U); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -460,7 +455,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBStringInt32Dictionary *dict = [GPBStringInt32Dictionary dictionaryWithInt32:200 forKey:@"foo"]; + GPBStringInt32Dictionary *dict = [[GPBStringInt32Dictionary alloc] init]; + [dict setInt32:200 forKey:@"foo"]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); int32_t value; @@ -473,6 +469,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 200); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -615,17 +612,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBStringInt32Dictionary *dict2 = - [GPBStringInt32Dictionary dictionaryWithDictionary:dict]; + [[GPBStringInt32Dictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBStringInt32Dictionary *dict = [GPBStringInt32Dictionary dictionary]; + GPBStringInt32Dictionary *dict = [[GPBStringInt32Dictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -656,6 +654,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getInt32:&value forKey:@"mumble"]); XCTAssertEqual(value, 203); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -817,7 +816,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBStringUInt64Dictionary *dict = [GPBStringUInt64Dictionary dictionaryWithUInt64:300U forKey:@"foo"]; + GPBStringUInt64Dictionary *dict = [[GPBStringUInt64Dictionary alloc] init]; + [dict setUInt64:300U forKey:@"foo"]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); uint64_t value; @@ -830,6 +830,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 300U); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -972,17 +973,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBStringUInt64Dictionary *dict2 = - [GPBStringUInt64Dictionary dictionaryWithDictionary:dict]; + [[GPBStringUInt64Dictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBStringUInt64Dictionary *dict = [GPBStringUInt64Dictionary dictionary]; + GPBStringUInt64Dictionary *dict = [[GPBStringUInt64Dictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -1013,6 +1015,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getUInt64:&value forKey:@"mumble"]); XCTAssertEqual(value, 303U); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -1174,7 +1177,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBStringInt64Dictionary *dict = [GPBStringInt64Dictionary dictionaryWithInt64:400 forKey:@"foo"]; + GPBStringInt64Dictionary *dict = [[GPBStringInt64Dictionary alloc] init]; + [dict setInt64:400 forKey:@"foo"]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); int64_t value; @@ -1187,6 +1191,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 400); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -1329,17 +1334,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBStringInt64Dictionary *dict2 = - [GPBStringInt64Dictionary dictionaryWithDictionary:dict]; + [[GPBStringInt64Dictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBStringInt64Dictionary *dict = [GPBStringInt64Dictionary dictionary]; + GPBStringInt64Dictionary *dict = [[GPBStringInt64Dictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -1370,6 +1376,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getInt64:&value forKey:@"mumble"]); XCTAssertEqual(value, 403); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -1531,7 +1538,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBStringBoolDictionary *dict = [GPBStringBoolDictionary dictionaryWithBool:YES forKey:@"foo"]; + GPBStringBoolDictionary *dict = [[GPBStringBoolDictionary alloc] init]; + [dict setBool:YES forKey:@"foo"]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); BOOL value; @@ -1544,6 +1552,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, YES); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -1686,17 +1695,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBStringBoolDictionary *dict2 = - [GPBStringBoolDictionary dictionaryWithDictionary:dict]; + [[GPBStringBoolDictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBStringBoolDictionary *dict = [GPBStringBoolDictionary dictionary]; + GPBStringBoolDictionary *dict = [[GPBStringBoolDictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -1727,6 +1737,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getBool:&value forKey:@"mumble"]); XCTAssertEqual(value, NO); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -1888,7 +1899,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBStringFloatDictionary *dict = [GPBStringFloatDictionary dictionaryWithFloat:500.f forKey:@"foo"]; + GPBStringFloatDictionary *dict = [[GPBStringFloatDictionary alloc] init]; + [dict setFloat:500.f forKey:@"foo"]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); float value; @@ -1901,6 +1913,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 500.f); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -2043,17 +2056,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBStringFloatDictionary *dict2 = - [GPBStringFloatDictionary dictionaryWithDictionary:dict]; + [[GPBStringFloatDictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBStringFloatDictionary *dict = [GPBStringFloatDictionary dictionary]; + GPBStringFloatDictionary *dict = [[GPBStringFloatDictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -2084,6 +2098,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getFloat:&value forKey:@"mumble"]); XCTAssertEqual(value, 503.f); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -2245,7 +2260,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBStringDoubleDictionary *dict = [GPBStringDoubleDictionary dictionaryWithDouble:600. forKey:@"foo"]; + GPBStringDoubleDictionary *dict = [[GPBStringDoubleDictionary alloc] init]; + [dict setDouble:600. forKey:@"foo"]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); double value; @@ -2258,6 +2274,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 600.); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -2400,17 +2417,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBStringDoubleDictionary *dict2 = - [GPBStringDoubleDictionary dictionaryWithDictionary:dict]; + [[GPBStringDoubleDictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBStringDoubleDictionary *dict = [GPBStringDoubleDictionary dictionary]; + GPBStringDoubleDictionary *dict = [[GPBStringDoubleDictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -2441,6 +2459,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getDouble:&value forKey:@"mumble"]); XCTAssertEqual(value, 603.); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -2602,7 +2621,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBStringEnumDictionary *dict = [GPBStringEnumDictionary dictionaryWithEnum:700 forKey:@"foo"]; + GPBStringEnumDictionary *dict = [[GPBStringEnumDictionary alloc] init]; + [dict setEnum:700 forKey:@"foo"]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); int32_t value; @@ -2615,6 +2635,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 700); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -2757,17 +2778,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBStringEnumDictionary *dict2 = - [GPBStringEnumDictionary dictionaryWithDictionary:dict]; + [[GPBStringEnumDictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBStringEnumDictionary *dict = [GPBStringEnumDictionary dictionary]; + GPBStringEnumDictionary *dict = [[GPBStringEnumDictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -2798,6 +2820,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getEnum:&value forKey:@"mumble"]); XCTAssertEqual(value, 703); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -3120,19 +3143,20 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBStringEnumDictionary *dict2 = - [GPBStringEnumDictionary dictionaryWithDictionary:dict]; + [[GPBStringEnumDictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); XCTAssertEqual(dict.validationFunc, dict2.validationFunc); // Pointer comparison + [dict2 release]; [dict release]; } - (void)testUnknownAdds { GPBStringEnumDictionary *dict = - [GPBStringEnumDictionary dictionaryWithValidationFunction:TestingEnum_IsValidValue]; + [[GPBStringEnumDictionary alloc] initWithValidationFunction:TestingEnum_IsValidValue]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -3172,6 +3196,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getRawValue:&value forKey:@"mumble"]); XCTAssertEqual(value, 803); [dict2 release]; + [dict release]; } - (void)testUnknownRemove { diff --git a/objectivec/Tests/GPBDictionaryTests+UInt32.m b/objectivec/Tests/GPBDictionaryTests+UInt32.m index 1d3f6f78..5314c58a 100644 --- a/objectivec/Tests/GPBDictionaryTests+UInt32.m +++ b/objectivec/Tests/GPBDictionaryTests+UInt32.m @@ -45,7 +45,6 @@ // To let the testing macros work, add some extra methods to simplify things. @interface GPBUInt32EnumDictionary (TestingTweak) -+ (instancetype)dictionaryWithEnum:(int32_t)value forKey:(uint32_t)key; - (instancetype)initWithEnums:(const int32_t [])values forKeys:(const uint32_t [])keys count:(NSUInteger)count; @@ -64,14 +63,6 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } @implementation GPBUInt32EnumDictionary (TestingTweak) -+ (instancetype)dictionaryWithEnum:(int32_t)value forKey:(uint32_t)key { - // Cast is needed to compiler knows what class we are invoking initWithValues: on to get the - // type correct. - return [[(GPBUInt32EnumDictionary*)[self alloc] initWithValidationFunction:TestingEnum_IsValidValue - rawValues:&value - forKeys:&key - count:1] autorelease]; -} - (instancetype)initWithEnums:(const int32_t [])values forKeys:(const uint32_t [])keys count:(NSUInteger)count { @@ -103,7 +94,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBUInt32UInt32Dictionary *dict = [GPBUInt32UInt32Dictionary dictionaryWithUInt32:100U forKey:1U]; + GPBUInt32UInt32Dictionary *dict = [[GPBUInt32UInt32Dictionary alloc] init]; + [dict setUInt32:100U forKey:1U]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); uint32_t value; @@ -116,6 +108,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 100U); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -258,17 +251,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBUInt32UInt32Dictionary *dict2 = - [GPBUInt32UInt32Dictionary dictionaryWithDictionary:dict]; + [[GPBUInt32UInt32Dictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBUInt32UInt32Dictionary *dict = [GPBUInt32UInt32Dictionary dictionary]; + GPBUInt32UInt32Dictionary *dict = [[GPBUInt32UInt32Dictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -299,6 +293,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getUInt32:&value forKey:4U]); XCTAssertEqual(value, 103U); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -460,7 +455,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBUInt32Int32Dictionary *dict = [GPBUInt32Int32Dictionary dictionaryWithInt32:200 forKey:1U]; + GPBUInt32Int32Dictionary *dict = [[GPBUInt32Int32Dictionary alloc] init]; + [dict setInt32:200 forKey:1U]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); int32_t value; @@ -473,6 +469,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 200); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -615,17 +612,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBUInt32Int32Dictionary *dict2 = - [GPBUInt32Int32Dictionary dictionaryWithDictionary:dict]; + [[GPBUInt32Int32Dictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBUInt32Int32Dictionary *dict = [GPBUInt32Int32Dictionary dictionary]; + GPBUInt32Int32Dictionary *dict = [[GPBUInt32Int32Dictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -656,6 +654,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getInt32:&value forKey:4U]); XCTAssertEqual(value, 203); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -817,7 +816,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBUInt32UInt64Dictionary *dict = [GPBUInt32UInt64Dictionary dictionaryWithUInt64:300U forKey:1U]; + GPBUInt32UInt64Dictionary *dict = [[GPBUInt32UInt64Dictionary alloc] init]; + [dict setUInt64:300U forKey:1U]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); uint64_t value; @@ -830,6 +830,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 300U); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -972,17 +973,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBUInt32UInt64Dictionary *dict2 = - [GPBUInt32UInt64Dictionary dictionaryWithDictionary:dict]; + [[GPBUInt32UInt64Dictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBUInt32UInt64Dictionary *dict = [GPBUInt32UInt64Dictionary dictionary]; + GPBUInt32UInt64Dictionary *dict = [[GPBUInt32UInt64Dictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -1013,6 +1015,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getUInt64:&value forKey:4U]); XCTAssertEqual(value, 303U); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -1174,7 +1177,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBUInt32Int64Dictionary *dict = [GPBUInt32Int64Dictionary dictionaryWithInt64:400 forKey:1U]; + GPBUInt32Int64Dictionary *dict = [[GPBUInt32Int64Dictionary alloc] init]; + [dict setInt64:400 forKey:1U]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); int64_t value; @@ -1187,6 +1191,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 400); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -1329,17 +1334,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBUInt32Int64Dictionary *dict2 = - [GPBUInt32Int64Dictionary dictionaryWithDictionary:dict]; + [[GPBUInt32Int64Dictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBUInt32Int64Dictionary *dict = [GPBUInt32Int64Dictionary dictionary]; + GPBUInt32Int64Dictionary *dict = [[GPBUInt32Int64Dictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -1370,6 +1376,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getInt64:&value forKey:4U]); XCTAssertEqual(value, 403); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -1531,7 +1538,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBUInt32BoolDictionary *dict = [GPBUInt32BoolDictionary dictionaryWithBool:YES forKey:1U]; + GPBUInt32BoolDictionary *dict = [[GPBUInt32BoolDictionary alloc] init]; + [dict setBool:YES forKey:1U]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); BOOL value; @@ -1544,6 +1552,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, YES); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -1686,17 +1695,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBUInt32BoolDictionary *dict2 = - [GPBUInt32BoolDictionary dictionaryWithDictionary:dict]; + [[GPBUInt32BoolDictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBUInt32BoolDictionary *dict = [GPBUInt32BoolDictionary dictionary]; + GPBUInt32BoolDictionary *dict = [[GPBUInt32BoolDictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -1727,6 +1737,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getBool:&value forKey:4U]); XCTAssertEqual(value, NO); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -1888,7 +1899,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBUInt32FloatDictionary *dict = [GPBUInt32FloatDictionary dictionaryWithFloat:500.f forKey:1U]; + GPBUInt32FloatDictionary *dict = [[GPBUInt32FloatDictionary alloc] init]; + [dict setFloat:500.f forKey:1U]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); float value; @@ -1901,6 +1913,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 500.f); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -2043,17 +2056,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBUInt32FloatDictionary *dict2 = - [GPBUInt32FloatDictionary dictionaryWithDictionary:dict]; + [[GPBUInt32FloatDictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBUInt32FloatDictionary *dict = [GPBUInt32FloatDictionary dictionary]; + GPBUInt32FloatDictionary *dict = [[GPBUInt32FloatDictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -2084,6 +2098,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getFloat:&value forKey:4U]); XCTAssertEqual(value, 503.f); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -2245,7 +2260,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBUInt32DoubleDictionary *dict = [GPBUInt32DoubleDictionary dictionaryWithDouble:600. forKey:1U]; + GPBUInt32DoubleDictionary *dict = [[GPBUInt32DoubleDictionary alloc] init]; + [dict setDouble:600. forKey:1U]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); double value; @@ -2258,6 +2274,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 600.); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -2400,17 +2417,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBUInt32DoubleDictionary *dict2 = - [GPBUInt32DoubleDictionary dictionaryWithDictionary:dict]; + [[GPBUInt32DoubleDictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBUInt32DoubleDictionary *dict = [GPBUInt32DoubleDictionary dictionary]; + GPBUInt32DoubleDictionary *dict = [[GPBUInt32DoubleDictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -2441,6 +2459,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getDouble:&value forKey:4U]); XCTAssertEqual(value, 603.); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -2602,7 +2621,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBUInt32EnumDictionary *dict = [GPBUInt32EnumDictionary dictionaryWithEnum:700 forKey:1U]; + GPBUInt32EnumDictionary *dict = [[GPBUInt32EnumDictionary alloc] init]; + [dict setEnum:700 forKey:1U]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); int32_t value; @@ -2615,6 +2635,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 700); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -2757,17 +2778,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBUInt32EnumDictionary *dict2 = - [GPBUInt32EnumDictionary dictionaryWithDictionary:dict]; + [[GPBUInt32EnumDictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBUInt32EnumDictionary *dict = [GPBUInt32EnumDictionary dictionary]; + GPBUInt32EnumDictionary *dict = [[GPBUInt32EnumDictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -2798,6 +2820,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getEnum:&value forKey:4U]); XCTAssertEqual(value, 703); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -3120,19 +3143,20 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBUInt32EnumDictionary *dict2 = - [GPBUInt32EnumDictionary dictionaryWithDictionary:dict]; + [[GPBUInt32EnumDictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); XCTAssertEqual(dict.validationFunc, dict2.validationFunc); // Pointer comparison + [dict2 release]; [dict release]; } - (void)testUnknownAdds { GPBUInt32EnumDictionary *dict = - [GPBUInt32EnumDictionary dictionaryWithValidationFunction:TestingEnum_IsValidValue]; + [[GPBUInt32EnumDictionary alloc] initWithValidationFunction:TestingEnum_IsValidValue]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -3172,6 +3196,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getRawValue:&value forKey:4U]); XCTAssertEqual(value, 803); [dict2 release]; + [dict release]; } - (void)testUnknownRemove { @@ -3375,7 +3400,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBUInt32ObjectDictionary<NSString*> *dict = [GPBUInt32ObjectDictionary dictionaryWithObject:@"abc" forKey:1U]; + GPBUInt32ObjectDictionary<NSString*> *dict = [[GPBUInt32ObjectDictionary alloc] init]; + [dict setObject:@"abc" forKey:1U]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); XCTAssertEqualObjects([dict objectForKey:1U], @"abc"); @@ -3385,6 +3411,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqualObjects(aObject, @"abc"); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -3520,17 +3547,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBUInt32ObjectDictionary<NSString*> *dict2 = - [GPBUInt32ObjectDictionary dictionaryWithDictionary:dict]; + [[GPBUInt32ObjectDictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBUInt32ObjectDictionary<NSString*> *dict = [GPBUInt32ObjectDictionary dictionary]; + GPBUInt32ObjectDictionary<NSString*> *dict = [[GPBUInt32ObjectDictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -3552,6 +3580,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqualObjects([dict objectForKey:3U], @"ghi"); XCTAssertEqualObjects([dict objectForKey:4U], @"jkl"); [dict2 release]; + [dict release]; } - (void)testRemove { diff --git a/objectivec/Tests/GPBDictionaryTests+UInt64.m b/objectivec/Tests/GPBDictionaryTests+UInt64.m index 94c116f6..ccd063f5 100644 --- a/objectivec/Tests/GPBDictionaryTests+UInt64.m +++ b/objectivec/Tests/GPBDictionaryTests+UInt64.m @@ -45,7 +45,6 @@ // To let the testing macros work, add some extra methods to simplify things. @interface GPBUInt64EnumDictionary (TestingTweak) -+ (instancetype)dictionaryWithEnum:(int32_t)value forKey:(uint64_t)key; - (instancetype)initWithEnums:(const int32_t [])values forKeys:(const uint64_t [])keys count:(NSUInteger)count; @@ -64,14 +63,6 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } @implementation GPBUInt64EnumDictionary (TestingTweak) -+ (instancetype)dictionaryWithEnum:(int32_t)value forKey:(uint64_t)key { - // Cast is needed to compiler knows what class we are invoking initWithValues: on to get the - // type correct. - return [[(GPBUInt64EnumDictionary*)[self alloc] initWithValidationFunction:TestingEnum_IsValidValue - rawValues:&value - forKeys:&key - count:1] autorelease]; -} - (instancetype)initWithEnums:(const int32_t [])values forKeys:(const uint64_t [])keys count:(NSUInteger)count { @@ -103,7 +94,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBUInt64UInt32Dictionary *dict = [GPBUInt64UInt32Dictionary dictionaryWithUInt32:100U forKey:31ULL]; + GPBUInt64UInt32Dictionary *dict = [[GPBUInt64UInt32Dictionary alloc] init]; + [dict setUInt32:100U forKey:31ULL]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); uint32_t value; @@ -116,6 +108,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 100U); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -258,17 +251,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBUInt64UInt32Dictionary *dict2 = - [GPBUInt64UInt32Dictionary dictionaryWithDictionary:dict]; + [[GPBUInt64UInt32Dictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBUInt64UInt32Dictionary *dict = [GPBUInt64UInt32Dictionary dictionary]; + GPBUInt64UInt32Dictionary *dict = [[GPBUInt64UInt32Dictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -299,6 +293,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getUInt32:&value forKey:34ULL]); XCTAssertEqual(value, 103U); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -460,7 +455,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBUInt64Int32Dictionary *dict = [GPBUInt64Int32Dictionary dictionaryWithInt32:200 forKey:31ULL]; + GPBUInt64Int32Dictionary *dict = [[GPBUInt64Int32Dictionary alloc] init]; + [dict setInt32:200 forKey:31ULL]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); int32_t value; @@ -473,6 +469,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 200); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -615,17 +612,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBUInt64Int32Dictionary *dict2 = - [GPBUInt64Int32Dictionary dictionaryWithDictionary:dict]; + [[GPBUInt64Int32Dictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBUInt64Int32Dictionary *dict = [GPBUInt64Int32Dictionary dictionary]; + GPBUInt64Int32Dictionary *dict = [[GPBUInt64Int32Dictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -656,6 +654,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getInt32:&value forKey:34ULL]); XCTAssertEqual(value, 203); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -817,7 +816,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBUInt64UInt64Dictionary *dict = [GPBUInt64UInt64Dictionary dictionaryWithUInt64:300U forKey:31ULL]; + GPBUInt64UInt64Dictionary *dict = [[GPBUInt64UInt64Dictionary alloc] init]; + [dict setUInt64:300U forKey:31ULL]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); uint64_t value; @@ -830,6 +830,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 300U); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -972,17 +973,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBUInt64UInt64Dictionary *dict2 = - [GPBUInt64UInt64Dictionary dictionaryWithDictionary:dict]; + [[GPBUInt64UInt64Dictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBUInt64UInt64Dictionary *dict = [GPBUInt64UInt64Dictionary dictionary]; + GPBUInt64UInt64Dictionary *dict = [[GPBUInt64UInt64Dictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -1013,6 +1015,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getUInt64:&value forKey:34ULL]); XCTAssertEqual(value, 303U); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -1174,7 +1177,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBUInt64Int64Dictionary *dict = [GPBUInt64Int64Dictionary dictionaryWithInt64:400 forKey:31ULL]; + GPBUInt64Int64Dictionary *dict = [[GPBUInt64Int64Dictionary alloc] init]; + [dict setInt64:400 forKey:31ULL]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); int64_t value; @@ -1187,6 +1191,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 400); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -1329,17 +1334,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBUInt64Int64Dictionary *dict2 = - [GPBUInt64Int64Dictionary dictionaryWithDictionary:dict]; + [[GPBUInt64Int64Dictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBUInt64Int64Dictionary *dict = [GPBUInt64Int64Dictionary dictionary]; + GPBUInt64Int64Dictionary *dict = [[GPBUInt64Int64Dictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -1370,6 +1376,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getInt64:&value forKey:34ULL]); XCTAssertEqual(value, 403); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -1531,7 +1538,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBUInt64BoolDictionary *dict = [GPBUInt64BoolDictionary dictionaryWithBool:YES forKey:31ULL]; + GPBUInt64BoolDictionary *dict = [[GPBUInt64BoolDictionary alloc] init]; + [dict setBool:YES forKey:31ULL]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); BOOL value; @@ -1544,6 +1552,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, YES); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -1686,17 +1695,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBUInt64BoolDictionary *dict2 = - [GPBUInt64BoolDictionary dictionaryWithDictionary:dict]; + [[GPBUInt64BoolDictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBUInt64BoolDictionary *dict = [GPBUInt64BoolDictionary dictionary]; + GPBUInt64BoolDictionary *dict = [[GPBUInt64BoolDictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -1727,6 +1737,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getBool:&value forKey:34ULL]); XCTAssertEqual(value, NO); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -1888,7 +1899,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBUInt64FloatDictionary *dict = [GPBUInt64FloatDictionary dictionaryWithFloat:500.f forKey:31ULL]; + GPBUInt64FloatDictionary *dict = [[GPBUInt64FloatDictionary alloc] init]; + [dict setFloat:500.f forKey:31ULL]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); float value; @@ -1901,6 +1913,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 500.f); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -2043,17 +2056,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBUInt64FloatDictionary *dict2 = - [GPBUInt64FloatDictionary dictionaryWithDictionary:dict]; + [[GPBUInt64FloatDictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBUInt64FloatDictionary *dict = [GPBUInt64FloatDictionary dictionary]; + GPBUInt64FloatDictionary *dict = [[GPBUInt64FloatDictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -2084,6 +2098,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getFloat:&value forKey:34ULL]); XCTAssertEqual(value, 503.f); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -2245,7 +2260,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBUInt64DoubleDictionary *dict = [GPBUInt64DoubleDictionary dictionaryWithDouble:600. forKey:31ULL]; + GPBUInt64DoubleDictionary *dict = [[GPBUInt64DoubleDictionary alloc] init]; + [dict setDouble:600. forKey:31ULL]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); double value; @@ -2258,6 +2274,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 600.); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -2400,17 +2417,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBUInt64DoubleDictionary *dict2 = - [GPBUInt64DoubleDictionary dictionaryWithDictionary:dict]; + [[GPBUInt64DoubleDictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBUInt64DoubleDictionary *dict = [GPBUInt64DoubleDictionary dictionary]; + GPBUInt64DoubleDictionary *dict = [[GPBUInt64DoubleDictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -2441,6 +2459,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getDouble:&value forKey:34ULL]); XCTAssertEqual(value, 603.); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -2602,7 +2621,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBUInt64EnumDictionary *dict = [GPBUInt64EnumDictionary dictionaryWithEnum:700 forKey:31ULL]; + GPBUInt64EnumDictionary *dict = [[GPBUInt64EnumDictionary alloc] init]; + [dict setEnum:700 forKey:31ULL]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); int32_t value; @@ -2615,6 +2635,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqual(aValue, 700); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -2757,17 +2778,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBUInt64EnumDictionary *dict2 = - [GPBUInt64EnumDictionary dictionaryWithDictionary:dict]; + [[GPBUInt64EnumDictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBUInt64EnumDictionary *dict = [GPBUInt64EnumDictionary dictionary]; + GPBUInt64EnumDictionary *dict = [[GPBUInt64EnumDictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -2798,6 +2820,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getEnum:&value forKey:34ULL]); XCTAssertEqual(value, 703); [dict2 release]; + [dict release]; } - (void)testRemove { @@ -3120,19 +3143,20 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBUInt64EnumDictionary *dict2 = - [GPBUInt64EnumDictionary dictionaryWithDictionary:dict]; + [[GPBUInt64EnumDictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); XCTAssertEqual(dict.validationFunc, dict2.validationFunc); // Pointer comparison + [dict2 release]; [dict release]; } - (void)testUnknownAdds { GPBUInt64EnumDictionary *dict = - [GPBUInt64EnumDictionary dictionaryWithValidationFunction:TestingEnum_IsValidValue]; + [[GPBUInt64EnumDictionary alloc] initWithValidationFunction:TestingEnum_IsValidValue]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -3172,6 +3196,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertTrue([dict getRawValue:&value forKey:34ULL]); XCTAssertEqual(value, 803); [dict2 release]; + [dict release]; } - (void)testUnknownRemove { @@ -3375,7 +3400,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { } - (void)testOne { - GPBUInt64ObjectDictionary<NSString*> *dict = [GPBUInt64ObjectDictionary dictionaryWithObject:@"abc" forKey:31ULL]; + GPBUInt64ObjectDictionary<NSString*> *dict = [[GPBUInt64ObjectDictionary alloc] init]; + [dict setObject:@"abc" forKey:31ULL]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); XCTAssertEqualObjects([dict objectForKey:31ULL], @"abc"); @@ -3385,6 +3411,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqualObjects(aObject, @"abc"); XCTAssertNotEqual(stop, NULL); }]; + [dict release]; } - (void)testBasics { @@ -3520,17 +3547,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); GPBUInt64ObjectDictionary<NSString*> *dict2 = - [GPBUInt64ObjectDictionary dictionaryWithDictionary:dict]; + [[GPBUInt64ObjectDictionary alloc] initWithDictionary:dict]; XCTAssertNotNil(dict2); // Should be new pointer, but equal objects. XCTAssertNotEqual(dict, dict2); XCTAssertEqualObjects(dict, dict2); + [dict2 release]; [dict release]; } - (void)testAdds { - GPBUInt64ObjectDictionary<NSString*> *dict = [GPBUInt64ObjectDictionary dictionary]; + GPBUInt64ObjectDictionary<NSString*> *dict = [[GPBUInt64ObjectDictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); @@ -3552,6 +3580,7 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertEqualObjects([dict objectForKey:33ULL], @"ghi"); XCTAssertEqualObjects([dict objectForKey:34ULL], @"jkl"); [dict2 release]; + [dict release]; } - (void)testRemove { diff --git a/objectivec/Tests/GPBDictionaryTests.pddm b/objectivec/Tests/GPBDictionaryTests.pddm index d6aa7211..17f12c28 100644 --- a/objectivec/Tests/GPBDictionaryTests.pddm +++ b/objectivec/Tests/GPBDictionaryTests.pddm @@ -78,7 +78,8 @@ //%} //% //%- (void)testOne { -//% DICTIONARY_CLASS_DECL##VHELPER(KEY_NAME, VALUE_NAME, VALUE_TYPE) *dict = [GPB##KEY_NAME##VALUE_NAME##Dictionary dictionaryWith##VALUE_NAME$u##:VAL1 forKey:KEY1]; +//% DICTIONARY_CLASS_DECL##VHELPER(KEY_NAME, VALUE_NAME, VALUE_TYPE) *dict = [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] init]; +//% [dict set##VALUE_NAME$u##:VAL1 forKey:KEY1]; //% XCTAssertNotNil(dict); //% XCTAssertEqual(dict.count, 1U); //%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, VNAME)TEST_VALUE##VHELPER(VALUE_NAME, dict, VNAME, KEY1, VAL1) @@ -88,6 +89,7 @@ //% XCTAssertEqual##VSUFFIX(a##VNAME$u, VAL1); //% XCTAssertNotEqual(stop, NULL); //% }]; +//% [dict release]; //%} //% //%- (void)testBasics { @@ -223,17 +225,18 @@ //% XCTAssertNotNil(dict); //% //% DICTIONARY_CLASS_DECL##VHELPER(KEY_NAME, VALUE_NAME, VALUE_TYPE) *dict2 = -//% [GPB##KEY_NAME##VALUE_NAME##Dictionary dictionaryWithDictionary:dict]; +//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithDictionary:dict]; //% XCTAssertNotNil(dict2); //% //% // Should be new pointer, but equal objects. //% XCTAssertNotEqual(dict, dict2); //% XCTAssertEqualObjects(dict, dict2); +//% [dict2 release]; //% [dict release]; //%} //% //%- (void)testAdds { -//% DICTIONARY_CLASS_DECL##VHELPER(KEY_NAME, VALUE_NAME, VALUE_TYPE) *dict = [GPB##KEY_NAME##VALUE_NAME##Dictionary dictionary]; +//% DICTIONARY_CLASS_DECL##VHELPER(KEY_NAME, VALUE_NAME, VALUE_TYPE) *dict = [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] init]; //% XCTAssertNotNil(dict); //% //% XCTAssertEqual(dict.count, 0U); @@ -255,6 +258,7 @@ //%TEST_VALUE##VHELPER(VALUE_NAME, dict, VNAME, KEY3, VAL3) //%TEST_VALUE##VHELPER(VALUE_NAME, dict, VNAME, KEY4, VAL4) //% [dict2 release]; +//% [dict release]; //%} //% //%- (void)testRemove { @@ -522,19 +526,20 @@ //% XCTAssertNotNil(dict); //% //% DICTIONARY_CLASS_DECL##VHELPER(KEY_NAME, VALUE_NAME, VALUE_TYPE) *dict2 = -//% [GPB##KEY_NAME##VALUE_NAME##Dictionary dictionaryWithDictionary:dict]; +//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithDictionary:dict]; //% XCTAssertNotNil(dict2); //% //% // Should be new pointer, but equal objects. //% XCTAssertNotEqual(dict, dict2); //% XCTAssertEqualObjects(dict, dict2); //% XCTAssertEqual(dict.validationFunc, dict2.validationFunc); // Pointer comparison +//% [dict2 release]; //% [dict release]; //%} //% //%- (void)testUnknownAdds { //% DICTIONARY_CLASS_DECL##VHELPER(KEY_NAME, VALUE_NAME, VALUE_TYPE) *dict = -//% [GPB##KEY_NAME##VALUE_NAME##Dictionary dictionaryWithValidationFunction:TestingEnum_IsValidValue]; +//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValidationFunction:TestingEnum_IsValidValue]; //% XCTAssertNotNil(dict); //% //% XCTAssertEqual(dict.count, 0U); @@ -561,6 +566,7 @@ //%TEST_VALUE##VHELPER(VALUE_NAME, dict, value, KEY4, kGPBUnrecognizedEnumeratorValue) //%TEST_RAW_VALUE##VHELPER(dict, value, KEY4, VAL4) //% [dict2 release]; +//% [dict release]; //%} //% //%- (void)testUnknownRemove { @@ -729,7 +735,6 @@ //%PDDM-DEFINE TEST_HELPERS(KEY_NAME, KEY_TYPE, KisP) //%// To let the testing macros work, add some extra methods to simplify things. //%@interface GPB##KEY_NAME##EnumDictionary (TestingTweak) -//%+ (instancetype)dictionaryWithEnum:(int32_t)value forKey:(KEY_TYPE##KisP$S##KisP)key; //%- (instancetype)initWithEnums:(const int32_t [])values //% forKeys:(const KEY_TYPE##KisP$S##KisP [])keys //% count:(NSUInteger)count; @@ -748,14 +753,6 @@ //%} //% //%@implementation GPB##KEY_NAME##EnumDictionary (TestingTweak) -//%+ (instancetype)dictionaryWithEnum:(int32_t)value forKey:(KEY_TYPE##KisP$S##KisP)key { -//% // Cast is needed to compiler knows what class we are invoking initWithValues: on to get the -//% // type correct. -//% return [[(GPB##KEY_NAME##EnumDictionary*)[self alloc] initWithValidationFunction:TestingEnum_IsValidValue -//% KEY_NAME$S rawValues:&value -//% KEY_NAME$S forKeys:&key -//% KEY_NAME$S count:1] autorelease]; -//%} //%- (instancetype)initWithEnums:(const int32_t [])values //% forKeys:(const KEY_TYPE##KisP$S##KisP [])keys //% count:(NSUInteger)count { @@ -801,7 +798,8 @@ //%} //% //%- (void)testOne { -//% DICTIONARY_CLASS_DECL##VHELPER(KEY_NAME, VALUE_NAME, VALUE_TYPE) *dict = [GPB##KEY_NAME##VALUE_NAME##Dictionary dictionaryWith##VALUE_NAME$u##:VAL1 forKey:KEY1]; +//% DICTIONARY_CLASS_DECL##VHELPER(KEY_NAME, VALUE_NAME, VALUE_TYPE) *dict = [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] init]; +//% [dict set##VALUE_NAME$u##:VAL1 forKey:KEY1]; //% XCTAssertNotNil(dict); //% XCTAssertEqual(dict.count, 1U); //%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, VNAME)TEST_VALUE##VHELPER(VALUE_NAME, dict, VNAME, KEY1, VAL1) @@ -811,6 +809,7 @@ //% XCTAssertEqual##VSUFFIX(a##VNAME$u, VAL1); //% XCTAssertNotEqual(stop, NULL); //% }]; +//% [dict release]; //%} //% //%- (void)testBasics { @@ -944,17 +943,18 @@ //% XCTAssertNotNil(dict); //% //% DICTIONARY_CLASS_DECL##VHELPER(KEY_NAME, VALUE_NAME, VALUE_TYPE) *dict2 = -//% [GPB##KEY_NAME##VALUE_NAME##Dictionary dictionaryWithDictionary:dict]; +//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithDictionary:dict]; //% XCTAssertNotNil(dict2); //% //% // Should be new pointer, but equal objects. //% XCTAssertNotEqual(dict, dict2); //% XCTAssertEqualObjects(dict, dict2); +//% [dict2 release]; //% [dict release]; //%} //% //%- (void)testAdds { -//% DICTIONARY_CLASS_DECL##VHELPER(KEY_NAME, VALUE_NAME, VALUE_TYPE) *dict = [GPB##KEY_NAME##VALUE_NAME##Dictionary dictionary]; +//% DICTIONARY_CLASS_DECL##VHELPER(KEY_NAME, VALUE_NAME, VALUE_TYPE) *dict = [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] init]; //% XCTAssertNotNil(dict); //% //% XCTAssertEqual(dict.count, 0U); @@ -974,6 +974,7 @@ //%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, VNAME)TEST_VALUE##VHELPER(VALUE_NAME, dict, VNAME, KEY1, VAL1) //%TEST_VALUE##VHELPER(VALUE_NAME, dict, VNAME, KEY2, VAL2) //% [dict2 release]; +//% [dict release]; //%} //% //%- (void)testRemove { diff --git a/objectivec/Tests/GPBMessageTests+Serialization.m b/objectivec/Tests/GPBMessageTests+Serialization.m index 55d77a1f..921feab7 100644 --- a/objectivec/Tests/GPBMessageTests+Serialization.m +++ b/objectivec/Tests/GPBMessageTests+Serialization.m @@ -1114,10 +1114,10 @@ - (void)testMap_Proto2UnknownEnum { TestEnumMapPlusExtra *orig = [[TestEnumMapPlusExtra alloc] init]; - orig.knownMapField = [GPBInt32EnumDictionary - dictionaryWithValidationFunction:Proto2MapEnumPlusExtra_IsValidValue]; - orig.unknownMapField = [GPBInt32EnumDictionary - dictionaryWithValidationFunction:Proto2MapEnumPlusExtra_IsValidValue]; + orig.knownMapField = [[[GPBInt32EnumDictionary alloc] + initWithValidationFunction:Proto2MapEnumPlusExtra_IsValidValue] autorelease]; + orig.unknownMapField = [[[GPBInt32EnumDictionary alloc] + initWithValidationFunction:Proto2MapEnumPlusExtra_IsValidValue] autorelease]; [orig.knownMapField setEnum:Proto2MapEnumPlusExtra_EProto2MapEnumFoo forKey:0]; [orig.unknownMapField setEnum:Proto2MapEnumPlusExtra_EProto2MapEnumExtra diff --git a/objectivec/Tests/GPBMessageTests.m b/objectivec/Tests/GPBMessageTests.m index c15535c5..a3149096 100644 --- a/objectivec/Tests/GPBMessageTests.m +++ b/objectivec/Tests/GPBMessageTests.m @@ -1238,7 +1238,8 @@ // with different objects that are equal). TestRecursiveMessageWithRepeatedField *message3 = [TestRecursiveMessageWithRepeatedField message]; - message3.iToI = [GPBInt32Int32Dictionary dictionaryWithInt32:10 forKey:20]; + message3.iToI = [[[GPBInt32Int32Dictionary alloc] init] autorelease]; + [message3.iToI setInt32:10 forKey:20]; message3.strToStr = [NSMutableDictionary dictionaryWithObject:@"abc" forKey:@"123"]; XCTAssertNotNil(message.iToI); @@ -1323,7 +1324,8 @@ XCTAssertFalse([message hasA]); GPBInt32Int32Dictionary *iToI = [message.a.iToI retain]; XCTAssertEqual(iToI->_autocreator, message.a); // Pointer comparision - message.a.iToI = [GPBInt32Int32Dictionary dictionaryWithInt32:6 forKey:7]; + message.a.iToI = [[[GPBInt32Int32Dictionary alloc] init] autorelease]; + [message.a.iToI setInt32:6 forKey:7]; XCTAssertTrue([message hasA]); XCTAssertNotEqual(message.a.iToI, iToI); // Pointer comparision XCTAssertNil(iToI->_autocreator); @@ -2050,4 +2052,55 @@ XCTAssertEqual([msg1 hash], [msg1Prime hash]); } +- (void)testCopyingMapFileds { + TestMessageOfMaps *msg = [TestMessageOfMaps message]; + + msg.strToStr[@"foo"] = @"bar"; + + [msg.strToInt setInt32:1 forKey:@"mumble"]; + [msg.intToStr setObject:@"wee" forKey:42]; + [msg.intToInt setInt32:123 forKey:321]; + + [msg.strToBool setBool:YES forKey:@"one"]; + [msg.boolToStr setObject:@"something" forKey:YES]; + [msg.boolToBool setBool:YES forKey:NO]; + + [msg.intToBool setBool:YES forKey:13]; + [msg.boolToInt setInt32:111 forKey:NO]; + + TestAllTypes *subMsg1 = [TestAllTypes message]; + subMsg1.optionalInt32 = 1; + TestAllTypes *subMsg2 = [TestAllTypes message]; + subMsg1.optionalInt32 = 2; + TestAllTypes *subMsg3 = [TestAllTypes message]; + subMsg1.optionalInt32 = 3; + + msg.strToMsg[@"baz"] = subMsg1; + [msg.intToMsg setObject:subMsg2 forKey:222]; + [msg.boolToMsg setObject:subMsg3 forKey:YES]; + + TestMessageOfMaps *msg2 = [[msg copy] autorelease]; + XCTAssertNotNil(msg2); + XCTAssertEqualObjects(msg2, msg); + XCTAssertTrue(msg2 != msg); // ptr compare + XCTAssertTrue(msg.strToStr != msg2.strToStr); // ptr compare + XCTAssertTrue(msg.intToStr != msg2.intToStr); // ptr compare + XCTAssertTrue(msg.intToInt != msg2.intToInt); // ptr compare + XCTAssertTrue(msg.strToBool != msg2.strToBool); // ptr compare + XCTAssertTrue(msg.boolToStr != msg2.boolToStr); // ptr compare + XCTAssertTrue(msg.boolToBool != msg2.boolToBool); // ptr compare + XCTAssertTrue(msg.intToBool != msg2.intToBool); // ptr compare + XCTAssertTrue(msg.boolToInt != msg2.boolToInt); // ptr compare + XCTAssertTrue(msg.strToMsg != msg2.strToMsg); // ptr compare + XCTAssertTrue(msg.intToMsg != msg2.intToMsg); // ptr compare + XCTAssertTrue(msg.boolToMsg != msg2.boolToMsg); // ptr compare + + XCTAssertTrue(msg.strToMsg[@"baz"] != msg2.strToMsg[@"baz"]); // ptr compare + XCTAssertEqualObjects(msg.strToMsg[@"baz"], msg2.strToMsg[@"baz"]); + XCTAssertTrue([msg.intToMsg objectForKey:222] != [msg2.intToMsg objectForKey:222]); // ptr compare + XCTAssertEqualObjects([msg.intToMsg objectForKey:222], [msg2.intToMsg objectForKey:222]); + XCTAssertTrue([msg.boolToMsg objectForKey:YES] != [msg2.boolToMsg objectForKey:YES]); // ptr compare + XCTAssertEqualObjects([msg.boolToMsg objectForKey:YES], [msg2.boolToMsg objectForKey:YES]); +} + @end diff --git a/objectivec/Tests/GPBUtilitiesTests.m b/objectivec/Tests/GPBUtilitiesTests.m index 2e206a54..8a8ba93e 100644 --- a/objectivec/Tests/GPBUtilitiesTests.m +++ b/objectivec/Tests/GPBUtilitiesTests.m @@ -52,12 +52,12 @@ - (void)testRightShiftFunctions { XCTAssertEqual((1UL << 31) >> 31, 1UL); - XCTAssertEqual((1 << 31) >> 31, -1); + XCTAssertEqual((int32_t)(1U << 31) >> 31, -1); XCTAssertEqual((1ULL << 63) >> 63, 1ULL); - XCTAssertEqual((1LL << 63) >> 63, -1LL); + XCTAssertEqual((int64_t)(1ULL << 63) >> 63, -1LL); - XCTAssertEqual(GPBLogicalRightShift32((1 << 31), 31), 1); - XCTAssertEqual(GPBLogicalRightShift64((1LL << 63), 63), 1LL); + XCTAssertEqual(GPBLogicalRightShift32((1U << 31), 31), 1); + XCTAssertEqual(GPBLogicalRightShift64((1ULL << 63), 63), 1LL); } - (void)testGPBDecodeTextFormatName { diff --git a/objectivec/Tests/iOSTestHarness/AppDelegate.m b/objectivec/Tests/iOSTestHarness/AppDelegate.m deleted file mode 100644 index 8c4a586b..00000000 --- a/objectivec/Tests/iOSTestHarness/AppDelegate.m +++ /dev/null @@ -1,35 +0,0 @@ -#import <UIKit/UIKit.h> - -@interface AppDelegate : UIResponder <UIApplicationDelegate> -@property (strong, nonatomic) UIWindow *window; -@end - -@implementation AppDelegate - -@synthesize window; - -- (BOOL)application:(UIApplication *)application - didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - #pragma unused (application, launchOptions) - - self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; - self.window.backgroundColor = [UIColor whiteColor]; - [self.window makeKeyAndVisible]; - self.window.rootViewController = [[UIViewController alloc] init]; - - UILabel *label = - [[UILabel alloc] initWithFrame:CGRectMake(0, 200, CGRectGetWidth(self.window.frame), 40)]; - label.text = @"Protocol Buffer Test Harness"; - label.textAlignment = NSTextAlignmentCenter; - [self.window addSubview:label]; - - return YES; -} - -@end - -int main(int argc, char * argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/Contents.json b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 0cbf9acc..00000000 --- a/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "size" : "57x57", - "idiom" : "iphone", - "filename" : "iPhone6.png", - "scale" : "1x" - }, - { - "size" : "57x57", - "idiom" : "iphone", - "filename" : "iPhone6_2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "iPhone7_2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "iPhone7_3x.png", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "50x50", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "50x50", - "scale" : "2x" - }, - { - "size" : "72x72", - "idiom" : "ipad", - "filename" : "iPad6.png", - "scale" : "1x" - }, - { - "size" : "72x72", - "idiom" : "ipad", - "filename" : "iPad6_2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "iPad7.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "iPad7_2x.png", - "scale" : "2x" - }, - { - "idiom" : "car", - "size" : "120x120", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPad6.png b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPad6.png Binary files differdeleted file mode 100644 index 43da2ee4..00000000 --- a/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPad6.png +++ /dev/null diff --git a/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPad6_2x.png b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPad6_2x.png Binary files differdeleted file mode 100644 index 2ec93704..00000000 --- a/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPad6_2x.png +++ /dev/null diff --git a/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPad7.png b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPad7.png Binary files differdeleted file mode 100644 index aec8bc1b..00000000 --- a/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPad7.png +++ /dev/null diff --git a/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPad7_2x.png b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPad7_2x.png Binary files differdeleted file mode 100644 index e39cc3e7..00000000 --- a/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPad7_2x.png +++ /dev/null diff --git a/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPhone6.png b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPhone6.png Binary files differdeleted file mode 100644 index 5572d79f..00000000 --- a/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPhone6.png +++ /dev/null diff --git a/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPhone6_2x.png b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPhone6_2x.png Binary files differdeleted file mode 100644 index 2424997f..00000000 --- a/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPhone6_2x.png +++ /dev/null diff --git a/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPhone7_2x.png b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPhone7_2x.png Binary files differdeleted file mode 100644 index 10bfc3cf..00000000 --- a/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPhone7_2x.png +++ /dev/null diff --git a/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPhone7_3x.png b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPhone7_3x.png Binary files differdeleted file mode 100644 index 8d16f14d..00000000 --- a/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/iPhone7_3x.png +++ /dev/null diff --git a/objectivec/Tests/iOSTestHarness/Images.xcassets/LaunchImage.launchimage/Contents.json b/objectivec/Tests/iOSTestHarness/Images.xcassets/LaunchImage.launchimage/Contents.json deleted file mode 100644 index 5a296668..00000000 --- a/objectivec/Tests/iOSTestHarness/Images.xcassets/LaunchImage.launchimage/Contents.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "images" : [ - { - "orientation" : "portrait", - "idiom" : "ipad", - "minimum-system-version" : "7.0", - "extent" : "full-screen", - "scale" : "2x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "minimum-system-version" : "7.0", - "extent" : "full-screen", - "scale" : "1x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "minimum-system-version" : "7.0", - "extent" : "full-screen", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "minimum-system-version" : "7.0", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "minimum-system-version" : "7.0", - "subtype" : "retina4", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "ipad", - "minimum-system-version" : "7.0", - "extent" : "full-screen", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -}
\ No newline at end of file diff --git a/objectivec/Tests/iOSTestHarness/Info.plist b/objectivec/Tests/iOSTestHarness/Info.plist deleted file mode 100644 index 24bd333d..00000000 --- a/objectivec/Tests/iOSTestHarness/Info.plist +++ /dev/null @@ -1,43 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>CFBundleDevelopmentRegion</key> - <string>en</string> - <key>CFBundleDisplayName</key> - <string>${PRODUCT_NAME}</string> - <key>CFBundleExecutable</key> - <string>${EXECUTABLE_NAME}</string> - <key>CFBundleIdentifier</key> - <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundleName</key> - <string>${PRODUCT_NAME}</string> - <key>CFBundlePackageType</key> - <string>APPL</string> - <key>CFBundleShortVersionString</key> - <string>1.0</string> - <key>CFBundleSignature</key> - <string>????</string> - <key>CFBundleVersion</key> - <string>1.0</string> - <key>LSRequiresIPhoneOS</key> - <true/> - <key>UILaunchStoryboardName</key> - <string>LaunchScreen</string> - <key>UISupportedInterfaceOrientations</key> - <array> - <string>UIInterfaceOrientationPortrait</string> - <string>UIInterfaceOrientationLandscapeLeft</string> - <string>UIInterfaceOrientationLandscapeRight</string> - </array> - <key>UISupportedInterfaceOrientations~ipad</key> - <array> - <string>UIInterfaceOrientationPortrait</string> - <string>UIInterfaceOrientationLandscapeLeft</string> - <string>UIInterfaceOrientationLandscapeRight</string> - <string>UIInterfaceOrientationPortraitUpsideDown</string> - </array> -</dict> -</plist> diff --git a/objectivec/Tests/iOSTestHarness/LaunchScreen.xib b/objectivec/Tests/iOSTestHarness/LaunchScreen.xib deleted file mode 100644 index 22204bfe..00000000 --- a/objectivec/Tests/iOSTestHarness/LaunchScreen.xib +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6254" systemVersion="13F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES"> - <dependencies> - <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6247"/> - <capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/> - </dependencies> - <objects> - <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> - <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> - <view contentMode="scaleToFill" id="iN0-l3-epB"> - <rect key="frame" x="0.0" y="0.0" width="630" height="503"/> - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> - <subviews> - <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Protocol Buffer Test Harness" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX"> - <rect key="frame" x="20" y="147" width="591" height="43"/> - <fontDescription key="fontDescription" type="boldSystem" pointSize="36"/> - <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> - <nil key="highlightedColor"/> - </label> - </subviews> - <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> - <constraints> - <constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="Kid-kn-2rF"/> - <constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/> - <constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/> - </constraints> - <nil key="simulatedStatusBarMetrics"/> - <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> - <point key="canvasLocation" x="479" y="456.5"/> - </view> - </objects> -</document> diff --git a/objectivec/Tests/iOSTestHarness/en.lproj/InfoPlist.strings b/objectivec/Tests/iOSTestHarness/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28ff..00000000 --- a/objectivec/Tests/iOSTestHarness/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/objectivec/Tests/unittest_objc.proto b/objectivec/Tests/unittest_objc.proto index e5577faf..b0eb4723 100644 --- a/objectivec/Tests/unittest_objc.proto +++ b/objectivec/Tests/unittest_objc.proto @@ -58,6 +58,27 @@ message TestRecursiveMessageWithRepeatedField { map<string, string> str_to_str = 5; } +// Message with a few types of maps to cover the different custom flows +// in the runtime. +message TestMessageOfMaps { + map<string, string> str_to_str = 1; + + map<string, int32> str_to_int = 2; + map<int32, string> int_to_str = 3; + map<int32, int32> int_to_int = 4; + + map<string, bool> str_to_bool = 5; + map<bool, string> bool_to_str = 6; + map<bool, bool> bool_to_bool = 7; + + map<int32, bool> int_to_bool = 8; + map<bool, int32> bool_to_int = 9; + + map<string, TestAllTypes> str_to_msg = 10; + map<int32, TestAllTypes> int_to_msg = 11; + map<bool, TestAllTypes> bool_to_msg = 12; +} + // Recursive message and extension to for testing autocreators at different // depths. message TestRecursiveExtension { diff --git a/objectivec/google/protobuf/Any.pbobjc.h b/objectivec/google/protobuf/Any.pbobjc.h index b17e76f0..ad261898 100644 --- a/objectivec/google/protobuf/Any.pbobjc.h +++ b/objectivec/google/protobuf/Any.pbobjc.h @@ -8,9 +8,13 @@ #endif #if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import <Protobuf/GPBProtocolBuffers.h> + #import <Protobuf/GPBDescriptor.h> + #import <Protobuf/GPBMessage.h> + #import <Protobuf/GPBRootObject.h> #else - #import "GPBProtocolBuffers.h" + #import "GPBDescriptor.h" + #import "GPBMessage.h" + #import "GPBRootObject.h" #endif #if GOOGLE_PROTOBUF_OBJC_VERSION < 30002 @@ -135,17 +139,18 @@ typedef GPB_ENUM(GPBAny_FieldNumber) { @interface GPBAny : GPBMessage /** - * A URL/resource name whose content describes the type of the - * serialized protocol buffer message. + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). * - * For URLs which use the scheme `http`, `https`, or no scheme, the - * following restrictions and interpretations apply: + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: * * * If no scheme is provided, `https` is assumed. - * * The last segment of the URL's path must represent the fully - * qualified name of the type (as in `path/google.protobuf.Duration`). - * The name should be in a canonical form (e.g., leading "." is - * not accepted). * * An HTTP GET on the URL must yield a [google.protobuf.Type][] * value in binary format, or produce an error. * * Applications are allowed to cache lookup results based on the @@ -154,6 +159,10 @@ typedef GPB_ENUM(GPBAny_FieldNumber) { * on changes to types. (Use versioned type names to manage * breaking changes.) * + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * * Schemes other than `http`, `https` (or the empty scheme) might be * used with implementation specific semantics. **/ diff --git a/objectivec/google/protobuf/Api.pbobjc.h b/objectivec/google/protobuf/Api.pbobjc.h index 095fc2cd..c93f3f15 100644 --- a/objectivec/google/protobuf/Api.pbobjc.h +++ b/objectivec/google/protobuf/Api.pbobjc.h @@ -8,9 +8,13 @@ #endif #if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import <Protobuf/GPBProtocolBuffers.h> + #import <Protobuf/GPBDescriptor.h> + #import <Protobuf/GPBMessage.h> + #import <Protobuf/GPBRootObject.h> #else - #import "GPBProtocolBuffers.h" + #import "GPBDescriptor.h" + #import "GPBMessage.h" + #import "GPBRootObject.h" #endif #if GOOGLE_PROTOBUF_OBJC_VERSION < 30002 diff --git a/objectivec/google/protobuf/Duration.pbobjc.h b/objectivec/google/protobuf/Duration.pbobjc.h index d9a388ac..3e367590 100644 --- a/objectivec/google/protobuf/Duration.pbobjc.h +++ b/objectivec/google/protobuf/Duration.pbobjc.h @@ -8,9 +8,13 @@ #endif #if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import <Protobuf/GPBProtocolBuffers.h> + #import <Protobuf/GPBDescriptor.h> + #import <Protobuf/GPBMessage.h> + #import <Protobuf/GPBRootObject.h> #else - #import "GPBProtocolBuffers.h" + #import "GPBDescriptor.h" + #import "GPBMessage.h" + #import "GPBRootObject.h" #endif #if GOOGLE_PROTOBUF_OBJC_VERSION < 30002 diff --git a/objectivec/google/protobuf/Empty.pbobjc.h b/objectivec/google/protobuf/Empty.pbobjc.h index bd49cfdb..fdc247ae 100644 --- a/objectivec/google/protobuf/Empty.pbobjc.h +++ b/objectivec/google/protobuf/Empty.pbobjc.h @@ -8,9 +8,13 @@ #endif #if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import <Protobuf/GPBProtocolBuffers.h> + #import <Protobuf/GPBDescriptor.h> + #import <Protobuf/GPBMessage.h> + #import <Protobuf/GPBRootObject.h> #else - #import "GPBProtocolBuffers.h" + #import "GPBDescriptor.h" + #import "GPBMessage.h" + #import "GPBRootObject.h" #endif #if GOOGLE_PROTOBUF_OBJC_VERSION < 30002 diff --git a/objectivec/google/protobuf/FieldMask.pbobjc.h b/objectivec/google/protobuf/FieldMask.pbobjc.h index 75cf856c..73296d57 100644 --- a/objectivec/google/protobuf/FieldMask.pbobjc.h +++ b/objectivec/google/protobuf/FieldMask.pbobjc.h @@ -8,9 +8,13 @@ #endif #if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import <Protobuf/GPBProtocolBuffers.h> + #import <Protobuf/GPBDescriptor.h> + #import <Protobuf/GPBMessage.h> + #import <Protobuf/GPBRootObject.h> #else - #import "GPBProtocolBuffers.h" + #import "GPBDescriptor.h" + #import "GPBMessage.h" + #import "GPBRootObject.h" #endif #if GOOGLE_PROTOBUF_OBJC_VERSION < 30002 @@ -255,8 +259,8 @@ typedef GPB_ENUM(GPBFieldMask_FieldNumber) { * * ## Field Mask Verification * - * The implementation of the all the API methods, which have any FieldMask type - * field in the request, should verify the included field paths, and return + * The implementation of any API method which has a FieldMask type field in the + * request should verify the included field paths, and return an * `INVALID_ARGUMENT` error if any path is duplicated or unmappable. **/ @interface GPBFieldMask : GPBMessage diff --git a/objectivec/google/protobuf/SourceContext.pbobjc.h b/objectivec/google/protobuf/SourceContext.pbobjc.h index 799d190a..e4923959 100644 --- a/objectivec/google/protobuf/SourceContext.pbobjc.h +++ b/objectivec/google/protobuf/SourceContext.pbobjc.h @@ -8,9 +8,13 @@ #endif #if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import <Protobuf/GPBProtocolBuffers.h> + #import <Protobuf/GPBDescriptor.h> + #import <Protobuf/GPBMessage.h> + #import <Protobuf/GPBRootObject.h> #else - #import "GPBProtocolBuffers.h" + #import "GPBDescriptor.h" + #import "GPBMessage.h" + #import "GPBRootObject.h" #endif #if GOOGLE_PROTOBUF_OBJC_VERSION < 30002 diff --git a/objectivec/google/protobuf/Struct.pbobjc.h b/objectivec/google/protobuf/Struct.pbobjc.h index 3fc80caa..fb204251 100644 --- a/objectivec/google/protobuf/Struct.pbobjc.h +++ b/objectivec/google/protobuf/Struct.pbobjc.h @@ -8,9 +8,13 @@ #endif #if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import <Protobuf/GPBProtocolBuffers.h> + #import <Protobuf/GPBDescriptor.h> + #import <Protobuf/GPBMessage.h> + #import <Protobuf/GPBRootObject.h> #else - #import "GPBProtocolBuffers.h" + #import "GPBDescriptor.h" + #import "GPBMessage.h" + #import "GPBRootObject.h" #endif #if GOOGLE_PROTOBUF_OBJC_VERSION < 30002 diff --git a/objectivec/google/protobuf/Struct.pbobjc.m b/objectivec/google/protobuf/Struct.pbobjc.m index f36ec582..816fd6df 100644 --- a/objectivec/google/protobuf/Struct.pbobjc.m +++ b/objectivec/google/protobuf/Struct.pbobjc.m @@ -13,6 +13,8 @@ #import "GPBProtocolBuffers_RuntimeSupport.h" #endif +#import <stdatomic.h> + #if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS #import <Protobuf/Struct.pbobjc.h> #else @@ -51,7 +53,7 @@ static GPBFileDescriptor *GPBStructRoot_FileDescriptor(void) { #pragma mark - Enum GPBNullValue GPBEnumDescriptor *GPBNullValue_EnumDescriptor(void) { - static GPBEnumDescriptor *descriptor = NULL; + static _Atomic(GPBEnumDescriptor*) descriptor = nil; if (!descriptor) { static const char *valueNames = "NullValue\000"; @@ -64,7 +66,8 @@ GPBEnumDescriptor *GPBNullValue_EnumDescriptor(void) { values:values count:(uint32_t)(sizeof(values) / sizeof(int32_t)) enumVerifier:GPBNullValue_IsValidValue]; - if (!OSAtomicCompareAndSwapPtrBarrier(nil, worker, (void * volatile *)&descriptor)) { + GPBEnumDescriptor *expected = nil; + if (!atomic_compare_exchange_strong(&descriptor, &expected, worker)) { [worker release]; } } diff --git a/objectivec/google/protobuf/Timestamp.pbobjc.h b/objectivec/google/protobuf/Timestamp.pbobjc.h index 0b670c35..2c4b8b20 100644 --- a/objectivec/google/protobuf/Timestamp.pbobjc.h +++ b/objectivec/google/protobuf/Timestamp.pbobjc.h @@ -8,9 +8,13 @@ #endif #if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import <Protobuf/GPBProtocolBuffers.h> + #import <Protobuf/GPBDescriptor.h> + #import <Protobuf/GPBMessage.h> + #import <Protobuf/GPBRootObject.h> #else - #import "GPBProtocolBuffers.h" + #import "GPBDescriptor.h" + #import "GPBMessage.h" + #import "GPBRootObject.h" #endif #if GOOGLE_PROTOBUF_OBJC_VERSION < 30002 @@ -115,7 +119,9 @@ typedef GPB_ENUM(GPBTimestamp_FieldNumber) { * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required, though only UTC (as indicated by "Z") is presently supported. + * is required. A proto3 JSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a proto3 JSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). * * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past * 01:30 UTC on January 15, 2017. @@ -126,8 +132,8 @@ typedef GPB_ENUM(GPBTimestamp_FieldNumber) { * to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) * with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one * can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( - * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--) - * to obtain a formatter capable of generating timestamps in this format. + * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime-- + * ) to obtain a formatter capable of generating timestamps in this format. **/ @interface GPBTimestamp : GPBMessage diff --git a/objectivec/google/protobuf/Type.pbobjc.h b/objectivec/google/protobuf/Type.pbobjc.h index 17986970..e14d15df 100644 --- a/objectivec/google/protobuf/Type.pbobjc.h +++ b/objectivec/google/protobuf/Type.pbobjc.h @@ -8,9 +8,13 @@ #endif #if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import <Protobuf/GPBProtocolBuffers.h> + #import <Protobuf/GPBDescriptor.h> + #import <Protobuf/GPBMessage.h> + #import <Protobuf/GPBRootObject.h> #else - #import "GPBProtocolBuffers.h" + #import "GPBDescriptor.h" + #import "GPBMessage.h" + #import "GPBRootObject.h" #endif #if GOOGLE_PROTOBUF_OBJC_VERSION < 30002 diff --git a/objectivec/google/protobuf/Type.pbobjc.m b/objectivec/google/protobuf/Type.pbobjc.m index 7a949388..bb64d876 100644 --- a/objectivec/google/protobuf/Type.pbobjc.m +++ b/objectivec/google/protobuf/Type.pbobjc.m @@ -13,6 +13,8 @@ #import "GPBProtocolBuffers_RuntimeSupport.h" #endif +#import <stdatomic.h> + #if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS #import <Protobuf/Type.pbobjc.h> #import <Protobuf/Any.pbobjc.h> @@ -54,7 +56,7 @@ static GPBFileDescriptor *GPBTypeRoot_FileDescriptor(void) { #pragma mark - Enum GPBSyntax GPBEnumDescriptor *GPBSyntax_EnumDescriptor(void) { - static GPBEnumDescriptor *descriptor = NULL; + static _Atomic(GPBEnumDescriptor*) descriptor = nil; if (!descriptor) { static const char *valueNames = "SyntaxProto2\000SyntaxProto3\000"; @@ -68,7 +70,8 @@ GPBEnumDescriptor *GPBSyntax_EnumDescriptor(void) { values:values count:(uint32_t)(sizeof(values) / sizeof(int32_t)) enumVerifier:GPBSyntax_IsValidValue]; - if (!OSAtomicCompareAndSwapPtrBarrier(nil, worker, (void * volatile *)&descriptor)) { + GPBEnumDescriptor *expected = nil; + if (!atomic_compare_exchange_strong(&descriptor, &expected, worker)) { [worker release]; } } @@ -368,7 +371,7 @@ void SetGPBField_Cardinality_RawValue(GPBField *message, int32_t value) { #pragma mark - Enum GPBField_Kind GPBEnumDescriptor *GPBField_Kind_EnumDescriptor(void) { - static GPBEnumDescriptor *descriptor = NULL; + static _Atomic(GPBEnumDescriptor*) descriptor = nil; if (!descriptor) { static const char *valueNames = "TypeUnknown\000TypeDouble\000TypeFloat\000TypeInt" @@ -404,7 +407,8 @@ GPBEnumDescriptor *GPBField_Kind_EnumDescriptor(void) { values:values count:(uint32_t)(sizeof(values) / sizeof(int32_t)) enumVerifier:GPBField_Kind_IsValidValue]; - if (!OSAtomicCompareAndSwapPtrBarrier(nil, worker, (void * volatile *)&descriptor)) { + GPBEnumDescriptor *expected = nil; + if (!atomic_compare_exchange_strong(&descriptor, &expected, worker)) { [worker release]; } } @@ -441,7 +445,7 @@ BOOL GPBField_Kind_IsValidValue(int32_t value__) { #pragma mark - Enum GPBField_Cardinality GPBEnumDescriptor *GPBField_Cardinality_EnumDescriptor(void) { - static GPBEnumDescriptor *descriptor = NULL; + static _Atomic(GPBEnumDescriptor*) descriptor = nil; if (!descriptor) { static const char *valueNames = "CardinalityUnknown\000CardinalityOptional\000C" @@ -458,7 +462,8 @@ GPBEnumDescriptor *GPBField_Cardinality_EnumDescriptor(void) { values:values count:(uint32_t)(sizeof(values) / sizeof(int32_t)) enumVerifier:GPBField_Cardinality_IsValidValue]; - if (!OSAtomicCompareAndSwapPtrBarrier(nil, worker, (void * volatile *)&descriptor)) { + GPBEnumDescriptor *expected = nil; + if (!atomic_compare_exchange_strong(&descriptor, &expected, worker)) { [worker release]; } } diff --git a/objectivec/google/protobuf/Wrappers.pbobjc.h b/objectivec/google/protobuf/Wrappers.pbobjc.h index 3cb9fe77..0411e1ec 100644 --- a/objectivec/google/protobuf/Wrappers.pbobjc.h +++ b/objectivec/google/protobuf/Wrappers.pbobjc.h @@ -8,9 +8,13 @@ #endif #if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import <Protobuf/GPBProtocolBuffers.h> + #import <Protobuf/GPBDescriptor.h> + #import <Protobuf/GPBMessage.h> + #import <Protobuf/GPBRootObject.h> #else - #import "GPBProtocolBuffers.h" + #import "GPBDescriptor.h" + #import "GPBMessage.h" + #import "GPBRootObject.h" #endif #if GOOGLE_PROTOBUF_OBJC_VERSION < 30002 |