ADD: added new version of protobuf

This commit is contained in:
Henry Winkel
2022-12-20 10:09:28 +01:00
parent 4a79559129
commit 1e2b3dda7b
1513 changed files with 123720 additions and 83381 deletions

View File

@@ -34,10 +34,7 @@
#import "GPBDictionary.h"
#import "GPBTestUtilities.h"
#import "objectivec/Tests/UnittestRuntimeProto2.pbobjc.h"
// Disable clang-format for the macros.
// clang-format off
#import "google/protobuf/UnittestRuntimeProto2.pbobjc.h"
// Pull in the macros (using an external file because expanding all tests
// in a single file makes a file that is failing to work with within Xcode.
@@ -45,6 +42,7 @@
//%PDDM-EXPAND TEST_FOR_POD_KEY(UInt64, uint64_t, 31ULL, 32ULL, 33ULL, 34ULL)
// This block of code is generated, do not edit it directly.
// clang-format off
// To let the testing macros work, add some extra methods to simplify things.
@interface GPBUInt64EnumDictionary (TestingTweak)
@@ -89,7 +87,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 0U);
XCTAssertFalse([dict getUInt32:NULL forKey:31ULL]);
[dict enumerateKeysAndUInt32sUsingBlock:^(__unused uint64_t aKey, __unused uint32_t aValue, __unused BOOL *stop) {
[dict enumerateKeysAndUInt32sUsingBlock:^(uint64_t aKey, uint32_t aValue, BOOL *stop) {
#pragma unused(aKey, aValue, stop)
XCTFail(@"Shouldn't get here!");
}];
[dict release];
@@ -159,7 +158,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Stopping the enumeration.
idx = 0;
[dict enumerateKeysAndUInt32sUsingBlock:^(__unused uint64_t aKey, __unused uint32_t aValue, BOOL *stop) {
[dict enumerateKeysAndUInt32sUsingBlock:^(uint64_t aKey, uint32_t aValue, BOOL *stop) {
#pragma unused(aKey, aValue)
if (idx == 1) *stop = YES;
XCTAssertNotEqual(idx, 2U);
++idx;
@@ -448,7 +448,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 0U);
XCTAssertFalse([dict getInt32:NULL forKey:31ULL]);
[dict enumerateKeysAndInt32sUsingBlock:^(__unused uint64_t aKey, __unused int32_t aValue, __unused BOOL *stop) {
[dict enumerateKeysAndInt32sUsingBlock:^(uint64_t aKey, int32_t aValue, BOOL *stop) {
#pragma unused(aKey, aValue, stop)
XCTFail(@"Shouldn't get here!");
}];
[dict release];
@@ -518,7 +519,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Stopping the enumeration.
idx = 0;
[dict enumerateKeysAndInt32sUsingBlock:^(__unused uint64_t aKey, __unused int32_t aValue, BOOL *stop) {
[dict enumerateKeysAndInt32sUsingBlock:^(uint64_t aKey, int32_t aValue, BOOL *stop) {
#pragma unused(aKey, aValue)
if (idx == 1) *stop = YES;
XCTAssertNotEqual(idx, 2U);
++idx;
@@ -807,7 +809,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 0U);
XCTAssertFalse([dict getUInt64:NULL forKey:31ULL]);
[dict enumerateKeysAndUInt64sUsingBlock:^(__unused uint64_t aKey, __unused uint64_t aValue, __unused BOOL *stop) {
[dict enumerateKeysAndUInt64sUsingBlock:^(uint64_t aKey, uint64_t aValue, BOOL *stop) {
#pragma unused(aKey, aValue, stop)
XCTFail(@"Shouldn't get here!");
}];
[dict release];
@@ -877,7 +880,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Stopping the enumeration.
idx = 0;
[dict enumerateKeysAndUInt64sUsingBlock:^(__unused uint64_t aKey, __unused uint64_t aValue, BOOL *stop) {
[dict enumerateKeysAndUInt64sUsingBlock:^(uint64_t aKey, uint64_t aValue, BOOL *stop) {
#pragma unused(aKey, aValue)
if (idx == 1) *stop = YES;
XCTAssertNotEqual(idx, 2U);
++idx;
@@ -1166,7 +1170,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 0U);
XCTAssertFalse([dict getInt64:NULL forKey:31ULL]);
[dict enumerateKeysAndInt64sUsingBlock:^(__unused uint64_t aKey, __unused int64_t aValue, __unused BOOL *stop) {
[dict enumerateKeysAndInt64sUsingBlock:^(uint64_t aKey, int64_t aValue, BOOL *stop) {
#pragma unused(aKey, aValue, stop)
XCTFail(@"Shouldn't get here!");
}];
[dict release];
@@ -1236,7 +1241,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Stopping the enumeration.
idx = 0;
[dict enumerateKeysAndInt64sUsingBlock:^(__unused uint64_t aKey, __unused int64_t aValue, BOOL *stop) {
[dict enumerateKeysAndInt64sUsingBlock:^(uint64_t aKey, int64_t aValue, BOOL *stop) {
#pragma unused(aKey, aValue)
if (idx == 1) *stop = YES;
XCTAssertNotEqual(idx, 2U);
++idx;
@@ -1525,7 +1531,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 0U);
XCTAssertFalse([dict getBool:NULL forKey:31ULL]);
[dict enumerateKeysAndBoolsUsingBlock:^(__unused uint64_t aKey, __unused BOOL aValue, __unused BOOL *stop) {
[dict enumerateKeysAndBoolsUsingBlock:^(uint64_t aKey, BOOL aValue, BOOL *stop) {
#pragma unused(aKey, aValue, stop)
XCTFail(@"Shouldn't get here!");
}];
[dict release];
@@ -1595,7 +1602,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Stopping the enumeration.
idx = 0;
[dict enumerateKeysAndBoolsUsingBlock:^(__unused uint64_t aKey, __unused BOOL aValue, BOOL *stop) {
[dict enumerateKeysAndBoolsUsingBlock:^(uint64_t aKey, BOOL aValue, BOOL *stop) {
#pragma unused(aKey, aValue)
if (idx == 1) *stop = YES;
XCTAssertNotEqual(idx, 2U);
++idx;
@@ -1884,7 +1892,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 0U);
XCTAssertFalse([dict getFloat:NULL forKey:31ULL]);
[dict enumerateKeysAndFloatsUsingBlock:^(__unused uint64_t aKey, __unused float aValue, __unused BOOL *stop) {
[dict enumerateKeysAndFloatsUsingBlock:^(uint64_t aKey, float aValue, BOOL *stop) {
#pragma unused(aKey, aValue, stop)
XCTFail(@"Shouldn't get here!");
}];
[dict release];
@@ -1954,7 +1963,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Stopping the enumeration.
idx = 0;
[dict enumerateKeysAndFloatsUsingBlock:^(__unused uint64_t aKey, __unused float aValue, BOOL *stop) {
[dict enumerateKeysAndFloatsUsingBlock:^(uint64_t aKey, float aValue, BOOL *stop) {
#pragma unused(aKey, aValue)
if (idx == 1) *stop = YES;
XCTAssertNotEqual(idx, 2U);
++idx;
@@ -2243,7 +2253,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 0U);
XCTAssertFalse([dict getDouble:NULL forKey:31ULL]);
[dict enumerateKeysAndDoublesUsingBlock:^(__unused uint64_t aKey, __unused double aValue, __unused BOOL *stop) {
[dict enumerateKeysAndDoublesUsingBlock:^(uint64_t aKey, double aValue, BOOL *stop) {
#pragma unused(aKey, aValue, stop)
XCTFail(@"Shouldn't get here!");
}];
[dict release];
@@ -2313,7 +2324,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Stopping the enumeration.
idx = 0;
[dict enumerateKeysAndDoublesUsingBlock:^(__unused uint64_t aKey, __unused double aValue, BOOL *stop) {
[dict enumerateKeysAndDoublesUsingBlock:^(uint64_t aKey, double aValue, BOOL *stop) {
#pragma unused(aKey, aValue)
if (idx == 1) *stop = YES;
XCTAssertNotEqual(idx, 2U);
++idx;
@@ -2602,7 +2614,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 0U);
XCTAssertFalse([dict getEnum:NULL forKey:31ULL]);
[dict enumerateKeysAndEnumsUsingBlock:^(__unused uint64_t aKey, __unused int32_t aValue, __unused BOOL *stop) {
[dict enumerateKeysAndEnumsUsingBlock:^(uint64_t aKey, int32_t aValue, BOOL *stop) {
#pragma unused(aKey, aValue, stop)
XCTFail(@"Shouldn't get here!");
}];
[dict release];
@@ -2672,7 +2685,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Stopping the enumeration.
idx = 0;
[dict enumerateKeysAndEnumsUsingBlock:^(__unused uint64_t aKey, __unused int32_t aValue, BOOL *stop) {
[dict enumerateKeysAndEnumsUsingBlock:^(uint64_t aKey, int32_t aValue, BOOL *stop) {
#pragma unused(aKey, aValue)
if (idx == 1) *stop = YES;
XCTAssertNotEqual(idx, 2U);
++idx;
@@ -3029,7 +3043,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Stopping the enumeration.
idx = 0;
[dict enumerateKeysAndRawValuesUsingBlock:^(__unused uint64_t aKey, __unused int32_t aValue, BOOL *stop) {
[dict enumerateKeysAndRawValuesUsingBlock:^(uint64_t aKey, int32_t aValue, BOOL *stop) {
#pragma unused(aKey, aValue)
if (idx == 1) *stop = YES;
XCTAssertNotEqual(idx, 2U);
++idx;
@@ -3378,7 +3393,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 0U);
XCTAssertNil([dict objectForKey:31ULL]);
[dict enumerateKeysAndObjectsUsingBlock:^(__unused uint64_t aKey, __unused NSString* aObject, __unused BOOL *stop) {
[dict enumerateKeysAndObjectsUsingBlock:^(uint64_t aKey, NSString* aObject, BOOL *stop) {
#pragma unused(aKey, aObject, stop)
XCTFail(@"Shouldn't get here!");
}];
[dict release];
@@ -3438,7 +3454,8 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Stopping the enumeration.
idx = 0;
[dict enumerateKeysAndObjectsUsingBlock:^(__unused uint64_t aKey, __unused NSString* aObject, BOOL *stop) {
[dict enumerateKeysAndObjectsUsingBlock:^(uint64_t aKey, NSString* aObject, BOOL *stop) {
#pragma unused(aKey, aObject)
if (idx == 1) *stop = YES;
XCTAssertNotEqual(idx, 2U);
++idx;
@@ -3656,4 +3673,5 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
@end
// clang-format on
//%PDDM-EXPAND-END TEST_FOR_POD_KEY(UInt64, uint64_t, 31ULL, 32ULL, 33ULL, 34ULL)