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

@@ -29,9 +29,9 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#import "GPBTestUtilities.h"
#import "objectivec/Tests/Unittest.pbobjc.h"
#import "objectivec/Tests/UnittestImport.pbobjc.h"
#import "objectivec/Tests/UnittestObjc.pbobjc.h"
#import "google/protobuf/Unittest.pbobjc.h"
#import "google/protobuf/UnittestImport.pbobjc.h"
#import "google/protobuf/UnittestObjc.pbobjc.h"
//
// This file really just uses the unittests framework as a testbed to
@@ -69,9 +69,9 @@ static const uint32_t kRepeatedCount = 100;
// lock across threads when parsing different instances. The Serial version of the test should run
// around ~2 times slower than the Parallel version since it's parsing the protos in the same
// thread.
TestAllTypes* allTypesMessage = [TestAllTypes message];
TestAllTypes *allTypesMessage = [TestAllTypes message];
[self setAllFields:allTypesMessage repeatedCount:2];
NSData* allTypesData = allTypesMessage.data;
NSData *allTypesData = allTypesMessage.data;
[self measureBlock:^{
for (int i = 0; i < 500; ++i) {
@@ -86,9 +86,9 @@ static const uint32_t kRepeatedCount = 100;
// not lock across threads when parsing different instances. The Serial version of the test should
// run around ~2 times slower than the Parallel version since it's parsing the protos in the same
// thread.
TestAllTypes* allTypesMessage = [TestAllTypes message];
TestAllTypes *allTypesMessage = [TestAllTypes message];
[self setAllFields:allTypesMessage repeatedCount:2];
NSData* allTypesData = allTypesMessage.data;
NSData *allTypesData = allTypesMessage.data;
dispatch_queue_t concurrentQueue = dispatch_queue_create("perfQueue", DISPATCH_QUEUE_CONCURRENT);
@@ -104,9 +104,7 @@ static const uint32_t kRepeatedCount = 100;
[TestAllTypes parseFromData:allTypesData error:NULL];
});
dispatch_group_notify(group, concurrentQueue,
^{
});
dispatch_group_notify(group, concurrentQueue, ^{});
dispatch_release(group);
}
@@ -120,9 +118,9 @@ static const uint32_t kRepeatedCount = 100;
// lock across threads when parsing different instances when using extensions. The Serial version
// of the test should run around ~2 times slower than the Parallel version since it's parsing the
// protos in the same thread.
TestAllExtensions* allExtensionsMessage = [TestAllExtensions message];
TestAllExtensions *allExtensionsMessage = [TestAllExtensions message];
[self setAllExtensions:allExtensionsMessage repeatedCount:2];
NSData* allExtensionsData = allExtensionsMessage.data;
NSData *allExtensionsData = allExtensionsMessage.data;
[self measureBlock:^{
for (int i = 0; i < 500; ++i) {
@@ -141,9 +139,9 @@ static const uint32_t kRepeatedCount = 100;
// not lock across threads when parsing different instances when using extensions. The Serial
// version of the test should run around ~2 times slower than the Parallel version since it's
// parsing the protos in the same thread.
TestAllExtensions* allExtensionsMessage = [TestAllExtensions message];
TestAllExtensions *allExtensionsMessage = [TestAllExtensions message];
[self setAllExtensions:allExtensionsMessage repeatedCount:2];
NSData* allExtensionsData = allExtensionsMessage.data;
NSData *allExtensionsData = allExtensionsMessage.data;
dispatch_queue_t concurrentQueue = dispatch_queue_create("perfQueue", DISPATCH_QUEUE_CONCURRENT);
@@ -163,9 +161,7 @@ static const uint32_t kRepeatedCount = 100;
error:NULL];
});
dispatch_group_notify(group, concurrentQueue,
^{
});
dispatch_group_notify(group, concurrentQueue, ^{});
dispatch_release(group);
}
@@ -181,7 +177,8 @@ static const uint32_t kRepeatedCount = 100;
[self setAllExtensions:message repeatedCount:kRepeatedCount];
NSData* rawBytes = [message data];
[message release];
TestAllExtensions* message2 = [[TestAllExtensions alloc] initWithData:rawBytes error:NULL];
TestAllExtensions* message2 =
[[TestAllExtensions alloc] initWithData:rawBytes error:NULL];
[message2 release];
}
}];
@@ -207,8 +204,8 @@ static const uint32_t kRepeatedCount = 100;
[self setPackedExtensions:message repeatedCount:kRepeatedCount];
NSData* rawBytes = [message data];
[message release];
TestPackedExtensions* message2 = [[TestPackedExtensions alloc] initWithData:rawBytes
error:NULL];
TestPackedExtensions* message2 =
[[TestPackedExtensions alloc] initWithData:rawBytes error:NULL];
[message2 release];
}
}];