diff options
Diffstat (limited to 'objectivec')
42 files changed, 792 insertions, 5078 deletions
diff --git a/objectivec/DevTools/full_mac_build.sh b/objectivec/DevTools/full_mac_build.sh index a825789f..7e1e9a05 100755 --- a/objectivec/DevTools/full_mac_build.sh +++ b/objectivec/DevTools/full_mac_build.sh @@ -253,36 +253,20 @@ 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* ) - 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 - ) - ;; - 8.3* ) + 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=latest" # 64bit ) ;; - 9.0* ) + 9.[0-1]* ) 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.1 both seem to often fail running destinations in parallel + -disable-concurrent-testing ) ;; * ) @@ -299,7 +283,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/GPBCodedOutputStream.m b/objectivec/GPBCodedOutputStream.m index c299040f..f832e8a6 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; } 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..aa21670a 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]; } diff --git a/objectivec/GPBMessage.m b/objectivec/GPBMessage.m index 37cff6ce..90485bd1 100644 --- a/objectivec/GPBMessage.m +++ b/objectivec/GPBMessage.m @@ -2591,13 +2591,14 @@ static void MergeRepeatedNotPackedFieldFromCodedInputStream( if (other == self) { return YES; } - if (![other isKindOfClass:[self class]] && - ![self isKindOfClass:[other class]]) { + if (![other isKindOfClass:[GPBMessage class]]) { return NO; } - GPBMessage *otherMsg = other; GPBDescriptor *descriptor = [[self class] descriptor]; + if ([[otherMsg class] descriptor] != descriptor) { + return NO; + } uint8_t *selfStorage = (uint8_t *)messageStorage_; uint8_t *otherStorage = (uint8_t *)otherMsg->messageStorage_; @@ -2997,7 +2998,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) { @@ -3039,7 +3043,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); @@ -3083,9 +3088,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. 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..77ea9577 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; @@ -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 @@ -618,6 +665,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 +692,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 +724,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 +756,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 +789,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 +819,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 +857,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 +887,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 +925,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 +955,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 +993,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 +1023,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 +1061,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 +1091,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 +1129,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 +1159,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 +1202,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 +1217,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 +1234,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 +1249,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 +1266,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 +1281,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 +1298,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 +1313,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 +1384,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 +1445,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 +1463,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 +1494,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 +2192,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..c8b21ed7 100644 --- a/objectivec/GPBUtilities_PackagePrivate.h +++ b/objectivec/GPBUtilities_PackagePrivate.h @@ -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_iOS.xcodeproj/project.pbxproj b/objectivec/ProtocolBuffers_iOS.xcodeproj/project.pbxproj index 1f1172b2..9333ea7d 100644 --- a/objectivec/ProtocolBuffers_iOS.xcodeproj/project.pbxproj +++ b/objectivec/ProtocolBuffers_iOS.xcodeproj/project.pbxproj @@ -880,7 +880,6 @@ buildSettings = { CLANG_ENABLE_MODULES = YES; FRAMEWORK_SEARCH_PATHS = ( - "\"$(SDKROOT)/Developer/Library/Frameworks\"", "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", "$(inherited)", ); @@ -916,7 +915,6 @@ buildSettings = { CLANG_ENABLE_MODULES = YES; FRAMEWORK_SEARCH_PATHS = ( - "\"$(SDKROOT)/Developer/Library/Frameworks\"", "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", "$(inherited)", ); diff --git a/objectivec/Tests/GPBCodedInputStreamTests.m b/objectivec/Tests/GPBCodedInputStreamTests.m index d8e128f7..11f7ceaf 100644 --- a/objectivec/Tests/GPBCodedInputStreamTests.m +++ b/objectivec/Tests/GPBCodedInputStreamTests.m @@ -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/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..4d75f1e1 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); diff --git a/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/Contents.json b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/Contents.json index 0cbf9acc..9f4a9e59 100644 --- a/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/Contents.json @@ -1,72 +1,103 @@ { "images" : [ { + "size" : "20x20", "idiom" : "iphone", + "filename" : "appicon_40.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "appicon_60.png", + "scale" : "3x" + }, + { "size" : "29x29", + "idiom" : "iphone", + "filename" : "appicon_29.png", "scale" : "1x" }, { - "idiom" : "iphone", "size" : "29x29", + "idiom" : "iphone", + "filename" : "appicon_58.png", "scale" : "2x" }, { - "idiom" : "iphone", "size" : "29x29", + "idiom" : "iphone", + "filename" : "appicon_87.png", "scale" : "3x" }, { - "idiom" : "iphone", "size" : "40x40", + "idiom" : "iphone", + "filename" : "appicon_80.png", "scale" : "2x" }, { - "idiom" : "iphone", "size" : "40x40", + "idiom" : "iphone", + "filename" : "appicon_120.png", "scale" : "3x" }, { - "size" : "57x57", "idiom" : "iphone", - "filename" : "iPhone6.png", + "size" : "57x57", "scale" : "1x" }, { - "size" : "57x57", "idiom" : "iphone", - "filename" : "iPhone6_2x.png", + "size" : "57x57", "scale" : "2x" }, { "size" : "60x60", "idiom" : "iphone", - "filename" : "iPhone7_2x.png", + "filename" : "appicon_120.png", "scale" : "2x" }, { "size" : "60x60", "idiom" : "iphone", - "filename" : "iPhone7_3x.png", + "filename" : "appicon_180.png", "scale" : "3x" }, { + "size" : "20x20", "idiom" : "ipad", - "size" : "29x29", + "filename" : "appicon_20.png", "scale" : "1x" }, { + "size" : "20x20", "idiom" : "ipad", - "size" : "29x29", + "filename" : "appicon_40.png", "scale" : "2x" }, { + "size" : "29x29", "idiom" : "ipad", - "size" : "40x40", + "filename" : "appicon_29.png", "scale" : "1x" }, { + "size" : "29x29", "idiom" : "ipad", + "filename" : "appicon_58.png", + "scale" : "2x" + }, + { "size" : "40x40", + "idiom" : "ipad", + "filename" : "appicon_40.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "appicon_80.png", "scale" : "2x" }, { @@ -80,32 +111,37 @@ "scale" : "2x" }, { - "size" : "72x72", "idiom" : "ipad", - "filename" : "iPad6.png", + "size" : "72x72", "scale" : "1x" }, { - "size" : "72x72", "idiom" : "ipad", - "filename" : "iPad6_2x.png", + "size" : "72x72", "scale" : "2x" }, { "size" : "76x76", "idiom" : "ipad", - "filename" : "iPad7.png", + "filename" : "appicon_76.png", "scale" : "1x" }, { "size" : "76x76", "idiom" : "ipad", - "filename" : "iPad7_2x.png", + "filename" : "appicon_152.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "appicon_167.png", "scale" : "2x" }, { - "idiom" : "car", - "size" : "120x120", + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "appicon_1024.png", "scale" : "1x" } ], @@ -113,4 +149,4 @@ "version" : 1, "author" : "xcode" } -} +}
\ No newline at end of file diff --git a/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_1024.png b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_1024.png Binary files differnew file mode 100644 index 00000000..6b6a102e --- /dev/null +++ b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_1024.png diff --git a/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_120.png b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_120.png Binary files differnew file mode 100644 index 00000000..1bac2e58 --- /dev/null +++ b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_120.png diff --git a/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_152.png b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_152.png Binary files differnew file mode 100644 index 00000000..80f13301 --- /dev/null +++ b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_152.png diff --git a/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_167.png b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_167.png Binary files differnew file mode 100644 index 00000000..99f0745e --- /dev/null +++ b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_167.png diff --git a/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_180.png b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_180.png Binary files differnew file mode 100644 index 00000000..ae123712 --- /dev/null +++ b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_180.png diff --git a/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_20.png b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_20.png Binary files differnew file mode 100644 index 00000000..8e530c49 --- /dev/null +++ b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_20.png diff --git a/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_29.png b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_29.png Binary files differnew file mode 100644 index 00000000..1826feb9 --- /dev/null +++ b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_29.png diff --git a/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_40.png b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_40.png Binary files differnew file mode 100644 index 00000000..f2e2ded1 --- /dev/null +++ b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_40.png diff --git a/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_58.png b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_58.png Binary files differnew file mode 100644 index 00000000..0ec6d003 --- /dev/null +++ b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_58.png diff --git a/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_60.png b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_60.png Binary files differnew file mode 100644 index 00000000..8664e8b0 --- /dev/null +++ b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_60.png diff --git a/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_76.png b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_76.png Binary files differnew file mode 100644 index 00000000..d4bb05b9 --- /dev/null +++ b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_76.png diff --git a/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_80.png b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_80.png Binary files differnew file mode 100644 index 00000000..8fa6a8e7 --- /dev/null +++ b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_80.png diff --git a/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_87.png b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_87.png Binary files differnew file mode 100644 index 00000000..b41bc67b --- /dev/null +++ b/objectivec/Tests/iOSTestHarness/Images.xcassets/AppIcon.appiconset/appicon_87.png 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 index 5a296668..a0ad363c 100644 --- a/objectivec/Tests/iOSTestHarness/Images.xcassets/LaunchImage.launchimage/Contents.json +++ b/objectivec/Tests/iOSTestHarness/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -3,43 +3,30 @@ { "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" + "scale" : "1x" }, { "orientation" : "portrait", - "idiom" : "iphone", + "idiom" : "ipad", + "extent" : "full-screen", "minimum-system-version" : "7.0", - "subtype" : "retina4", "scale" : "2x" }, { - "orientation" : "portrait", + "orientation" : "landscape", "idiom" : "ipad", - "minimum-system-version" : "7.0", "extent" : "full-screen", - "scale" : "1x" + "minimum-system-version" : "7.0", + "scale" : "2x" } ], "info" : { |