Merge remote-tracking branch 'origin/master' into fix-author

This commit is contained in:
Jisi Liu 2015-10-05 13:54:05 -07:00
commit 8d8177c757
86 changed files with 4996 additions and 2089 deletions

View File

@ -95,6 +95,7 @@ csharp_EXTRA_DIST= \
csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs \
csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs \
csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs \
csharp/src/Google.Protobuf.Test/WellKnownTypes/AnyTest.cs \
csharp/src/Google.Protobuf.Test/WellKnownTypes/DurationTest.cs \
csharp/src/Google.Protobuf.Test/WellKnownTypes/TimestampTest.cs \
csharp/src/Google.Protobuf.Test/WellKnownTypes/WrappersTest.cs \
@ -149,6 +150,7 @@ csharp_EXTRA_DIST= \
csharp/src/Google.Protobuf/Reflection/ServiceDescriptor.cs \
csharp/src/Google.Protobuf/Reflection/SingleFieldAccessor.cs \
csharp/src/Google.Protobuf/WellKnownTypes/Any.cs \
csharp/src/Google.Protobuf/WellKnownTypes/AnyPartial.cs \
csharp/src/Google.Protobuf/WellKnownTypes/Api.cs \
csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs \
csharp/src/Google.Protobuf/WellKnownTypes/DurationPartial.cs \
@ -454,6 +456,7 @@ objectivec_EXTRA_DIST= \
objectivec/Tests/GPBMessageTests+Runtime.m \
objectivec/Tests/GPBMessageTests+Serialization.m \
objectivec/Tests/GPBMessageTests.m \
objectivec/Tests/GPBObjectiveCPlusPlusTest.mm \
objectivec/Tests/GPBPerfTests.m \
objectivec/Tests/GPBStringTests.m \
objectivec/Tests/GPBSwiftTests.swift \

View File

@ -5,7 +5,7 @@
# dependent projects use the :git notation to refer to the library.
Pod::Spec.new do |s|
s.name = 'Protobuf'
s.version = '3.0.0-alpha-4'
s.version = '3.0.0-alpha-4.1'
s.summary = 'Protocol Buffers v.3 runtime library for Objective-C.'
s.homepage = 'https://github.com/google/protobuf'
s.license = 'New BSD'
@ -21,7 +21,7 @@ Pod::Spec.new do |s|
'objectivec/google/protobuf/SourceContext.pbobjc.{h,m}',
'objectivec/google/protobuf/Struct.pbobjc.{h,m}',
'objectivec/google/protobuf/Timestamp.pbobjc.h',
'objectivec/google/protobuf/Type.pbobjc.{h,m}'
'objectivec/google/protobuf/Type.pbobjc.{h,m}',
'objectivec/google/protobuf/Wrappers.pbobjc.{h,m}'
# Timestamp.pbobjc.m and Duration.pbobjc.m are #imported by GPBWellKnownTypes.m. So we can't
# compile them (duplicate symbols), but we need them available for the importing:

View File

@ -14,6 +14,7 @@ set(libprotoc_files
${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc
${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_service.cc
${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_string_field.cc
${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_doc_comment.cc
${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_enum.cc
${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_enum_field.cc
${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_field_base.cc

View File

@ -35,11 +35,10 @@ if [ -z "$PROTOC" ]; then
fi
fi
# Descriptor proto
$PROTOC -Isrc --csharp_out=csharp/src/Google.Protobuf/Reflection \
src/google/protobuf/descriptor.proto
$PROTOC -Isrc --csharp_out=csharp/src/Google.Protobuf/WellKnownTypes \
# descriptor.proto and well-known types
$PROTOC -Isrc --csharp_out=csharp/src/Google.Protobuf \
--csharp_opt=base_namespace=Google.Protobuf \
src/google/protobuf/descriptor.proto \
src/google/protobuf/any.proto \
src/google/protobuf/api.proto \
src/google/protobuf/duration.proto \
@ -51,15 +50,18 @@ $PROTOC -Isrc --csharp_out=csharp/src/Google.Protobuf/WellKnownTypes \
src/google/protobuf/type.proto \
src/google/protobuf/wrappers.proto
$PROTOC -Isrc --csharp_out=csharp/src/Google.Protobuf.Test/TestProtos \
# Test protos where the namespace matches the target location
$PROTOC -Isrc --csharp_out=csharp/src/Google.Protobuf.Test \
--csharp_opt=base_namespace=Google.Protobuf \
src/google/protobuf/map_unittest_proto3.proto \
src/google/protobuf/unittest_proto3.proto \
src/google/protobuf/unittest_import_proto3.proto \
src/google/protobuf/unittest_import_public_proto3.proto \
src/google/protobuf/unittest_well_known_types.proto
$PROTOC -Icsharp/protos --csharp_out=csharp/src/Google.Protobuf.Test/TestProtos \
# Different base namespace to the protos above
$PROTOC -Icsharp/protos --csharp_out=csharp/src/Google.Protobuf.Test \
--csharp_opt=base_namespace=UnitTest.Issues \
csharp/protos/unittest_issues.proto
# AddressBook sample protos

View File

@ -9,10 +9,12 @@ using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Google.Protobuf.Examples.AddressBook {
/// <summary>Holder for reflection information generated from addressbook.proto</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class Addressbook {
#region Descriptor
/// <summary>File descriptor for addressbook.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
@ -21,14 +23,14 @@ namespace Google.Protobuf.Examples.AddressBook {
static Addressbook() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"ChFhZGRyZXNzYm9vay5wcm90bxIIdHV0b3JpYWwi1QEKBlBlcnNvbhIMCgRu",
"YW1lGAEgASgJEgoKAmlkGAIgASgFEg0KBWVtYWlsGAMgASgJEiwKBnBob25l",
"cxgEIAMoCzIcLnR1dG9yaWFsLlBlcnNvbi5QaG9uZU51bWJlchpHCgtQaG9u",
"ZU51bWJlchIOCgZudW1iZXIYASABKAkSKAoEdHlwZRgCIAEoDjIaLnR1dG9y",
"aWFsLlBlcnNvbi5QaG9uZVR5cGUiKwoJUGhvbmVUeXBlEgoKBk1PQklMRRAA",
"EggKBEhPTUUQARIICgRXT1JLEAIiLwoLQWRkcmVzc0Jvb2sSIAoGcGVvcGxl",
"GAEgAygLMhAudHV0b3JpYWwuUGVyc29uQlAKFGNvbS5leGFtcGxlLnR1dG9y",
"aWFsQhFBZGRyZXNzQm9va1Byb3Rvc6oCJEdvb2dsZS5Qcm90b2J1Zi5FeGFt",
"ChFhZGRyZXNzYm9vay5wcm90bxIIdHV0b3JpYWwi1QEKBlBlcnNvbhIMCgRu",
"YW1lGAEgASgJEgoKAmlkGAIgASgFEg0KBWVtYWlsGAMgASgJEiwKBnBob25l",
"cxgEIAMoCzIcLnR1dG9yaWFsLlBlcnNvbi5QaG9uZU51bWJlchpHCgtQaG9u",
"ZU51bWJlchIOCgZudW1iZXIYASABKAkSKAoEdHlwZRgCIAEoDjIaLnR1dG9y",
"aWFsLlBlcnNvbi5QaG9uZVR5cGUiKwoJUGhvbmVUeXBlEgoKBk1PQklMRRAA",
"EggKBEhPTUUQARIICgRXT1JLEAIiLwoLQWRkcmVzc0Jvb2sSIAoGcGVvcGxl",
"GAEgAygLMhAudHV0b3JpYWwuUGVyc29uQlAKFGNvbS5leGFtcGxlLnR1dG9y",
"aWFsQhFBZGRyZXNzQm9va1Byb3Rvc6oCJEdvb2dsZS5Qcm90b2J1Zi5FeGFt",
"cGxlcy5BZGRyZXNzQm9va2IGcHJvdG8z"));
descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
new pbr::FileDescriptor[] { },
@ -71,6 +73,7 @@ namespace Google.Protobuf.Examples.AddressBook {
return new Person(this);
}
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 1;
private string name_ = "";
public string Name {
@ -80,8 +83,12 @@ namespace Google.Protobuf.Examples.AddressBook {
}
}
/// <summary>Field number for the "id" field.</summary>
public const int IdFieldNumber = 2;
private int id_;
/// <summary>
/// Unique ID number for this person.
/// </summary>
public int Id {
get { return id_; }
set {
@ -89,6 +96,7 @@ namespace Google.Protobuf.Examples.AddressBook {
}
}
/// <summary>Field number for the "email" field.</summary>
public const int EmailFieldNumber = 3;
private string email_ = "";
public string Email {
@ -98,6 +106,7 @@ namespace Google.Protobuf.Examples.AddressBook {
}
}
/// <summary>Field number for the "phones" field.</summary>
public const int PhonesFieldNumber = 4;
private static readonly pb::FieldCodec<global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber> _repeated_phones_codec
= pb::FieldCodec.ForMessage(34, global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber.Parser);
@ -212,6 +221,7 @@ namespace Google.Protobuf.Examples.AddressBook {
}
#region Nested types
/// <summary>Container for nested types declared in the Person message type.</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class Types {
public enum PhoneType {
@ -248,6 +258,7 @@ namespace Google.Protobuf.Examples.AddressBook {
return new PhoneNumber(this);
}
/// <summary>Field number for the "number" field.</summary>
public const int NumberFieldNumber = 1;
private string number_ = "";
public string Number {
@ -257,6 +268,7 @@ namespace Google.Protobuf.Examples.AddressBook {
}
}
/// <summary>Field number for the "type" field.</summary>
public const int TypeFieldNumber = 2;
private global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType type_ = global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.MOBILE;
public global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType Type {
@ -353,6 +365,9 @@ namespace Google.Protobuf.Examples.AddressBook {
}
/// <summary>
/// Our address book file is just one of these.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class AddressBook : pb::IMessage<AddressBook> {
private static readonly pb::MessageParser<AddressBook> _parser = new pb::MessageParser<AddressBook>(() => new AddressBook());
@ -380,6 +395,7 @@ namespace Google.Protobuf.Examples.AddressBook {
return new AddressBook(this);
}
/// <summary>Field number for the "people" field.</summary>
public const int PeopleFieldNumber = 1;
private static readonly pb::FieldCodec<global::Google.Protobuf.Examples.AddressBook.Person> _repeated_people_codec
= pb::FieldCodec.ForMessage(10, global::Google.Protobuf.Examples.AddressBook.Person.Parser);

View File

@ -9,10 +9,12 @@ using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Conformance {
/// <summary>Holder for reflection information generated from conformance.proto</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class Conformance {
#region Descriptor
/// <summary>File descriptor for conformance.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
@ -21,116 +23,116 @@ namespace Conformance {
static Conformance() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"ChFjb25mb3JtYW5jZS5wcm90bxILY29uZm9ybWFuY2UijQEKEkNvbmZvcm1h",
"bmNlUmVxdWVzdBIaChBwcm90b2J1Zl9wYXlsb2FkGAEgASgMSAASFgoManNv",
"bl9wYXlsb2FkGAIgASgJSAASOAoXcmVxdWVzdGVkX291dHB1dF9mb3JtYXQY",
"AyABKA4yFy5jb25mb3JtYW5jZS5XaXJlRm9ybWF0QgkKB3BheWxvYWQilgEK",
"E0NvbmZvcm1hbmNlUmVzcG9uc2USFQoLcGFyc2VfZXJyb3IYASABKAlIABIX",
"Cg1ydW50aW1lX2Vycm9yGAIgASgJSAASGgoQcHJvdG9idWZfcGF5bG9hZBgD",
"IAEoDEgAEhYKDGpzb25fcGF5bG9hZBgEIAEoCUgAEhEKB3NraXBwZWQYBSAB",
"KAlIAEIICgZyZXN1bHQi6yIKDFRlc3RBbGxUeXBlcxIWCg5vcHRpb25hbF9p",
"bnQzMhgBIAEoBRIWCg5vcHRpb25hbF9pbnQ2NBgCIAEoAxIXCg9vcHRpb25h",
"bF91aW50MzIYAyABKA0SFwoPb3B0aW9uYWxfdWludDY0GAQgASgEEhcKD29w",
"dGlvbmFsX3NpbnQzMhgFIAEoERIXCg9vcHRpb25hbF9zaW50NjQYBiABKBIS",
"GAoQb3B0aW9uYWxfZml4ZWQzMhgHIAEoBxIYChBvcHRpb25hbF9maXhlZDY0",
"GAggASgGEhkKEW9wdGlvbmFsX3NmaXhlZDMyGAkgASgPEhkKEW9wdGlvbmFs",
"X3NmaXhlZDY0GAogASgQEhYKDm9wdGlvbmFsX2Zsb2F0GAsgASgCEhcKD29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JBUhABEgcKA0JBWhACEhAKA05FRxD/////",
"//////8BQg0KC29uZW9mX2ZpZWxkIhsKDkZvcmVpZ25NZXNzYWdlEgkKAWMY",
"ASABKAUqNQoKV2lyZUZvcm1hdBIPCgtVTlNQRUNJRklFRBAAEgwKCFBST1RP",
"QlVGEAESCAoESlNPThACKkAKC0ZvcmVpZ25FbnVtEg8KC0ZPUkVJR05fRk9P",
"EAASDwoLRk9SRUlHTl9CQVIQARIPCgtGT1JFSUdOX0JBWhACQiEKH2NvbS5n",
"b29nbGUucHJvdG9idWYuY29uZm9ybWFuY2ViBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
new pbr::FileDescriptor[] { },
@ -161,6 +163,12 @@ namespace Conformance {
#endregion
#region Messages
/// <summary>
/// Represents a single test case's input. The testee should:
/// 1. parse this proto (which should always succeed)
/// 2. parse the protobuf or JSON payload in "payload" (which may fail)
/// 3. if the parse succeeded, serialize the message in the requested format.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class ConformanceRequest : pb::IMessage<ConformanceRequest> {
private static readonly pb::MessageParser<ConformanceRequest> _parser = new pb::MessageParser<ConformanceRequest>(() => new ConformanceRequest());
@ -197,6 +205,7 @@ namespace Conformance {
return new ConformanceRequest(this);
}
/// <summary>Field number for the "protobuf_payload" field.</summary>
public const int ProtobufPayloadFieldNumber = 1;
public pb::ByteString ProtobufPayload {
get { return payloadCase_ == PayloadOneofCase.ProtobufPayload ? (pb::ByteString) payload_ : pb::ByteString.Empty; }
@ -206,6 +215,7 @@ namespace Conformance {
}
}
/// <summary>Field number for the "json_payload" field.</summary>
public const int JsonPayloadFieldNumber = 2;
public string JsonPayload {
get { return payloadCase_ == PayloadOneofCase.JsonPayload ? (string) payload_ : ""; }
@ -215,8 +225,12 @@ namespace Conformance {
}
}
/// <summary>Field number for the "requested_output_format" field.</summary>
public const int RequestedOutputFormatFieldNumber = 3;
private global::Conformance.WireFormat requestedOutputFormat_ = global::Conformance.WireFormat.UNSPECIFIED;
/// <summary>
/// Which format should the testee serialize its message to?
/// </summary>
public global::Conformance.WireFormat RequestedOutputFormat {
get { return requestedOutputFormat_; }
set {
@ -225,6 +239,7 @@ namespace Conformance {
}
private object payload_;
/// <summary>Enum of possible cases for the "payload" oneof.</summary>
public enum PayloadOneofCase {
None = 0,
ProtobufPayload = 1,
@ -341,6 +356,9 @@ namespace Conformance {
}
/// <summary>
/// Represents a single test case's output.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class ConformanceResponse : pb::IMessage<ConformanceResponse> {
private static readonly pb::MessageParser<ConformanceResponse> _parser = new pb::MessageParser<ConformanceResponse>(() => new ConformanceResponse());
@ -385,7 +403,14 @@ namespace Conformance {
return new ConformanceResponse(this);
}
/// <summary>Field number for the "parse_error" field.</summary>
public const int ParseErrorFieldNumber = 1;
/// <summary>
/// This string should be set to indicate parsing failed. The string can
/// provide more information about the parse error if it is available.
/// Setting this string does not necessarily mean the testee failed the
/// test. Some of the test cases are intentionally invalid input.
/// </summary>
public string ParseError {
get { return resultCase_ == ResultOneofCase.ParseError ? (string) result_ : ""; }
set {
@ -394,7 +419,13 @@ namespace Conformance {
}
}
/// <summary>Field number for the "runtime_error" field.</summary>
public const int RuntimeErrorFieldNumber = 2;
/// <summary>
/// This should be set if some other error occurred. This will always
/// indicate that the test failed. The string can provide more information
/// about the failure.
/// </summary>
public string RuntimeError {
get { return resultCase_ == ResultOneofCase.RuntimeError ? (string) result_ : ""; }
set {
@ -403,7 +434,12 @@ namespace Conformance {
}
}
/// <summary>Field number for the "protobuf_payload" field.</summary>
public const int ProtobufPayloadFieldNumber = 3;
/// <summary>
/// If the input was successfully parsed and the requested output was
/// protobuf, serialize it to protobuf and set it in this field.
/// </summary>
public pb::ByteString ProtobufPayload {
get { return resultCase_ == ResultOneofCase.ProtobufPayload ? (pb::ByteString) result_ : pb::ByteString.Empty; }
set {
@ -412,7 +448,12 @@ namespace Conformance {
}
}
/// <summary>Field number for the "json_payload" field.</summary>
public const int JsonPayloadFieldNumber = 4;
/// <summary>
/// If the input was successfully parsed and the requested output was JSON,
/// serialize to JSON and set it in this field.
/// </summary>
public string JsonPayload {
get { return resultCase_ == ResultOneofCase.JsonPayload ? (string) result_ : ""; }
set {
@ -421,7 +462,12 @@ namespace Conformance {
}
}
/// <summary>Field number for the "skipped" field.</summary>
public const int SkippedFieldNumber = 5;
/// <summary>
/// For when the testee skipped the test, likely because a certain feature
/// wasn't supported, like JSON input/output.
/// </summary>
public string Skipped {
get { return resultCase_ == ResultOneofCase.Skipped ? (string) result_ : ""; }
set {
@ -431,6 +477,7 @@ namespace Conformance {
}
private object result_;
/// <summary>Enum of possible cases for the "result" oneof.</summary>
public enum ResultOneofCase {
None = 0,
ParseError = 1,
@ -582,6 +629,10 @@ namespace Conformance {
}
/// <summary>
/// This proto includes every type of field in both singular and repeated
/// forms.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class TestAllTypes : pb::IMessage<TestAllTypes> {
private static readonly pb::MessageParser<TestAllTypes> _parser = new pb::MessageParser<TestAllTypes>(() => new TestAllTypes());
@ -685,8 +736,12 @@ namespace Conformance {
return new TestAllTypes(this);
}
/// <summary>Field number for the "optional_int32" field.</summary>
public const int OptionalInt32FieldNumber = 1;
private int optionalInt32_;
/// <summary>
/// Singular
/// </summary>
public int OptionalInt32 {
get { return optionalInt32_; }
set {
@ -694,6 +749,7 @@ namespace Conformance {
}
}
/// <summary>Field number for the "optional_int64" field.</summary>
public const int OptionalInt64FieldNumber = 2;
private long optionalInt64_;
public long OptionalInt64 {
@ -703,6 +759,7 @@ namespace Conformance {
}
}
/// <summary>Field number for the "optional_uint32" field.</summary>
public const int OptionalUint32FieldNumber = 3;
private uint optionalUint32_;
public uint OptionalUint32 {
@ -712,6 +769,7 @@ namespace Conformance {
}
}
/// <summary>Field number for the "optional_uint64" field.</summary>
public const int OptionalUint64FieldNumber = 4;
private ulong optionalUint64_;
public ulong OptionalUint64 {
@ -721,6 +779,7 @@ namespace Conformance {
}
}
/// <summary>Field number for the "optional_sint32" field.</summary>
public const int OptionalSint32FieldNumber = 5;
private int optionalSint32_;
public int OptionalSint32 {
@ -730,6 +789,7 @@ namespace Conformance {
}
}
/// <summary>Field number for the "optional_sint64" field.</summary>
public const int OptionalSint64FieldNumber = 6;
private long optionalSint64_;
public long OptionalSint64 {
@ -739,6 +799,7 @@ namespace Conformance {
}
}
/// <summary>Field number for the "optional_fixed32" field.</summary>
public const int OptionalFixed32FieldNumber = 7;
private uint optionalFixed32_;
public uint OptionalFixed32 {
@ -748,6 +809,7 @@ namespace Conformance {
}
}
/// <summary>Field number for the "optional_fixed64" field.</summary>
public const int OptionalFixed64FieldNumber = 8;
private ulong optionalFixed64_;
public ulong OptionalFixed64 {
@ -757,6 +819,7 @@ namespace Conformance {
}
}
/// <summary>Field number for the "optional_sfixed32" field.</summary>
public const int OptionalSfixed32FieldNumber = 9;
private int optionalSfixed32_;
public int OptionalSfixed32 {
@ -766,6 +829,7 @@ namespace Conformance {
}
}
/// <summary>Field number for the "optional_sfixed64" field.</summary>
public const int OptionalSfixed64FieldNumber = 10;
private long optionalSfixed64_;
public long OptionalSfixed64 {
@ -775,6 +839,7 @@ namespace Conformance {
}
}
/// <summary>Field number for the "optional_float" field.</summary>
public const int OptionalFloatFieldNumber = 11;
private float optionalFloat_;
public float OptionalFloat {
@ -784,6 +849,7 @@ namespace Conformance {
}
}
/// <summary>Field number for the "optional_double" field.</summary>
public const int OptionalDoubleFieldNumber = 12;
private double optionalDouble_;
public double OptionalDouble {
@ -793,6 +859,7 @@ namespace Conformance {
}
}
/// <summary>Field number for the "optional_bool" field.</summary>
public const int OptionalBoolFieldNumber = 13;
private bool optionalBool_;
public bool OptionalBool {
@ -802,6 +869,7 @@ namespace Conformance {
}
}
/// <summary>Field number for the "optional_string" field.</summary>
public const int OptionalStringFieldNumber = 14;
private string optionalString_ = "";
public string OptionalString {
@ -811,6 +879,7 @@ namespace Conformance {
}
}
/// <summary>Field number for the "optional_bytes" field.</summary>
public const int OptionalBytesFieldNumber = 15;
private pb::ByteString optionalBytes_ = pb::ByteString.Empty;
public pb::ByteString OptionalBytes {
@ -820,6 +889,7 @@ namespace Conformance {
}
}
/// <summary>Field number for the "optional_nested_message" field.</summary>
public const int OptionalNestedMessageFieldNumber = 18;
private global::Conformance.TestAllTypes.Types.NestedMessage optionalNestedMessage_;
public global::Conformance.TestAllTypes.Types.NestedMessage OptionalNestedMessage {
@ -829,6 +899,7 @@ namespace Conformance {
}
}
/// <summary>Field number for the "optional_foreign_message" field.</summary>
public const int OptionalForeignMessageFieldNumber = 19;
private global::Conformance.ForeignMessage optionalForeignMessage_;
public global::Conformance.ForeignMessage OptionalForeignMessage {
@ -838,6 +909,7 @@ namespace Conformance {
}
}
/// <summary>Field number for the "optional_nested_enum" field.</summary>
public const int OptionalNestedEnumFieldNumber = 21;
private global::Conformance.TestAllTypes.Types.NestedEnum optionalNestedEnum_ = global::Conformance.TestAllTypes.Types.NestedEnum.FOO;
public global::Conformance.TestAllTypes.Types.NestedEnum OptionalNestedEnum {
@ -847,6 +919,7 @@ namespace Conformance {
}
}
/// <summary>Field number for the "optional_foreign_enum" field.</summary>
public const int OptionalForeignEnumFieldNumber = 22;
private global::Conformance.ForeignEnum optionalForeignEnum_ = global::Conformance.ForeignEnum.FOREIGN_FOO;
public global::Conformance.ForeignEnum OptionalForeignEnum {
@ -856,6 +929,7 @@ namespace Conformance {
}
}
/// <summary>Field number for the "optional_string_piece" field.</summary>
public const int OptionalStringPieceFieldNumber = 24;
private string optionalStringPiece_ = "";
public string OptionalStringPiece {
@ -865,6 +939,7 @@ namespace Conformance {
}
}
/// <summary>Field number for the "optional_cord" field.</summary>
public const int OptionalCordFieldNumber = 25;
private string optionalCord_ = "";
public string OptionalCord {
@ -874,6 +949,7 @@ namespace Conformance {
}
}
/// <summary>Field number for the "recursive_message" field.</summary>
public const int RecursiveMessageFieldNumber = 27;
private global::Conformance.TestAllTypes recursiveMessage_;
public global::Conformance.TestAllTypes RecursiveMessage {
@ -883,14 +959,19 @@ namespace Conformance {
}
}
/// <summary>Field number for the "repeated_int32" field.</summary>
public const int RepeatedInt32FieldNumber = 31;
private static readonly pb::FieldCodec<int> _repeated_repeatedInt32_codec
= pb::FieldCodec.ForInt32(250);
private readonly pbc::RepeatedField<int> repeatedInt32_ = new pbc::RepeatedField<int>();
/// <summary>
/// Repeated
/// </summary>
public pbc::RepeatedField<int> RepeatedInt32 {
get { return repeatedInt32_; }
}
/// <summary>Field number for the "repeated_int64" field.</summary>
public const int RepeatedInt64FieldNumber = 32;
private static readonly pb::FieldCodec<long> _repeated_repeatedInt64_codec
= pb::FieldCodec.ForInt64(258);
@ -899,6 +980,7 @@ namespace Conformance {
get { return repeatedInt64_; }
}
/// <summary>Field number for the "repeated_uint32" field.</summary>
public const int RepeatedUint32FieldNumber = 33;
private static readonly pb::FieldCodec<uint> _repeated_repeatedUint32_codec
= pb::FieldCodec.ForUInt32(266);
@ -907,6 +989,7 @@ namespace Conformance {
get { return repeatedUint32_; }
}
/// <summary>Field number for the "repeated_uint64" field.</summary>
public const int RepeatedUint64FieldNumber = 34;
private static readonly pb::FieldCodec<ulong> _repeated_repeatedUint64_codec
= pb::FieldCodec.ForUInt64(274);
@ -915,6 +998,7 @@ namespace Conformance {
get { return repeatedUint64_; }
}
/// <summary>Field number for the "repeated_sint32" field.</summary>
public const int RepeatedSint32FieldNumber = 35;
private static readonly pb::FieldCodec<int> _repeated_repeatedSint32_codec
= pb::FieldCodec.ForSInt32(282);
@ -923,6 +1007,7 @@ namespace Conformance {
get { return repeatedSint32_; }
}
/// <summary>Field number for the "repeated_sint64" field.</summary>
public const int RepeatedSint64FieldNumber = 36;
private static readonly pb::FieldCodec<long> _repeated_repeatedSint64_codec
= pb::FieldCodec.ForSInt64(290);
@ -931,6 +1016,7 @@ namespace Conformance {
get { return repeatedSint64_; }
}
/// <summary>Field number for the "repeated_fixed32" field.</summary>
public const int RepeatedFixed32FieldNumber = 37;
private static readonly pb::FieldCodec<uint> _repeated_repeatedFixed32_codec
= pb::FieldCodec.ForFixed32(298);
@ -939,6 +1025,7 @@ namespace Conformance {
get { return repeatedFixed32_; }
}
/// <summary>Field number for the "repeated_fixed64" field.</summary>
public const int RepeatedFixed64FieldNumber = 38;
private static readonly pb::FieldCodec<ulong> _repeated_repeatedFixed64_codec
= pb::FieldCodec.ForFixed64(306);
@ -947,6 +1034,7 @@ namespace Conformance {
get { return repeatedFixed64_; }
}
/// <summary>Field number for the "repeated_sfixed32" field.</summary>
public const int RepeatedSfixed32FieldNumber = 39;
private static readonly pb::FieldCodec<int> _repeated_repeatedSfixed32_codec
= pb::FieldCodec.ForSFixed32(314);
@ -955,6 +1043,7 @@ namespace Conformance {
get { return repeatedSfixed32_; }
}
/// <summary>Field number for the "repeated_sfixed64" field.</summary>
public const int RepeatedSfixed64FieldNumber = 40;
private static readonly pb::FieldCodec<long> _repeated_repeatedSfixed64_codec
= pb::FieldCodec.ForSFixed64(322);
@ -963,6 +1052,7 @@ namespace Conformance {
get { return repeatedSfixed64_; }
}
/// <summary>Field number for the "repeated_float" field.</summary>
public const int RepeatedFloatFieldNumber = 41;
private static readonly pb::FieldCodec<float> _repeated_repeatedFloat_codec
= pb::FieldCodec.ForFloat(330);
@ -971,6 +1061,7 @@ namespace Conformance {
get { return repeatedFloat_; }
}
/// <summary>Field number for the "repeated_double" field.</summary>
public const int RepeatedDoubleFieldNumber = 42;
private static readonly pb::FieldCodec<double> _repeated_repeatedDouble_codec
= pb::FieldCodec.ForDouble(338);
@ -979,6 +1070,7 @@ namespace Conformance {
get { return repeatedDouble_; }
}
/// <summary>Field number for the "repeated_bool" field.</summary>
public const int RepeatedBoolFieldNumber = 43;
private static readonly pb::FieldCodec<bool> _repeated_repeatedBool_codec
= pb::FieldCodec.ForBool(346);
@ -987,6 +1079,7 @@ namespace Conformance {
get { return repeatedBool_; }
}
/// <summary>Field number for the "repeated_string" field.</summary>
public const int RepeatedStringFieldNumber = 44;
private static readonly pb::FieldCodec<string> _repeated_repeatedString_codec
= pb::FieldCodec.ForString(354);
@ -995,6 +1088,7 @@ namespace Conformance {
get { return repeatedString_; }
}
/// <summary>Field number for the "repeated_bytes" field.</summary>
public const int RepeatedBytesFieldNumber = 45;
private static readonly pb::FieldCodec<pb::ByteString> _repeated_repeatedBytes_codec
= pb::FieldCodec.ForBytes(362);
@ -1003,6 +1097,7 @@ namespace Conformance {
get { return repeatedBytes_; }
}
/// <summary>Field number for the "repeated_nested_message" field.</summary>
public const int RepeatedNestedMessageFieldNumber = 48;
private static readonly pb::FieldCodec<global::Conformance.TestAllTypes.Types.NestedMessage> _repeated_repeatedNestedMessage_codec
= pb::FieldCodec.ForMessage(386, global::Conformance.TestAllTypes.Types.NestedMessage.Parser);
@ -1011,6 +1106,7 @@ namespace Conformance {
get { return repeatedNestedMessage_; }
}
/// <summary>Field number for the "repeated_foreign_message" field.</summary>
public const int RepeatedForeignMessageFieldNumber = 49;
private static readonly pb::FieldCodec<global::Conformance.ForeignMessage> _repeated_repeatedForeignMessage_codec
= pb::FieldCodec.ForMessage(394, global::Conformance.ForeignMessage.Parser);
@ -1019,6 +1115,7 @@ namespace Conformance {
get { return repeatedForeignMessage_; }
}
/// <summary>Field number for the "repeated_nested_enum" field.</summary>
public const int RepeatedNestedEnumFieldNumber = 51;
private static readonly pb::FieldCodec<global::Conformance.TestAllTypes.Types.NestedEnum> _repeated_repeatedNestedEnum_codec
= pb::FieldCodec.ForEnum(410, x => (int) x, x => (global::Conformance.TestAllTypes.Types.NestedEnum) x);
@ -1027,6 +1124,7 @@ namespace Conformance {
get { return repeatedNestedEnum_; }
}
/// <summary>Field number for the "repeated_foreign_enum" field.</summary>
public const int RepeatedForeignEnumFieldNumber = 52;
private static readonly pb::FieldCodec<global::Conformance.ForeignEnum> _repeated_repeatedForeignEnum_codec
= pb::FieldCodec.ForEnum(418, x => (int) x, x => (global::Conformance.ForeignEnum) x);
@ -1035,6 +1133,7 @@ namespace Conformance {
get { return repeatedForeignEnum_; }
}
/// <summary>Field number for the "repeated_string_piece" field.</summary>
public const int RepeatedStringPieceFieldNumber = 54;
private static readonly pb::FieldCodec<string> _repeated_repeatedStringPiece_codec
= pb::FieldCodec.ForString(434);
@ -1043,6 +1142,7 @@ namespace Conformance {
get { return repeatedStringPiece_; }
}
/// <summary>Field number for the "repeated_cord" field.</summary>
public const int RepeatedCordFieldNumber = 55;
private static readonly pb::FieldCodec<string> _repeated_repeatedCord_codec
= pb::FieldCodec.ForString(442);
@ -1051,14 +1151,19 @@ namespace Conformance {
get { return repeatedCord_; }
}
/// <summary>Field number for the "map_int32_int32" field.</summary>
public const int MapInt32Int32FieldNumber = 56;
private static readonly pbc::MapField<int, int>.Codec _map_mapInt32Int32_codec
= new pbc::MapField<int, int>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForInt32(16), 450);
private readonly pbc::MapField<int, int> mapInt32Int32_ = new pbc::MapField<int, int>();
/// <summary>
/// Map
/// </summary>
public pbc::MapField<int, int> MapInt32Int32 {
get { return mapInt32Int32_; }
}
/// <summary>Field number for the "map_int64_int64" field.</summary>
public const int MapInt64Int64FieldNumber = 57;
private static readonly pbc::MapField<long, long>.Codec _map_mapInt64Int64_codec
= new pbc::MapField<long, long>.Codec(pb::FieldCodec.ForInt64(8), pb::FieldCodec.ForInt64(16), 458);
@ -1067,6 +1172,7 @@ namespace Conformance {
get { return mapInt64Int64_; }
}
/// <summary>Field number for the "map_uint32_uint32" field.</summary>
public const int MapUint32Uint32FieldNumber = 58;
private static readonly pbc::MapField<uint, uint>.Codec _map_mapUint32Uint32_codec
= new pbc::MapField<uint, uint>.Codec(pb::FieldCodec.ForUInt32(8), pb::FieldCodec.ForUInt32(16), 466);
@ -1075,6 +1181,7 @@ namespace Conformance {
get { return mapUint32Uint32_; }
}
/// <summary>Field number for the "map_uint64_uint64" field.</summary>
public const int MapUint64Uint64FieldNumber = 59;
private static readonly pbc::MapField<ulong, ulong>.Codec _map_mapUint64Uint64_codec
= new pbc::MapField<ulong, ulong>.Codec(pb::FieldCodec.ForUInt64(8), pb::FieldCodec.ForUInt64(16), 474);
@ -1083,6 +1190,7 @@ namespace Conformance {
get { return mapUint64Uint64_; }
}
/// <summary>Field number for the "map_sint32_sint32" field.</summary>
public const int MapSint32Sint32FieldNumber = 60;
private static readonly pbc::MapField<int, int>.Codec _map_mapSint32Sint32_codec
= new pbc::MapField<int, int>.Codec(pb::FieldCodec.ForSInt32(8), pb::FieldCodec.ForSInt32(16), 482);
@ -1091,6 +1199,7 @@ namespace Conformance {
get { return mapSint32Sint32_; }
}
/// <summary>Field number for the "map_sint64_sint64" field.</summary>
public const int MapSint64Sint64FieldNumber = 61;
private static readonly pbc::MapField<long, long>.Codec _map_mapSint64Sint64_codec
= new pbc::MapField<long, long>.Codec(pb::FieldCodec.ForSInt64(8), pb::FieldCodec.ForSInt64(16), 490);
@ -1099,6 +1208,7 @@ namespace Conformance {
get { return mapSint64Sint64_; }
}
/// <summary>Field number for the "map_fixed32_fixed32" field.</summary>
public const int MapFixed32Fixed32FieldNumber = 62;
private static readonly pbc::MapField<uint, uint>.Codec _map_mapFixed32Fixed32_codec
= new pbc::MapField<uint, uint>.Codec(pb::FieldCodec.ForFixed32(13), pb::FieldCodec.ForFixed32(21), 498);
@ -1107,6 +1217,7 @@ namespace Conformance {
get { return mapFixed32Fixed32_; }
}
/// <summary>Field number for the "map_fixed64_fixed64" field.</summary>
public const int MapFixed64Fixed64FieldNumber = 63;
private static readonly pbc::MapField<ulong, ulong>.Codec _map_mapFixed64Fixed64_codec
= new pbc::MapField<ulong, ulong>.Codec(pb::FieldCodec.ForFixed64(9), pb::FieldCodec.ForFixed64(17), 506);
@ -1115,6 +1226,7 @@ namespace Conformance {
get { return mapFixed64Fixed64_; }
}
/// <summary>Field number for the "map_sfixed32_sfixed32" field.</summary>
public const int MapSfixed32Sfixed32FieldNumber = 64;
private static readonly pbc::MapField<int, int>.Codec _map_mapSfixed32Sfixed32_codec
= new pbc::MapField<int, int>.Codec(pb::FieldCodec.ForSFixed32(13), pb::FieldCodec.ForSFixed32(21), 514);
@ -1123,6 +1235,7 @@ namespace Conformance {
get { return mapSfixed32Sfixed32_; }
}
/// <summary>Field number for the "map_sfixed64_sfixed64" field.</summary>
public const int MapSfixed64Sfixed64FieldNumber = 65;
private static readonly pbc::MapField<long, long>.Codec _map_mapSfixed64Sfixed64_codec
= new pbc::MapField<long, long>.Codec(pb::FieldCodec.ForSFixed64(9), pb::FieldCodec.ForSFixed64(17), 522);
@ -1131,6 +1244,7 @@ namespace Conformance {
get { return mapSfixed64Sfixed64_; }
}
/// <summary>Field number for the "map_int32_float" field.</summary>
public const int MapInt32FloatFieldNumber = 66;
private static readonly pbc::MapField<int, float>.Codec _map_mapInt32Float_codec
= new pbc::MapField<int, float>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForFloat(21), 530);
@ -1139,6 +1253,7 @@ namespace Conformance {
get { return mapInt32Float_; }
}
/// <summary>Field number for the "map_int32_double" field.</summary>
public const int MapInt32DoubleFieldNumber = 67;
private static readonly pbc::MapField<int, double>.Codec _map_mapInt32Double_codec
= new pbc::MapField<int, double>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForDouble(17), 538);
@ -1147,6 +1262,7 @@ namespace Conformance {
get { return mapInt32Double_; }
}
/// <summary>Field number for the "map_bool_bool" field.</summary>
public const int MapBoolBoolFieldNumber = 68;
private static readonly pbc::MapField<bool, bool>.Codec _map_mapBoolBool_codec
= new pbc::MapField<bool, bool>.Codec(pb::FieldCodec.ForBool(8), pb::FieldCodec.ForBool(16), 546);
@ -1155,6 +1271,7 @@ namespace Conformance {
get { return mapBoolBool_; }
}
/// <summary>Field number for the "map_string_string" field.</summary>
public const int MapStringStringFieldNumber = 69;
private static readonly pbc::MapField<string, string>.Codec _map_mapStringString_codec
= new pbc::MapField<string, string>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForString(18), 554);
@ -1163,6 +1280,7 @@ namespace Conformance {
get { return mapStringString_; }
}
/// <summary>Field number for the "map_string_bytes" field.</summary>
public const int MapStringBytesFieldNumber = 70;
private static readonly pbc::MapField<string, pb::ByteString>.Codec _map_mapStringBytes_codec
= new pbc::MapField<string, pb::ByteString>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForBytes(18), 562);
@ -1171,6 +1289,7 @@ namespace Conformance {
get { return mapStringBytes_; }
}
/// <summary>Field number for the "map_string_nested_message" field.</summary>
public const int MapStringNestedMessageFieldNumber = 71;
private static readonly pbc::MapField<string, global::Conformance.TestAllTypes.Types.NestedMessage>.Codec _map_mapStringNestedMessage_codec
= new pbc::MapField<string, global::Conformance.TestAllTypes.Types.NestedMessage>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForMessage(18, global::Conformance.TestAllTypes.Types.NestedMessage.Parser), 570);
@ -1179,6 +1298,7 @@ namespace Conformance {
get { return mapStringNestedMessage_; }
}
/// <summary>Field number for the "map_string_foreign_message" field.</summary>
public const int MapStringForeignMessageFieldNumber = 72;
private static readonly pbc::MapField<string, global::Conformance.ForeignMessage>.Codec _map_mapStringForeignMessage_codec
= new pbc::MapField<string, global::Conformance.ForeignMessage>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForMessage(18, global::Conformance.ForeignMessage.Parser), 578);
@ -1187,6 +1307,7 @@ namespace Conformance {
get { return mapStringForeignMessage_; }
}
/// <summary>Field number for the "map_string_nested_enum" field.</summary>
public const int MapStringNestedEnumFieldNumber = 73;
private static readonly pbc::MapField<string, global::Conformance.TestAllTypes.Types.NestedEnum>.Codec _map_mapStringNestedEnum_codec
= new pbc::MapField<string, global::Conformance.TestAllTypes.Types.NestedEnum>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::Conformance.TestAllTypes.Types.NestedEnum) x), 586);
@ -1195,6 +1316,7 @@ namespace Conformance {
get { return mapStringNestedEnum_; }
}
/// <summary>Field number for the "map_string_foreign_enum" field.</summary>
public const int MapStringForeignEnumFieldNumber = 74;
private static readonly pbc::MapField<string, global::Conformance.ForeignEnum>.Codec _map_mapStringForeignEnum_codec
= new pbc::MapField<string, global::Conformance.ForeignEnum>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::Conformance.ForeignEnum) x), 594);
@ -1203,6 +1325,7 @@ namespace Conformance {
get { return mapStringForeignEnum_; }
}
/// <summary>Field number for the "oneof_uint32" field.</summary>
public const int OneofUint32FieldNumber = 111;
public uint OneofUint32 {
get { return oneofFieldCase_ == OneofFieldOneofCase.OneofUint32 ? (uint) oneofField_ : 0; }
@ -1212,6 +1335,7 @@ namespace Conformance {
}
}
/// <summary>Field number for the "oneof_nested_message" field.</summary>
public const int OneofNestedMessageFieldNumber = 112;
public global::Conformance.TestAllTypes.Types.NestedMessage OneofNestedMessage {
get { return oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage ? (global::Conformance.TestAllTypes.Types.NestedMessage) oneofField_ : null; }
@ -1221,6 +1345,7 @@ namespace Conformance {
}
}
/// <summary>Field number for the "oneof_string" field.</summary>
public const int OneofStringFieldNumber = 113;
public string OneofString {
get { return oneofFieldCase_ == OneofFieldOneofCase.OneofString ? (string) oneofField_ : ""; }
@ -1230,6 +1355,7 @@ namespace Conformance {
}
}
/// <summary>Field number for the "oneof_bytes" field.</summary>
public const int OneofBytesFieldNumber = 114;
public pb::ByteString OneofBytes {
get { return oneofFieldCase_ == OneofFieldOneofCase.OneofBytes ? (pb::ByteString) oneofField_ : pb::ByteString.Empty; }
@ -1240,6 +1366,7 @@ namespace Conformance {
}
private object oneofField_;
/// <summary>Enum of possible cases for the "oneof_field" oneof.</summary>
public enum OneofFieldOneofCase {
None = 0,
OneofUint32 = 111,
@ -2123,12 +2250,16 @@ namespace Conformance {
}
#region Nested types
/// <summary>Container for nested types declared in the TestAllTypes message type.</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class Types {
public enum NestedEnum {
FOO = 0,
BAR = 1,
BAZ = 2,
/// <summary>
/// Intentionally negative.
/// </summary>
NEG = -1,
}
@ -2160,6 +2291,7 @@ namespace Conformance {
return new NestedMessage(this);
}
/// <summary>Field number for the "a" field.</summary>
public const int AFieldNumber = 1;
private int a_;
public int A {
@ -2169,6 +2301,7 @@ namespace Conformance {
}
}
/// <summary>Field number for the "corecursive" field.</summary>
public const int CorecursiveFieldNumber = 2;
private global::Conformance.TestAllTypes corecursive_;
public global::Conformance.TestAllTypes Corecursive {
@ -2298,6 +2431,7 @@ namespace Conformance {
return new ForeignMessage(this);
}
/// <summary>Field number for the "c" field.</summary>
public const int CFieldNumber = 1;
private int c_;
public int C {

View File

@ -109,6 +109,7 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TestCornerCases.cs" />
<Compile Include="TestProtos\UnittestWellKnownTypes.cs" />
<Compile Include="WellKnownTypes\AnyTest.cs" />
<Compile Include="WellKnownTypes\DurationTest.cs" />
<Compile Include="WellKnownTypes\TimestampTest.cs" />
<Compile Include="WellKnownTypes\WrappersTest.cs" />

View File

@ -9,10 +9,12 @@ using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Google.Protobuf.TestProtos {
/// <summary>Holder for reflection information generated from google/protobuf/map_unittest_proto3.proto</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class MapUnittestProto3 {
#region Descriptor
/// <summary>File descriptor for google/protobuf/map_unittest_proto3.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
@ -21,129 +23,129 @@ namespace Google.Protobuf.TestProtos {
static MapUnittestProto3() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cilnb29nbGUvcHJvdG9idWYvbWFwX3VuaXR0ZXN0X3Byb3RvMy5wcm90bxIR",
"cHJvdG9idWZfdW5pdHRlc3QaJWdvb2dsZS9wcm90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l8KCVR5cGVFbnRyeRILCgNrZXkYASABKAUSQQoFdmFsdWUYAiAB",
"KAsyMi5wcm90b2J1Zl91bml0dGVzdC5NZXNzYWdlQ29udGFpbmluZ0VudW1D",
"YWxsZWRUeXBlOgI4ASIUCgRUeXBlEgwKCFRZUEVfRk9PEAAinQEKH01lc3Nh",
"Z2VDb250YWluaW5nTWFwQ2FsbGVkRW50cnkSTAoFZW50cnkYASADKAsyPS5w",
"cm90b2J1Zl91bml0dGVzdC5NZXNzYWdlQ29udGFpbmluZ01hcENhbGxlZEVu",
"dHJ5LkVudHJ5RW50cnkaLAoKRW50cnlFbnRyeRILCgNrZXkYASABKAUSDQoF",
"dmFsdWUYAiABKAU6AjgBKj8KB01hcEVudW0SEAoMTUFQX0VOVU1fRk9PEAAS",
"EAoMTUFQX0VOVU1fQkFSEAESEAoMTUFQX0VOVU1fQkFaEAJCIPgBAaoCGkdv",
"b2dsZS5Qcm90b2J1Zi5UZXN0UHJvdG9zYgZwcm90bzM="));
descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
new pbr::FileDescriptor[] { global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor, },
@ -170,6 +172,9 @@ namespace Google.Protobuf.TestProtos {
#endregion
#region Messages
/// <summary>
/// Tests maps.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class TestMap : pb::IMessage<TestMap> {
private static readonly pb::MessageParser<TestMap> _parser = new pb::MessageParser<TestMap>(() => new TestMap());
@ -213,6 +218,7 @@ namespace Google.Protobuf.TestProtos {
return new TestMap(this);
}
/// <summary>Field number for the "map_int32_int32" field.</summary>
public const int MapInt32Int32FieldNumber = 1;
private static readonly pbc::MapField<int, int>.Codec _map_mapInt32Int32_codec
= new pbc::MapField<int, int>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForInt32(16), 10);
@ -221,6 +227,7 @@ namespace Google.Protobuf.TestProtos {
get { return mapInt32Int32_; }
}
/// <summary>Field number for the "map_int64_int64" field.</summary>
public const int MapInt64Int64FieldNumber = 2;
private static readonly pbc::MapField<long, long>.Codec _map_mapInt64Int64_codec
= new pbc::MapField<long, long>.Codec(pb::FieldCodec.ForInt64(8), pb::FieldCodec.ForInt64(16), 18);
@ -229,6 +236,7 @@ namespace Google.Protobuf.TestProtos {
get { return mapInt64Int64_; }
}
/// <summary>Field number for the "map_uint32_uint32" field.</summary>
public const int MapUint32Uint32FieldNumber = 3;
private static readonly pbc::MapField<uint, uint>.Codec _map_mapUint32Uint32_codec
= new pbc::MapField<uint, uint>.Codec(pb::FieldCodec.ForUInt32(8), pb::FieldCodec.ForUInt32(16), 26);
@ -237,6 +245,7 @@ namespace Google.Protobuf.TestProtos {
get { return mapUint32Uint32_; }
}
/// <summary>Field number for the "map_uint64_uint64" field.</summary>
public const int MapUint64Uint64FieldNumber = 4;
private static readonly pbc::MapField<ulong, ulong>.Codec _map_mapUint64Uint64_codec
= new pbc::MapField<ulong, ulong>.Codec(pb::FieldCodec.ForUInt64(8), pb::FieldCodec.ForUInt64(16), 34);
@ -245,6 +254,7 @@ namespace Google.Protobuf.TestProtos {
get { return mapUint64Uint64_; }
}
/// <summary>Field number for the "map_sint32_sint32" field.</summary>
public const int MapSint32Sint32FieldNumber = 5;
private static readonly pbc::MapField<int, int>.Codec _map_mapSint32Sint32_codec
= new pbc::MapField<int, int>.Codec(pb::FieldCodec.ForSInt32(8), pb::FieldCodec.ForSInt32(16), 42);
@ -253,6 +263,7 @@ namespace Google.Protobuf.TestProtos {
get { return mapSint32Sint32_; }
}
/// <summary>Field number for the "map_sint64_sint64" field.</summary>
public const int MapSint64Sint64FieldNumber = 6;
private static readonly pbc::MapField<long, long>.Codec _map_mapSint64Sint64_codec
= new pbc::MapField<long, long>.Codec(pb::FieldCodec.ForSInt64(8), pb::FieldCodec.ForSInt64(16), 50);
@ -261,6 +272,7 @@ namespace Google.Protobuf.TestProtos {
get { return mapSint64Sint64_; }
}
/// <summary>Field number for the "map_fixed32_fixed32" field.</summary>
public const int MapFixed32Fixed32FieldNumber = 7;
private static readonly pbc::MapField<uint, uint>.Codec _map_mapFixed32Fixed32_codec
= new pbc::MapField<uint, uint>.Codec(pb::FieldCodec.ForFixed32(13), pb::FieldCodec.ForFixed32(21), 58);
@ -269,6 +281,7 @@ namespace Google.Protobuf.TestProtos {
get { return mapFixed32Fixed32_; }
}
/// <summary>Field number for the "map_fixed64_fixed64" field.</summary>
public const int MapFixed64Fixed64FieldNumber = 8;
private static readonly pbc::MapField<ulong, ulong>.Codec _map_mapFixed64Fixed64_codec
= new pbc::MapField<ulong, ulong>.Codec(pb::FieldCodec.ForFixed64(9), pb::FieldCodec.ForFixed64(17), 66);
@ -277,6 +290,7 @@ namespace Google.Protobuf.TestProtos {
get { return mapFixed64Fixed64_; }
}
/// <summary>Field number for the "map_sfixed32_sfixed32" field.</summary>
public const int MapSfixed32Sfixed32FieldNumber = 9;
private static readonly pbc::MapField<int, int>.Codec _map_mapSfixed32Sfixed32_codec
= new pbc::MapField<int, int>.Codec(pb::FieldCodec.ForSFixed32(13), pb::FieldCodec.ForSFixed32(21), 74);
@ -285,6 +299,7 @@ namespace Google.Protobuf.TestProtos {
get { return mapSfixed32Sfixed32_; }
}
/// <summary>Field number for the "map_sfixed64_sfixed64" field.</summary>
public const int MapSfixed64Sfixed64FieldNumber = 10;
private static readonly pbc::MapField<long, long>.Codec _map_mapSfixed64Sfixed64_codec
= new pbc::MapField<long, long>.Codec(pb::FieldCodec.ForSFixed64(9), pb::FieldCodec.ForSFixed64(17), 82);
@ -293,6 +308,7 @@ namespace Google.Protobuf.TestProtos {
get { return mapSfixed64Sfixed64_; }
}
/// <summary>Field number for the "map_int32_float" field.</summary>
public const int MapInt32FloatFieldNumber = 11;
private static readonly pbc::MapField<int, float>.Codec _map_mapInt32Float_codec
= new pbc::MapField<int, float>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForFloat(21), 90);
@ -301,6 +317,7 @@ namespace Google.Protobuf.TestProtos {
get { return mapInt32Float_; }
}
/// <summary>Field number for the "map_int32_double" field.</summary>
public const int MapInt32DoubleFieldNumber = 12;
private static readonly pbc::MapField<int, double>.Codec _map_mapInt32Double_codec
= new pbc::MapField<int, double>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForDouble(17), 98);
@ -309,6 +326,7 @@ namespace Google.Protobuf.TestProtos {
get { return mapInt32Double_; }
}
/// <summary>Field number for the "map_bool_bool" field.</summary>
public const int MapBoolBoolFieldNumber = 13;
private static readonly pbc::MapField<bool, bool>.Codec _map_mapBoolBool_codec
= new pbc::MapField<bool, bool>.Codec(pb::FieldCodec.ForBool(8), pb::FieldCodec.ForBool(16), 106);
@ -317,6 +335,7 @@ namespace Google.Protobuf.TestProtos {
get { return mapBoolBool_; }
}
/// <summary>Field number for the "map_string_string" field.</summary>
public const int MapStringStringFieldNumber = 14;
private static readonly pbc::MapField<string, string>.Codec _map_mapStringString_codec
= new pbc::MapField<string, string>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForString(18), 114);
@ -325,6 +344,7 @@ namespace Google.Protobuf.TestProtos {
get { return mapStringString_; }
}
/// <summary>Field number for the "map_int32_bytes" field.</summary>
public const int MapInt32BytesFieldNumber = 15;
private static readonly pbc::MapField<int, pb::ByteString>.Codec _map_mapInt32Bytes_codec
= new pbc::MapField<int, pb::ByteString>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForBytes(18), 122);
@ -333,6 +353,7 @@ namespace Google.Protobuf.TestProtos {
get { return mapInt32Bytes_; }
}
/// <summary>Field number for the "map_int32_enum" field.</summary>
public const int MapInt32EnumFieldNumber = 16;
private static readonly pbc::MapField<int, global::Google.Protobuf.TestProtos.MapEnum>.Codec _map_mapInt32Enum_codec
= new pbc::MapField<int, global::Google.Protobuf.TestProtos.MapEnum>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::Google.Protobuf.TestProtos.MapEnum) x), 130);
@ -341,6 +362,7 @@ namespace Google.Protobuf.TestProtos {
get { return mapInt32Enum_; }
}
/// <summary>Field number for the "map_int32_foreign_message" field.</summary>
public const int MapInt32ForeignMessageFieldNumber = 17;
private static readonly pbc::MapField<int, global::Google.Protobuf.TestProtos.ForeignMessage>.Codec _map_mapInt32ForeignMessage_codec
= new pbc::MapField<int, global::Google.Protobuf.TestProtos.ForeignMessage>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.ForeignMessage.Parser), 138);
@ -579,6 +601,7 @@ namespace Google.Protobuf.TestProtos {
return new TestMapSubmessage(this);
}
/// <summary>Field number for the "test_map" field.</summary>
public const int TestMapFieldNumber = 1;
private global::Google.Protobuf.TestProtos.TestMap testMap_;
public global::Google.Protobuf.TestProtos.TestMap TestMap {
@ -687,6 +710,7 @@ namespace Google.Protobuf.TestProtos {
return new TestMessageMap(this);
}
/// <summary>Field number for the "map_int32_message" field.</summary>
public const int MapInt32MessageFieldNumber = 1;
private static readonly pbc::MapField<int, global::Google.Protobuf.TestProtos.TestAllTypes>.Codec _map_mapInt32Message_codec
= new pbc::MapField<int, global::Google.Protobuf.TestProtos.TestAllTypes>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.TestAllTypes.Parser), 10);
@ -754,6 +778,9 @@ namespace Google.Protobuf.TestProtos {
}
/// <summary>
/// Two map fields share the same entry default instance.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class TestSameTypeMap : pb::IMessage<TestSameTypeMap> {
private static readonly pb::MessageParser<TestSameTypeMap> _parser = new pb::MessageParser<TestSameTypeMap>(() => new TestSameTypeMap());
@ -782,6 +809,7 @@ namespace Google.Protobuf.TestProtos {
return new TestSameTypeMap(this);
}
/// <summary>Field number for the "map1" field.</summary>
public const int Map1FieldNumber = 1;
private static readonly pbc::MapField<int, int>.Codec _map_map1_codec
= new pbc::MapField<int, int>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForInt32(16), 10);
@ -790,6 +818,7 @@ namespace Google.Protobuf.TestProtos {
get { return map1_; }
}
/// <summary>Field number for the "map2" field.</summary>
public const int Map2FieldNumber = 2;
private static readonly pbc::MapField<int, int>.Codec _map_map2_codec
= new pbc::MapField<int, int>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForInt32(16), 18);
@ -907,6 +936,7 @@ namespace Google.Protobuf.TestProtos {
return new TestArenaMap(this);
}
/// <summary>Field number for the "map_int32_int32" field.</summary>
public const int MapInt32Int32FieldNumber = 1;
private static readonly pbc::MapField<int, int>.Codec _map_mapInt32Int32_codec
= new pbc::MapField<int, int>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForInt32(16), 10);
@ -915,6 +945,7 @@ namespace Google.Protobuf.TestProtos {
get { return mapInt32Int32_; }
}
/// <summary>Field number for the "map_int64_int64" field.</summary>
public const int MapInt64Int64FieldNumber = 2;
private static readonly pbc::MapField<long, long>.Codec _map_mapInt64Int64_codec
= new pbc::MapField<long, long>.Codec(pb::FieldCodec.ForInt64(8), pb::FieldCodec.ForInt64(16), 18);
@ -923,6 +954,7 @@ namespace Google.Protobuf.TestProtos {
get { return mapInt64Int64_; }
}
/// <summary>Field number for the "map_uint32_uint32" field.</summary>
public const int MapUint32Uint32FieldNumber = 3;
private static readonly pbc::MapField<uint, uint>.Codec _map_mapUint32Uint32_codec
= new pbc::MapField<uint, uint>.Codec(pb::FieldCodec.ForUInt32(8), pb::FieldCodec.ForUInt32(16), 26);
@ -931,6 +963,7 @@ namespace Google.Protobuf.TestProtos {
get { return mapUint32Uint32_; }
}
/// <summary>Field number for the "map_uint64_uint64" field.</summary>
public const int MapUint64Uint64FieldNumber = 4;
private static readonly pbc::MapField<ulong, ulong>.Codec _map_mapUint64Uint64_codec
= new pbc::MapField<ulong, ulong>.Codec(pb::FieldCodec.ForUInt64(8), pb::FieldCodec.ForUInt64(16), 34);
@ -939,6 +972,7 @@ namespace Google.Protobuf.TestProtos {
get { return mapUint64Uint64_; }
}
/// <summary>Field number for the "map_sint32_sint32" field.</summary>
public const int MapSint32Sint32FieldNumber = 5;
private static readonly pbc::MapField<int, int>.Codec _map_mapSint32Sint32_codec
= new pbc::MapField<int, int>.Codec(pb::FieldCodec.ForSInt32(8), pb::FieldCodec.ForSInt32(16), 42);
@ -947,6 +981,7 @@ namespace Google.Protobuf.TestProtos {
get { return mapSint32Sint32_; }
}
/// <summary>Field number for the "map_sint64_sint64" field.</summary>
public const int MapSint64Sint64FieldNumber = 6;
private static readonly pbc::MapField<long, long>.Codec _map_mapSint64Sint64_codec
= new pbc::MapField<long, long>.Codec(pb::FieldCodec.ForSInt64(8), pb::FieldCodec.ForSInt64(16), 50);
@ -955,6 +990,7 @@ namespace Google.Protobuf.TestProtos {
get { return mapSint64Sint64_; }
}
/// <summary>Field number for the "map_fixed32_fixed32" field.</summary>
public const int MapFixed32Fixed32FieldNumber = 7;
private static readonly pbc::MapField<uint, uint>.Codec _map_mapFixed32Fixed32_codec
= new pbc::MapField<uint, uint>.Codec(pb::FieldCodec.ForFixed32(13), pb::FieldCodec.ForFixed32(21), 58);
@ -963,6 +999,7 @@ namespace Google.Protobuf.TestProtos {
get { return mapFixed32Fixed32_; }
}
/// <summary>Field number for the "map_fixed64_fixed64" field.</summary>
public const int MapFixed64Fixed64FieldNumber = 8;
private static readonly pbc::MapField<ulong, ulong>.Codec _map_mapFixed64Fixed64_codec
= new pbc::MapField<ulong, ulong>.Codec(pb::FieldCodec.ForFixed64(9), pb::FieldCodec.ForFixed64(17), 66);
@ -971,6 +1008,7 @@ namespace Google.Protobuf.TestProtos {
get { return mapFixed64Fixed64_; }
}
/// <summary>Field number for the "map_sfixed32_sfixed32" field.</summary>
public const int MapSfixed32Sfixed32FieldNumber = 9;
private static readonly pbc::MapField<int, int>.Codec _map_mapSfixed32Sfixed32_codec
= new pbc::MapField<int, int>.Codec(pb::FieldCodec.ForSFixed32(13), pb::FieldCodec.ForSFixed32(21), 74);
@ -979,6 +1017,7 @@ namespace Google.Protobuf.TestProtos {
get { return mapSfixed32Sfixed32_; }
}
/// <summary>Field number for the "map_sfixed64_sfixed64" field.</summary>
public const int MapSfixed64Sfixed64FieldNumber = 10;
private static readonly pbc::MapField<long, long>.Codec _map_mapSfixed64Sfixed64_codec
= new pbc::MapField<long, long>.Codec(pb::FieldCodec.ForSFixed64(9), pb::FieldCodec.ForSFixed64(17), 82);
@ -987,6 +1026,7 @@ namespace Google.Protobuf.TestProtos {
get { return mapSfixed64Sfixed64_; }
}
/// <summary>Field number for the "map_int32_float" field.</summary>
public const int MapInt32FloatFieldNumber = 11;
private static readonly pbc::MapField<int, float>.Codec _map_mapInt32Float_codec
= new pbc::MapField<int, float>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForFloat(21), 90);
@ -995,6 +1035,7 @@ namespace Google.Protobuf.TestProtos {
get { return mapInt32Float_; }
}
/// <summary>Field number for the "map_int32_double" field.</summary>
public const int MapInt32DoubleFieldNumber = 12;
private static readonly pbc::MapField<int, double>.Codec _map_mapInt32Double_codec
= new pbc::MapField<int, double>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForDouble(17), 98);
@ -1003,6 +1044,7 @@ namespace Google.Protobuf.TestProtos {
get { return mapInt32Double_; }
}
/// <summary>Field number for the "map_bool_bool" field.</summary>
public const int MapBoolBoolFieldNumber = 13;
private static readonly pbc::MapField<bool, bool>.Codec _map_mapBoolBool_codec
= new pbc::MapField<bool, bool>.Codec(pb::FieldCodec.ForBool(8), pb::FieldCodec.ForBool(16), 106);
@ -1011,6 +1053,7 @@ namespace Google.Protobuf.TestProtos {
get { return mapBoolBool_; }
}
/// <summary>Field number for the "map_int32_enum" field.</summary>
public const int MapInt32EnumFieldNumber = 14;
private static readonly pbc::MapField<int, global::Google.Protobuf.TestProtos.MapEnum>.Codec _map_mapInt32Enum_codec
= new pbc::MapField<int, global::Google.Protobuf.TestProtos.MapEnum>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::Google.Protobuf.TestProtos.MapEnum) x), 114);
@ -1019,6 +1062,7 @@ namespace Google.Protobuf.TestProtos {
get { return mapInt32Enum_; }
}
/// <summary>Field number for the "map_int32_foreign_message" field.</summary>
public const int MapInt32ForeignMessageFieldNumber = 15;
private static readonly pbc::MapField<int, global::Google.Protobuf.TestProtos.ForeignMessage>.Codec _map_mapInt32ForeignMessage_codec
= new pbc::MapField<int, global::Google.Protobuf.TestProtos.ForeignMessage>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.ForeignMessage.Parser), 122);
@ -1212,6 +1256,10 @@ namespace Google.Protobuf.TestProtos {
}
/// <summary>
/// Previously, message containing enum called Type cannot be used as value of
/// map field.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class MessageContainingEnumCalledType : pb::IMessage<MessageContainingEnumCalledType> {
private static readonly pb::MessageParser<MessageContainingEnumCalledType> _parser = new pb::MessageParser<MessageContainingEnumCalledType>(() => new MessageContainingEnumCalledType());
@ -1239,6 +1287,7 @@ namespace Google.Protobuf.TestProtos {
return new MessageContainingEnumCalledType(this);
}
/// <summary>Field number for the "type" field.</summary>
public const int TypeFieldNumber = 1;
private static readonly pbc::MapField<int, global::Google.Protobuf.TestProtos.MessageContainingEnumCalledType>.Codec _map_type_codec
= new pbc::MapField<int, global::Google.Protobuf.TestProtos.MessageContainingEnumCalledType>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.MessageContainingEnumCalledType.Parser), 10);
@ -1305,6 +1354,7 @@ namespace Google.Protobuf.TestProtos {
}
#region Nested types
/// <summary>Container for nested types declared in the MessageContainingEnumCalledType message type.</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class Types {
public enum Type {
@ -1316,6 +1366,9 @@ namespace Google.Protobuf.TestProtos {
}
/// <summary>
/// Previously, message cannot contain map field called "entry".
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class MessageContainingMapCalledEntry : pb::IMessage<MessageContainingMapCalledEntry> {
private static readonly pb::MessageParser<MessageContainingMapCalledEntry> _parser = new pb::MessageParser<MessageContainingMapCalledEntry>(() => new MessageContainingMapCalledEntry());
@ -1343,6 +1396,7 @@ namespace Google.Protobuf.TestProtos {
return new MessageContainingMapCalledEntry(this);
}
/// <summary>Field number for the "entry" field.</summary>
public const int EntryFieldNumber = 1;
private static readonly pbc::MapField<int, int>.Codec _map_entry_codec
= new pbc::MapField<int, int>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForInt32(16), 10);

View File

@ -9,10 +9,12 @@ using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Google.Protobuf.TestProtos {
/// <summary>Holder for reflection information generated from google/protobuf/unittest_import_proto3.proto</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class UnittestImportProto3 {
#region Descriptor
/// <summary>File descriptor for google/protobuf/unittest_import_proto3.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
@ -21,13 +23,13 @@ namespace Google.Protobuf.TestProtos {
static UnittestImportProto3() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cixnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfaW1wb3J0X3Byb3RvMy5wcm90",
"bxIYcHJvdG9idWZfdW5pdHRlc3RfaW1wb3J0GjNnb29nbGUvcHJvdG9idWYv",
"dW5pdHRlc3RfaW1wb3J0X3B1YmxpY19wcm90bzMucHJvdG8iGgoNSW1wb3J0",
"TWVzc2FnZRIJCgFkGAEgASgFKlkKCkltcG9ydEVudW0SGwoXSU1QT1JUX0VO",
"VU1fVU5TUEVDSUZJRUQQABIOCgpJTVBPUlRfRk9PEAcSDgoKSU1QT1JUX0JB",
"UhAIEg4KCklNUE9SVF9CQVoQCUI8Chhjb20uZ29vZ2xlLnByb3RvYnVmLnRl",
"c3RIAfgBAaoCGkdvb2dsZS5Qcm90b2J1Zi5UZXN0UHJvdG9zUABiBnByb3Rv",
"Cixnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfaW1wb3J0X3Byb3RvMy5wcm90",
"bxIYcHJvdG9idWZfdW5pdHRlc3RfaW1wb3J0GjNnb29nbGUvcHJvdG9idWYv",
"dW5pdHRlc3RfaW1wb3J0X3B1YmxpY19wcm90bzMucHJvdG8iGgoNSW1wb3J0",
"TWVzc2FnZRIJCgFkGAEgASgFKlkKCkltcG9ydEVudW0SGwoXSU1QT1JUX0VO",
"VU1fVU5TUEVDSUZJRUQQABIOCgpJTVBPUlRfRk9PEAcSDgoKSU1QT1JUX0JB",
"UhAIEg4KCklNUE9SVF9CQVoQCUI8Chhjb20uZ29vZ2xlLnByb3RvYnVmLnRl",
"c3RIAfgBAaoCGkdvb2dsZS5Qcm90b2J1Zi5UZXN0UHJvdG9zUABiBnByb3Rv",
"Mw=="));
descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
new pbr::FileDescriptor[] { global::Google.Protobuf.TestProtos.UnittestImportPublicProto3.Descriptor, },
@ -76,6 +78,7 @@ namespace Google.Protobuf.TestProtos {
return new ImportMessage(this);
}
/// <summary>Field number for the "d" field.</summary>
public const int DFieldNumber = 1;
private int d_;
public int D {

View File

@ -9,10 +9,12 @@ using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Google.Protobuf.TestProtos {
/// <summary>Holder for reflection information generated from google/protobuf/unittest_import_public_proto3.proto</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class UnittestImportPublicProto3 {
#region Descriptor
/// <summary>File descriptor for google/protobuf/unittest_import_public_proto3.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
@ -21,9 +23,9 @@ namespace Google.Protobuf.TestProtos {
static UnittestImportPublicProto3() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CjNnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfaW1wb3J0X3B1YmxpY19wcm90",
"bzMucHJvdG8SGHByb3RvYnVmX3VuaXR0ZXN0X2ltcG9ydCIgChNQdWJsaWNJ",
"bXBvcnRNZXNzYWdlEgkKAWUYASABKAVCNwoYY29tLmdvb2dsZS5wcm90b2J1",
"CjNnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfaW1wb3J0X3B1YmxpY19wcm90",
"bzMucHJvdG8SGHByb3RvYnVmX3VuaXR0ZXN0X2ltcG9ydCIgChNQdWJsaWNJ",
"bXBvcnRNZXNzYWdlEgkKAWUYASABKAVCNwoYY29tLmdvb2dsZS5wcm90b2J1",
"Zi50ZXN0qgIaR29vZ2xlLlByb3RvYnVmLlRlc3RQcm90b3NiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
new pbr::FileDescriptor[] { },
@ -62,6 +64,7 @@ namespace Google.Protobuf.TestProtos {
return new PublicImportMessage(this);
}
/// <summary>Field number for the "e" field.</summary>
public const int EFieldNumber = 1;
private int e_;
public int E {

View File

@ -9,10 +9,12 @@ using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace UnitTest.Issues.TestProtos {
/// <summary>Holder for reflection information generated from unittest_issues.proto</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class UnittestIssues {
#region Descriptor
/// <summary>File descriptor for unittest_issues.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
@ -21,28 +23,28 @@ namespace UnitTest.Issues.TestProtos {
static UnittestIssues() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"ChV1bml0dGVzdF9pc3N1ZXMucHJvdG8SD3VuaXR0ZXN0X2lzc3VlcyInCghJ",
"c3N1ZTMwNxobCgpOZXN0ZWRPbmNlGg0K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bnVtQgIYASIZCglJdGVtRmllbGQSDAoEaXRlbRgBIAEoBSJECg1SZXNl",
"cnZlZE5hbWVzEg0KBXR5cGVzGAEgASgFEhIKCmRlc2NyaXB0b3IYAiABKAUa",
"EAoOU29tZU5lc3RlZFR5cGUioAEKFVRlc3RKc29uRmllbGRPcmRlcmluZxIT",
"CgtwbGFpbl9pbnQzMhgEIAEoBRITCglvMV9zdHJpbmcYAiABKAlIABISCghv",
"MV9pbnQzMhgFIAEoBUgAEhQKDHBsYWluX3N0cmluZxgBIAEoCRISCghvMl9p",
"bnQzMhgGIAEoBUgBEhMKCW8yX3N0cmluZxgDIAEoCUgBQgQKAm8xQgQKAm8y",
"KlUKDE5lZ2F0aXZlRW51bRIWChJORUdBVElWRV9FTlVNX1pFUk8QABIWCglG",
"aXZlQmVsb3cQ+///////////ARIVCghNaW51c09uZRD///////////8BKi4K",
"DkRlcHJlY2F0ZWRFbnVtEhMKD0RFUFJFQ0FURURfWkVSTxAAEgcKA29uZRAB",
"Qh9IAaoCGlVuaXRUZXN0Lklzc3Vlcy5UZXN0UHJvdG9zYgZwcm90bzM="));
descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
new pbr::FileDescriptor[] { },
@ -74,6 +76,10 @@ namespace UnitTest.Issues.TestProtos {
#endregion
#region Messages
/// <summary>
/// Issue 307: when generating doubly-nested types, any references
/// should be of the form A.Types.B.Types.C.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class Issue307 : pb::IMessage<Issue307> {
private static readonly pb::MessageParser<Issue307> _parser = new pb::MessageParser<Issue307>(() => new Issue307());
@ -149,6 +155,7 @@ namespace UnitTest.Issues.TestProtos {
}
#region Nested types
/// <summary>Container for nested types declared in the Issue307 message type.</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class Types {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
@ -226,6 +233,7 @@ namespace UnitTest.Issues.TestProtos {
}
#region Nested types
/// <summary>Container for nested types declared in the NestedOnce message type.</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class Types {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
@ -343,6 +351,7 @@ namespace UnitTest.Issues.TestProtos {
return new NegativeEnumMessage(this);
}
/// <summary>Field number for the "value" field.</summary>
public const int ValueFieldNumber = 1;
private global::UnitTest.Issues.TestProtos.NegativeEnum value_ = global::UnitTest.Issues.TestProtos.NegativeEnum.NEGATIVE_ENUM_ZERO;
public global::UnitTest.Issues.TestProtos.NegativeEnum Value {
@ -352,6 +361,7 @@ namespace UnitTest.Issues.TestProtos {
}
}
/// <summary>Field number for the "values" field.</summary>
public const int ValuesFieldNumber = 2;
private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.NegativeEnum> _repeated_values_codec
= pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x);
@ -360,6 +370,7 @@ namespace UnitTest.Issues.TestProtos {
get { return values_; }
}
/// <summary>Field number for the "packed_values" field.</summary>
public const int PackedValuesFieldNumber = 3;
private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.NegativeEnum> _repeated_packedValues_codec
= pb::FieldCodec.ForEnum(26, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x);
@ -562,6 +573,7 @@ namespace UnitTest.Issues.TestProtos {
return new DeprecatedFieldsMessage(this);
}
/// <summary>Field number for the "PrimitiveValue" field.</summary>
public const int PrimitiveValueFieldNumber = 1;
private int primitiveValue_;
[global::System.ObsoleteAttribute()]
@ -572,6 +584,7 @@ namespace UnitTest.Issues.TestProtos {
}
}
/// <summary>Field number for the "PrimitiveArray" field.</summary>
public const int PrimitiveArrayFieldNumber = 2;
private static readonly pb::FieldCodec<int> _repeated_primitiveArray_codec
= pb::FieldCodec.ForInt32(18);
@ -581,6 +594,7 @@ namespace UnitTest.Issues.TestProtos {
get { return primitiveArray_; }
}
/// <summary>Field number for the "MessageValue" field.</summary>
public const int MessageValueFieldNumber = 3;
private global::UnitTest.Issues.TestProtos.DeprecatedChild messageValue_;
[global::System.ObsoleteAttribute()]
@ -591,6 +605,7 @@ namespace UnitTest.Issues.TestProtos {
}
}
/// <summary>Field number for the "MessageArray" field.</summary>
public const int MessageArrayFieldNumber = 4;
private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.DeprecatedChild> _repeated_messageArray_codec
= pb::FieldCodec.ForMessage(34, global::UnitTest.Issues.TestProtos.DeprecatedChild.Parser);
@ -600,6 +615,7 @@ namespace UnitTest.Issues.TestProtos {
get { return messageArray_; }
}
/// <summary>Field number for the "EnumValue" field.</summary>
public const int EnumValueFieldNumber = 5;
private global::UnitTest.Issues.TestProtos.DeprecatedEnum enumValue_ = global::UnitTest.Issues.TestProtos.DeprecatedEnum.DEPRECATED_ZERO;
[global::System.ObsoleteAttribute()]
@ -610,6 +626,7 @@ namespace UnitTest.Issues.TestProtos {
}
}
/// <summary>Field number for the "EnumArray" field.</summary>
public const int EnumArrayFieldNumber = 6;
private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.DeprecatedEnum> _repeated_enumArray_codec
= pb::FieldCodec.ForEnum(50, x => (int) x, x => (global::UnitTest.Issues.TestProtos.DeprecatedEnum) x);
@ -752,6 +769,9 @@ namespace UnitTest.Issues.TestProtos {
}
/// <summary>
/// Issue 45: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=45
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class ItemField : pb::IMessage<ItemField> {
private static readonly pb::MessageParser<ItemField> _parser = new pb::MessageParser<ItemField>(() => new ItemField());
@ -779,6 +799,7 @@ namespace UnitTest.Issues.TestProtos {
return new ItemField(this);
}
/// <summary>Field number for the "item" field.</summary>
public const int ItemFieldNumber = 1;
private int item_;
public int Item {
@ -882,6 +903,7 @@ namespace UnitTest.Issues.TestProtos {
return new ReservedNames(this);
}
/// <summary>Field number for the "types" field.</summary>
public const int Types_FieldNumber = 1;
private int types_;
public int Types_ {
@ -891,6 +913,7 @@ namespace UnitTest.Issues.TestProtos {
}
}
/// <summary>Field number for the "descriptor" field.</summary>
public const int Descriptor_FieldNumber = 2;
private int descriptor_;
public int Descriptor_ {
@ -981,8 +1004,12 @@ namespace UnitTest.Issues.TestProtos {
}
#region Nested types
/// <summary>Container for nested types declared in the ReservedNames message type.</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class Types {
/// <summary>
/// Force a nested type called Types
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class SomeNestedType : pb::IMessage<SomeNestedType> {
private static readonly pb::MessageParser<SomeNestedType> _parser = new pb::MessageParser<SomeNestedType>(() => new SomeNestedType());
@ -1064,6 +1091,18 @@ namespace UnitTest.Issues.TestProtos {
}
/// <summary>
/// These fields are deliberately not declared in numeric
/// order, and the oneof fields aren't contiguous either.
/// This allows for reasonably robust tests of JSON output
/// ordering.
/// TestFieldOrderings in unittest_proto3.proto is similar,
/// but doesn't include oneofs.
/// TODO: Consider adding oneofs to TestFieldOrderings, although
/// that will require fixing other tests in multiple platforms.
/// Alternatively, consider just adding this to
/// unittest_proto3.proto if multiple platforms want it.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class TestJsonFieldOrdering : pb::IMessage<TestJsonFieldOrdering> {
private static readonly pb::MessageParser<TestJsonFieldOrdering> _parser = new pb::MessageParser<TestJsonFieldOrdering>(() => new TestJsonFieldOrdering());
@ -1110,6 +1149,7 @@ namespace UnitTest.Issues.TestProtos {
return new TestJsonFieldOrdering(this);
}
/// <summary>Field number for the "plain_int32" field.</summary>
public const int PlainInt32FieldNumber = 4;
private int plainInt32_;
public int PlainInt32 {
@ -1119,6 +1159,7 @@ namespace UnitTest.Issues.TestProtos {
}
}
/// <summary>Field number for the "o1_string" field.</summary>
public const int O1StringFieldNumber = 2;
public string O1String {
get { return o1Case_ == O1OneofCase.O1String ? (string) o1_ : ""; }
@ -1128,6 +1169,7 @@ namespace UnitTest.Issues.TestProtos {
}
}
/// <summary>Field number for the "o1_int32" field.</summary>
public const int O1Int32FieldNumber = 5;
public int O1Int32 {
get { return o1Case_ == O1OneofCase.O1Int32 ? (int) o1_ : 0; }
@ -1137,6 +1179,7 @@ namespace UnitTest.Issues.TestProtos {
}
}
/// <summary>Field number for the "plain_string" field.</summary>
public const int PlainStringFieldNumber = 1;
private string plainString_ = "";
public string PlainString {
@ -1146,6 +1189,7 @@ namespace UnitTest.Issues.TestProtos {
}
}
/// <summary>Field number for the "o2_int32" field.</summary>
public const int O2Int32FieldNumber = 6;
public int O2Int32 {
get { return o2Case_ == O2OneofCase.O2Int32 ? (int) o2_ : 0; }
@ -1155,6 +1199,7 @@ namespace UnitTest.Issues.TestProtos {
}
}
/// <summary>Field number for the "o2_string" field.</summary>
public const int O2StringFieldNumber = 3;
public string O2String {
get { return o2Case_ == O2OneofCase.O2String ? (string) o2_ : ""; }
@ -1165,6 +1210,7 @@ namespace UnitTest.Issues.TestProtos {
}
private object o1_;
/// <summary>Enum of possible cases for the "o1" oneof.</summary>
public enum O1OneofCase {
None = 0,
O1String = 2,
@ -1181,6 +1227,7 @@ namespace UnitTest.Issues.TestProtos {
}
private object o2_;
/// <summary>Enum of possible cases for the "o2" oneof.</summary>
public enum O2OneofCase {
None = 0,
O2Int32 = 6,

File diff suppressed because it is too large Load Diff

View File

@ -9,10 +9,12 @@ using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Google.Protobuf.TestProtos {
/// <summary>Holder for reflection information generated from google/protobuf/unittest_well_known_types.proto</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class UnittestWellKnownTypes {
#region Descriptor
/// <summary>File descriptor for google/protobuf/unittest_well_known_types.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
@ -21,141 +23,141 @@ namespace Google.Protobuf.TestProtos {
static UnittestWellKnownTypes() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Ci9nb29nbGUvcHJvdG9idWYvdW5pdHRlc3Rfd2VsbF9rbm93bl90eXBlcy5w",
"cm90bxIRcHJvdG9idWZfdW5pdHRlc3QaGWdvb2dsZS9wcm90b2J1Zi9hbnku",
"cHJvdG8aGWdvb2dsZS9wcm90b2J1Zi9hcGkucHJvdG8aHmdvb2dsZS9wcm90",
"b2J1Zi9kdXJhdGlvbi5wcm90bxobZ29vZ2xlL3Byb3RvYnVmL2VtcHR5LnBy",
"b3RvGiBnb29nbGUvcHJvdG9idWYvZmllbGRfbWFzay5wcm90bxokZ29vZ2xl",
"L3Byb3RvYnVmL3NvdXJjZV9jb250ZXh0LnByb3RvGhxnb29nbGUvcHJvdG9i",
"dWYvc3RydWN0LnByb3RvGh9nb29nbGUvcHJvdG9idWYvdGltZXN0YW1wLnBy",
"b3RvGhpnb29nbGUvcHJvdG9idWYvdHlwZS5wcm90bxoeZ29vZ2xlL3Byb3Rv",
"YnVmL3dyYXBwZXJzLnByb3RvIpEHChJUZXN0V2VsbEtub3duVHlwZXMSJwoJ",
"YW55X2ZpZWxkGAEgASgLMhQuZ29vZ2xlLnByb3RvYnVmLkFueRInCglhcGlf",
"ZmllbGQYAiABKAsyFC5nb29nbGUucHJvdG9idWYuQXBpEjEKDmR1cmF0aW9u",
"X2ZpZWxkGAMgASgLMhkuZ29vZ2xlLnByb3RvYnVmLkR1cmF0aW9uEisKC2Vt",
"cHR5X2ZpZWxkGAQgASgLMhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5EjQKEGZp",
"ZWxkX21hc2tfZmllbGQYBSABKAsyGi5nb29nbGUucHJvdG9idWYuRmllbGRN",
"YXNrEjwKFHNvdXJjZV9jb250ZXh0X2ZpZWxkGAYgASgLMh4uZ29vZ2xlLnBy",
"b3RvYnVmLlNvdXJjZUNvbnRleHQSLQoMc3RydWN0X2ZpZWxkGAcgASgLMhcu",
"Z29vZ2xlLnBy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FsdWUYAiABKAsyGy5nb29nbGUucHJvdG9idWYu",
"RmxvYXRWYWx1ZToCOAEaTgoPSW50NjRGaWVsZEVudHJ5EgsKA2tleRgBIAEo",
"BRIqCgV2YWx1ZRgCIAEoCzIbLmdvb2dsZS5wcm90b2J1Zi5JbnQ2NFZhbHVl",
"OgI4ARpQChBVaW50NjRGaWVsZEVudHJ5EgsKA2tleRgBIAEoBRIrCgV2YWx1",
"ZRgCIAEoCzIcLmdvb2dsZS5wcm90b2J1Zi5VSW50NjRWYWx1ZToCOAEaTgoP",
"SW50MzJGaWVsZEVudHJ5EgsKA2tleRgBIAEoBRIqCgV2YWx1ZRgCIAEoCzIb",
"Lmdvb2dsZS5wcm90b2J1Zi5JbnQzMlZhbHVlOgI4ARpQChBVaW50MzJGaWVs",
"ZEVudHJ5EgsKA2tleRgBIAEoBRIrCgV2YWx1ZRgCIAEoCzIcLmdvb2dsZS5w",
"cm90b2J1Zi5VSW50MzJWYWx1ZToCOAEaTAoOQm9vbEZpZWxkRW50cnkSCwoD",
"a2V5GAEgASgFEikKBXZhbHVlGAIgASgLMhouZ29vZ2xlLnByb3RvYnVmLkJv",
"b2xWYWx1ZToCOAEaUAoQU3RyaW5nRmllbGRFbnRyeRILCgNrZXkYASABKAUS",
"KwoFdmFsdWUYAiABKAsyHC5nb29nbGUucHJvdG9idWYuU3RyaW5nVmFsdWU6",
"AjgBGk4KD0J5dGVzRmllbGRFbnRyeRILCgNrZXkYASABKAUSKgoFdmFsdWUY",
"AiABKAsyGy5nb29nbGUucHJvdG9idWYuQnl0ZXNWYWx1ZToCOAFCOQoYY29t",
"Lmdvb2dsZS5wcm90b2J1Zi50ZXN0UAGqAhpHb29nbGUuUHJvdG9idWYuVGVz",
"dFByb3Rvc2IGcHJvdG8z"));
descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.Proto.Any.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Api.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Duration.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Empty.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.FieldMask.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.SourceContext.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Struct.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Timestamp.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Type.Descriptor, global::Google.Protobuf.WellKnownTypes.Wrappers.Descriptor, },
@ -170,6 +172,11 @@ namespace Google.Protobuf.TestProtos {
}
#region Messages
/// <summary>
/// Test that we can include all well-known types.
/// Each wrapper type is included separately, as languages
/// map handle different wrappers in different ways.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class TestWellKnownTypes : pb::IMessage<TestWellKnownTypes> {
private static readonly pb::MessageParser<TestWellKnownTypes> _parser = new pb::MessageParser<TestWellKnownTypes>(() => new TestWellKnownTypes());
@ -214,6 +221,7 @@ namespace Google.Protobuf.TestProtos {
return new TestWellKnownTypes(this);
}
/// <summary>Field number for the "any_field" field.</summary>
public const int AnyFieldFieldNumber = 1;
private global::Google.Protobuf.WellKnownTypes.Any anyField_;
public global::Google.Protobuf.WellKnownTypes.Any AnyField {
@ -223,6 +231,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "api_field" field.</summary>
public const int ApiFieldFieldNumber = 2;
private global::Google.Protobuf.WellKnownTypes.Api apiField_;
public global::Google.Protobuf.WellKnownTypes.Api ApiField {
@ -232,6 +241,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "duration_field" field.</summary>
public const int DurationFieldFieldNumber = 3;
private global::Google.Protobuf.WellKnownTypes.Duration durationField_;
public global::Google.Protobuf.WellKnownTypes.Duration DurationField {
@ -241,6 +251,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "empty_field" field.</summary>
public const int EmptyFieldFieldNumber = 4;
private global::Google.Protobuf.WellKnownTypes.Empty emptyField_;
public global::Google.Protobuf.WellKnownTypes.Empty EmptyField {
@ -250,6 +261,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "field_mask_field" field.</summary>
public const int FieldMaskFieldFieldNumber = 5;
private global::Google.Protobuf.WellKnownTypes.FieldMask fieldMaskField_;
public global::Google.Protobuf.WellKnownTypes.FieldMask FieldMaskField {
@ -259,6 +271,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "source_context_field" field.</summary>
public const int SourceContextFieldFieldNumber = 6;
private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContextField_;
public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContextField {
@ -268,6 +281,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "struct_field" field.</summary>
public const int StructFieldFieldNumber = 7;
private global::Google.Protobuf.WellKnownTypes.Struct structField_;
public global::Google.Protobuf.WellKnownTypes.Struct StructField {
@ -277,6 +291,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "timestamp_field" field.</summary>
public const int TimestampFieldFieldNumber = 8;
private global::Google.Protobuf.WellKnownTypes.Timestamp timestampField_;
public global::Google.Protobuf.WellKnownTypes.Timestamp TimestampField {
@ -286,6 +301,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "type_field" field.</summary>
public const int TypeFieldFieldNumber = 9;
private global::Google.Protobuf.WellKnownTypes.Type typeField_;
public global::Google.Protobuf.WellKnownTypes.Type TypeField {
@ -295,6 +311,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "double_field" field.</summary>
public const int DoubleFieldFieldNumber = 10;
private static readonly pb::FieldCodec<double?> _single_doubleField_codec = pb::FieldCodec.ForStructWrapper<double>(82);
private double? doubleField_;
@ -305,6 +322,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "float_field" field.</summary>
public const int FloatFieldFieldNumber = 11;
private static readonly pb::FieldCodec<float?> _single_floatField_codec = pb::FieldCodec.ForStructWrapper<float>(90);
private float? floatField_;
@ -315,6 +333,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "int64_field" field.</summary>
public const int Int64FieldFieldNumber = 12;
private static readonly pb::FieldCodec<long?> _single_int64Field_codec = pb::FieldCodec.ForStructWrapper<long>(98);
private long? int64Field_;
@ -325,6 +344,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "uint64_field" field.</summary>
public const int Uint64FieldFieldNumber = 13;
private static readonly pb::FieldCodec<ulong?> _single_uint64Field_codec = pb::FieldCodec.ForStructWrapper<ulong>(106);
private ulong? uint64Field_;
@ -335,6 +355,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "int32_field" field.</summary>
public const int Int32FieldFieldNumber = 14;
private static readonly pb::FieldCodec<int?> _single_int32Field_codec = pb::FieldCodec.ForStructWrapper<int>(114);
private int? int32Field_;
@ -345,6 +366,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "uint32_field" field.</summary>
public const int Uint32FieldFieldNumber = 15;
private static readonly pb::FieldCodec<uint?> _single_uint32Field_codec = pb::FieldCodec.ForStructWrapper<uint>(122);
private uint? uint32Field_;
@ -355,6 +377,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "bool_field" field.</summary>
public const int BoolFieldFieldNumber = 16;
private static readonly pb::FieldCodec<bool?> _single_boolField_codec = pb::FieldCodec.ForStructWrapper<bool>(130);
private bool? boolField_;
@ -365,6 +388,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "string_field" field.</summary>
public const int StringFieldFieldNumber = 17;
private static readonly pb::FieldCodec<string> _single_stringField_codec = pb::FieldCodec.ForClassWrapper<string>(138);
private string stringField_;
@ -375,6 +399,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "bytes_field" field.</summary>
public const int BytesFieldFieldNumber = 18;
private static readonly pb::FieldCodec<pb::ByteString> _single_bytesField_codec = pb::FieldCodec.ForClassWrapper<pb::ByteString>(146);
private pb::ByteString bytesField_;
@ -813,6 +838,9 @@ namespace Google.Protobuf.TestProtos {
}
/// <summary>
/// A repeated field for each well-known type.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class RepeatedWellKnownTypes : pb::IMessage<RepeatedWellKnownTypes> {
private static readonly pb::MessageParser<RepeatedWellKnownTypes> _parser = new pb::MessageParser<RepeatedWellKnownTypes>(() => new RepeatedWellKnownTypes());
@ -857,6 +885,7 @@ namespace Google.Protobuf.TestProtos {
return new RepeatedWellKnownTypes(this);
}
/// <summary>Field number for the "any_field" field.</summary>
public const int AnyFieldFieldNumber = 1;
private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Any> _repeated_anyField_codec
= pb::FieldCodec.ForMessage(10, global::Google.Protobuf.WellKnownTypes.Any.Parser);
@ -865,6 +894,7 @@ namespace Google.Protobuf.TestProtos {
get { return anyField_; }
}
/// <summary>Field number for the "api_field" field.</summary>
public const int ApiFieldFieldNumber = 2;
private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Api> _repeated_apiField_codec
= pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Api.Parser);
@ -873,6 +903,7 @@ namespace Google.Protobuf.TestProtos {
get { return apiField_; }
}
/// <summary>Field number for the "duration_field" field.</summary>
public const int DurationFieldFieldNumber = 3;
private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Duration> _repeated_durationField_codec
= pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.Duration.Parser);
@ -881,6 +912,7 @@ namespace Google.Protobuf.TestProtos {
get { return durationField_; }
}
/// <summary>Field number for the "empty_field" field.</summary>
public const int EmptyFieldFieldNumber = 4;
private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Empty> _repeated_emptyField_codec
= pb::FieldCodec.ForMessage(34, global::Google.Protobuf.WellKnownTypes.Empty.Parser);
@ -889,6 +921,7 @@ namespace Google.Protobuf.TestProtos {
get { return emptyField_; }
}
/// <summary>Field number for the "field_mask_field" field.</summary>
public const int FieldMaskFieldFieldNumber = 5;
private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.FieldMask> _repeated_fieldMaskField_codec
= pb::FieldCodec.ForMessage(42, global::Google.Protobuf.WellKnownTypes.FieldMask.Parser);
@ -897,6 +930,7 @@ namespace Google.Protobuf.TestProtos {
get { return fieldMaskField_; }
}
/// <summary>Field number for the "source_context_field" field.</summary>
public const int SourceContextFieldFieldNumber = 6;
private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.SourceContext> _repeated_sourceContextField_codec
= pb::FieldCodec.ForMessage(50, global::Google.Protobuf.WellKnownTypes.SourceContext.Parser);
@ -905,6 +939,7 @@ namespace Google.Protobuf.TestProtos {
get { return sourceContextField_; }
}
/// <summary>Field number for the "struct_field" field.</summary>
public const int StructFieldFieldNumber = 7;
private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Struct> _repeated_structField_codec
= pb::FieldCodec.ForMessage(58, global::Google.Protobuf.WellKnownTypes.Struct.Parser);
@ -913,6 +948,7 @@ namespace Google.Protobuf.TestProtos {
get { return structField_; }
}
/// <summary>Field number for the "timestamp_field" field.</summary>
public const int TimestampFieldFieldNumber = 8;
private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Timestamp> _repeated_timestampField_codec
= pb::FieldCodec.ForMessage(66, global::Google.Protobuf.WellKnownTypes.Timestamp.Parser);
@ -921,6 +957,7 @@ namespace Google.Protobuf.TestProtos {
get { return timestampField_; }
}
/// <summary>Field number for the "type_field" field.</summary>
public const int TypeFieldFieldNumber = 9;
private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Type> _repeated_typeField_codec
= pb::FieldCodec.ForMessage(74, global::Google.Protobuf.WellKnownTypes.Type.Parser);
@ -929,14 +966,19 @@ namespace Google.Protobuf.TestProtos {
get { return typeField_; }
}
/// <summary>Field number for the "double_field" field.</summary>
public const int DoubleFieldFieldNumber = 10;
private static readonly pb::FieldCodec<double?> _repeated_doubleField_codec
= pb::FieldCodec.ForStructWrapper<double>(82);
private readonly pbc::RepeatedField<double?> doubleField_ = new pbc::RepeatedField<double?>();
/// <summary>
/// These don't actually make a lot of sense, but they're not prohibited...
/// </summary>
public pbc::RepeatedField<double?> DoubleField {
get { return doubleField_; }
}
/// <summary>Field number for the "float_field" field.</summary>
public const int FloatFieldFieldNumber = 11;
private static readonly pb::FieldCodec<float?> _repeated_floatField_codec
= pb::FieldCodec.ForStructWrapper<float>(90);
@ -945,6 +987,7 @@ namespace Google.Protobuf.TestProtos {
get { return floatField_; }
}
/// <summary>Field number for the "int64_field" field.</summary>
public const int Int64FieldFieldNumber = 12;
private static readonly pb::FieldCodec<long?> _repeated_int64Field_codec
= pb::FieldCodec.ForStructWrapper<long>(98);
@ -953,6 +996,7 @@ namespace Google.Protobuf.TestProtos {
get { return int64Field_; }
}
/// <summary>Field number for the "uint64_field" field.</summary>
public const int Uint64FieldFieldNumber = 13;
private static readonly pb::FieldCodec<ulong?> _repeated_uint64Field_codec
= pb::FieldCodec.ForStructWrapper<ulong>(106);
@ -961,6 +1005,7 @@ namespace Google.Protobuf.TestProtos {
get { return uint64Field_; }
}
/// <summary>Field number for the "int32_field" field.</summary>
public const int Int32FieldFieldNumber = 14;
private static readonly pb::FieldCodec<int?> _repeated_int32Field_codec
= pb::FieldCodec.ForStructWrapper<int>(114);
@ -969,6 +1014,7 @@ namespace Google.Protobuf.TestProtos {
get { return int32Field_; }
}
/// <summary>Field number for the "uint32_field" field.</summary>
public const int Uint32FieldFieldNumber = 15;
private static readonly pb::FieldCodec<uint?> _repeated_uint32Field_codec
= pb::FieldCodec.ForStructWrapper<uint>(122);
@ -977,6 +1023,7 @@ namespace Google.Protobuf.TestProtos {
get { return uint32Field_; }
}
/// <summary>Field number for the "bool_field" field.</summary>
public const int BoolFieldFieldNumber = 16;
private static readonly pb::FieldCodec<bool?> _repeated_boolField_codec
= pb::FieldCodec.ForStructWrapper<bool>(130);
@ -985,6 +1032,7 @@ namespace Google.Protobuf.TestProtos {
get { return boolField_; }
}
/// <summary>Field number for the "string_field" field.</summary>
public const int StringFieldFieldNumber = 17;
private static readonly pb::FieldCodec<string> _repeated_stringField_codec
= pb::FieldCodec.ForClassWrapper<string>(138);
@ -993,6 +1041,7 @@ namespace Google.Protobuf.TestProtos {
get { return stringField_; }
}
/// <summary>Field number for the "bytes_field" field.</summary>
public const int BytesFieldFieldNumber = 18;
private static readonly pb::FieldCodec<pb::ByteString> _repeated_bytesField_codec
= pb::FieldCodec.ForClassWrapper<pb::ByteString>(146);
@ -1296,6 +1345,7 @@ namespace Google.Protobuf.TestProtos {
return new OneofWellKnownTypes(this);
}
/// <summary>Field number for the "any_field" field.</summary>
public const int AnyFieldFieldNumber = 1;
public global::Google.Protobuf.WellKnownTypes.Any AnyField {
get { return oneofFieldCase_ == OneofFieldOneofCase.AnyField ? (global::Google.Protobuf.WellKnownTypes.Any) oneofField_ : null; }
@ -1305,6 +1355,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "api_field" field.</summary>
public const int ApiFieldFieldNumber = 2;
public global::Google.Protobuf.WellKnownTypes.Api ApiField {
get { return oneofFieldCase_ == OneofFieldOneofCase.ApiField ? (global::Google.Protobuf.WellKnownTypes.Api) oneofField_ : null; }
@ -1314,6 +1365,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "duration_field" field.</summary>
public const int DurationFieldFieldNumber = 3;
public global::Google.Protobuf.WellKnownTypes.Duration DurationField {
get { return oneofFieldCase_ == OneofFieldOneofCase.DurationField ? (global::Google.Protobuf.WellKnownTypes.Duration) oneofField_ : null; }
@ -1323,6 +1375,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "empty_field" field.</summary>
public const int EmptyFieldFieldNumber = 4;
public global::Google.Protobuf.WellKnownTypes.Empty EmptyField {
get { return oneofFieldCase_ == OneofFieldOneofCase.EmptyField ? (global::Google.Protobuf.WellKnownTypes.Empty) oneofField_ : null; }
@ -1332,6 +1385,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "field_mask_field" field.</summary>
public const int FieldMaskFieldFieldNumber = 5;
public global::Google.Protobuf.WellKnownTypes.FieldMask FieldMaskField {
get { return oneofFieldCase_ == OneofFieldOneofCase.FieldMaskField ? (global::Google.Protobuf.WellKnownTypes.FieldMask) oneofField_ : null; }
@ -1341,6 +1395,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "source_context_field" field.</summary>
public const int SourceContextFieldFieldNumber = 6;
public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContextField {
get { return oneofFieldCase_ == OneofFieldOneofCase.SourceContextField ? (global::Google.Protobuf.WellKnownTypes.SourceContext) oneofField_ : null; }
@ -1350,6 +1405,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "struct_field" field.</summary>
public const int StructFieldFieldNumber = 7;
public global::Google.Protobuf.WellKnownTypes.Struct StructField {
get { return oneofFieldCase_ == OneofFieldOneofCase.StructField ? (global::Google.Protobuf.WellKnownTypes.Struct) oneofField_ : null; }
@ -1359,6 +1415,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "timestamp_field" field.</summary>
public const int TimestampFieldFieldNumber = 8;
public global::Google.Protobuf.WellKnownTypes.Timestamp TimestampField {
get { return oneofFieldCase_ == OneofFieldOneofCase.TimestampField ? (global::Google.Protobuf.WellKnownTypes.Timestamp) oneofField_ : null; }
@ -1368,6 +1425,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "type_field" field.</summary>
public const int TypeFieldFieldNumber = 9;
public global::Google.Protobuf.WellKnownTypes.Type TypeField {
get { return oneofFieldCase_ == OneofFieldOneofCase.TypeField ? (global::Google.Protobuf.WellKnownTypes.Type) oneofField_ : null; }
@ -1377,6 +1435,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "double_field" field.</summary>
public const int DoubleFieldFieldNumber = 10;
private static readonly pb::FieldCodec<double?> _oneof_doubleField_codec = pb::FieldCodec.ForStructWrapper<double>(82);
public double? DoubleField {
@ -1387,6 +1446,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "float_field" field.</summary>
public const int FloatFieldFieldNumber = 11;
private static readonly pb::FieldCodec<float?> _oneof_floatField_codec = pb::FieldCodec.ForStructWrapper<float>(90);
public float? FloatField {
@ -1397,6 +1457,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "int64_field" field.</summary>
public const int Int64FieldFieldNumber = 12;
private static readonly pb::FieldCodec<long?> _oneof_int64Field_codec = pb::FieldCodec.ForStructWrapper<long>(98);
public long? Int64Field {
@ -1407,6 +1468,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "uint64_field" field.</summary>
public const int Uint64FieldFieldNumber = 13;
private static readonly pb::FieldCodec<ulong?> _oneof_uint64Field_codec = pb::FieldCodec.ForStructWrapper<ulong>(106);
public ulong? Uint64Field {
@ -1417,6 +1479,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "int32_field" field.</summary>
public const int Int32FieldFieldNumber = 14;
private static readonly pb::FieldCodec<int?> _oneof_int32Field_codec = pb::FieldCodec.ForStructWrapper<int>(114);
public int? Int32Field {
@ -1427,6 +1490,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "uint32_field" field.</summary>
public const int Uint32FieldFieldNumber = 15;
private static readonly pb::FieldCodec<uint?> _oneof_uint32Field_codec = pb::FieldCodec.ForStructWrapper<uint>(122);
public uint? Uint32Field {
@ -1437,6 +1501,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "bool_field" field.</summary>
public const int BoolFieldFieldNumber = 16;
private static readonly pb::FieldCodec<bool?> _oneof_boolField_codec = pb::FieldCodec.ForStructWrapper<bool>(130);
public bool? BoolField {
@ -1447,6 +1512,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "string_field" field.</summary>
public const int StringFieldFieldNumber = 17;
private static readonly pb::FieldCodec<string> _oneof_stringField_codec = pb::FieldCodec.ForClassWrapper<string>(138);
public string StringField {
@ -1457,6 +1523,7 @@ namespace Google.Protobuf.TestProtos {
}
}
/// <summary>Field number for the "bytes_field" field.</summary>
public const int BytesFieldFieldNumber = 18;
private static readonly pb::FieldCodec<pb::ByteString> _oneof_bytesField_codec = pb::FieldCodec.ForClassWrapper<pb::ByteString>(146);
public pb::ByteString BytesField {
@ -1468,6 +1535,7 @@ namespace Google.Protobuf.TestProtos {
}
private object oneofField_;
/// <summary>Enum of possible cases for the "oneof_field" oneof.</summary>
public enum OneofFieldOneofCase {
None = 0,
AnyField = 1,
@ -1876,6 +1944,11 @@ namespace Google.Protobuf.TestProtos {
}
/// <summary>
/// A map field for each well-known type. We only
/// need to worry about the value part of the map being the
/// well-known types, as messages can't be map keys.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class MapWellKnownTypes : pb::IMessage<MapWellKnownTypes> {
private static readonly pb::MessageParser<MapWellKnownTypes> _parser = new pb::MessageParser<MapWellKnownTypes>(() => new MapWellKnownTypes());
@ -1920,6 +1993,7 @@ namespace Google.Protobuf.TestProtos {
return new MapWellKnownTypes(this);
}
/// <summary>Field number for the "any_field" field.</summary>
public const int AnyFieldFieldNumber = 1;
private static readonly pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.Any>.Codec _map_anyField_codec
= new pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.Any>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Any.Parser), 10);
@ -1928,6 +2002,7 @@ namespace Google.Protobuf.TestProtos {
get { return anyField_; }
}
/// <summary>Field number for the "api_field" field.</summary>
public const int ApiFieldFieldNumber = 2;
private static readonly pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.Api>.Codec _map_apiField_codec
= new pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.Api>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Api.Parser), 18);
@ -1936,6 +2011,7 @@ namespace Google.Protobuf.TestProtos {
get { return apiField_; }
}
/// <summary>Field number for the "duration_field" field.</summary>
public const int DurationFieldFieldNumber = 3;
private static readonly pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.Duration>.Codec _map_durationField_codec
= new pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.Duration>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Duration.Parser), 26);
@ -1944,6 +2020,7 @@ namespace Google.Protobuf.TestProtos {
get { return durationField_; }
}
/// <summary>Field number for the "empty_field" field.</summary>
public const int EmptyFieldFieldNumber = 4;
private static readonly pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.Empty>.Codec _map_emptyField_codec
= new pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.Empty>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Empty.Parser), 34);
@ -1952,6 +2029,7 @@ namespace Google.Protobuf.TestProtos {
get { return emptyField_; }
}
/// <summary>Field number for the "field_mask_field" field.</summary>
public const int FieldMaskFieldFieldNumber = 5;
private static readonly pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.FieldMask>.Codec _map_fieldMaskField_codec
= new pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.FieldMask>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.FieldMask.Parser), 42);
@ -1960,6 +2038,7 @@ namespace Google.Protobuf.TestProtos {
get { return fieldMaskField_; }
}
/// <summary>Field number for the "source_context_field" field.</summary>
public const int SourceContextFieldFieldNumber = 6;
private static readonly pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.SourceContext>.Codec _map_sourceContextField_codec
= new pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.SourceContext>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.SourceContext.Parser), 50);
@ -1968,6 +2047,7 @@ namespace Google.Protobuf.TestProtos {
get { return sourceContextField_; }
}
/// <summary>Field number for the "struct_field" field.</summary>
public const int StructFieldFieldNumber = 7;
private static readonly pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.Struct>.Codec _map_structField_codec
= new pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.Struct>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Struct.Parser), 58);
@ -1976,6 +2056,7 @@ namespace Google.Protobuf.TestProtos {
get { return structField_; }
}
/// <summary>Field number for the "timestamp_field" field.</summary>
public const int TimestampFieldFieldNumber = 8;
private static readonly pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.Timestamp>.Codec _map_timestampField_codec
= new pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.Timestamp>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Timestamp.Parser), 66);
@ -1984,6 +2065,7 @@ namespace Google.Protobuf.TestProtos {
get { return timestampField_; }
}
/// <summary>Field number for the "type_field" field.</summary>
public const int TypeFieldFieldNumber = 9;
private static readonly pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.Type>.Codec _map_typeField_codec
= new pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.Type>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Type.Parser), 74);
@ -1992,6 +2074,7 @@ namespace Google.Protobuf.TestProtos {
get { return typeField_; }
}
/// <summary>Field number for the "double_field" field.</summary>
public const int DoubleFieldFieldNumber = 10;
private static readonly pbc::MapField<int, double?>.Codec _map_doubleField_codec
= new pbc::MapField<int, double?>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper<double>(18), 82);
@ -2000,6 +2083,7 @@ namespace Google.Protobuf.TestProtos {
get { return doubleField_; }
}
/// <summary>Field number for the "float_field" field.</summary>
public const int FloatFieldFieldNumber = 11;
private static readonly pbc::MapField<int, float?>.Codec _map_floatField_codec
= new pbc::MapField<int, float?>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper<float>(18), 90);
@ -2008,6 +2092,7 @@ namespace Google.Protobuf.TestProtos {
get { return floatField_; }
}
/// <summary>Field number for the "int64_field" field.</summary>
public const int Int64FieldFieldNumber = 12;
private static readonly pbc::MapField<int, long?>.Codec _map_int64Field_codec
= new pbc::MapField<int, long?>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper<long>(18), 98);
@ -2016,6 +2101,7 @@ namespace Google.Protobuf.TestProtos {
get { return int64Field_; }
}
/// <summary>Field number for the "uint64_field" field.</summary>
public const int Uint64FieldFieldNumber = 13;
private static readonly pbc::MapField<int, ulong?>.Codec _map_uint64Field_codec
= new pbc::MapField<int, ulong?>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper<ulong>(18), 106);
@ -2024,6 +2110,7 @@ namespace Google.Protobuf.TestProtos {
get { return uint64Field_; }
}
/// <summary>Field number for the "int32_field" field.</summary>
public const int Int32FieldFieldNumber = 14;
private static readonly pbc::MapField<int, int?>.Codec _map_int32Field_codec
= new pbc::MapField<int, int?>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper<int>(18), 114);
@ -2032,6 +2119,7 @@ namespace Google.Protobuf.TestProtos {
get { return int32Field_; }
}
/// <summary>Field number for the "uint32_field" field.</summary>
public const int Uint32FieldFieldNumber = 15;
private static readonly pbc::MapField<int, uint?>.Codec _map_uint32Field_codec
= new pbc::MapField<int, uint?>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper<uint>(18), 122);
@ -2040,6 +2128,7 @@ namespace Google.Protobuf.TestProtos {
get { return uint32Field_; }
}
/// <summary>Field number for the "bool_field" field.</summary>
public const int BoolFieldFieldNumber = 16;
private static readonly pbc::MapField<int, bool?>.Codec _map_boolField_codec
= new pbc::MapField<int, bool?>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper<bool>(18), 130);
@ -2048,6 +2137,7 @@ namespace Google.Protobuf.TestProtos {
get { return boolField_; }
}
/// <summary>Field number for the "string_field" field.</summary>
public const int StringFieldFieldNumber = 17;
private static readonly pbc::MapField<int, string>.Codec _map_stringField_codec
= new pbc::MapField<int, string>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForClassWrapper<string>(18), 138);
@ -2056,6 +2146,7 @@ namespace Google.Protobuf.TestProtos {
get { return stringField_; }
}
/// <summary>Field number for the "bytes_field" field.</summary>
public const int BytesFieldFieldNumber = 18;
private static readonly pbc::MapField<int, pb::ByteString>.Codec _map_bytesField_codec
= new pbc::MapField<int, pb::ByteString>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForClassWrapper<pb::ByteString>(18), 146);

View File

@ -0,0 +1,66 @@
#region Copyright notice and license
// Protocol Buffers - Google's data interchange format
// Copyright 2015 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endregion
using Google.Protobuf.TestProtos;
using NUnit.Framework;
namespace Google.Protobuf.WellKnownTypes
{
public class AnyTest
{
[Test]
public void Pack()
{
var message = SampleMessages.CreateFullTestAllTypes();
var any = Any.Pack(message);
Assert.AreEqual("type.googleapis.com/protobuf_unittest.TestAllTypes", any.TypeUrl);
Assert.AreEqual(message.CalculateSize(), any.Value.Length);
}
[Test]
public void Unpack_WrongType()
{
var message = SampleMessages.CreateFullTestAllTypes();
var any = Any.Pack(message);
Assert.Throws<InvalidProtocolBufferException>(() => any.Unpack<TestOneof>());
}
[Test]
public void Unpack_Success()
{
var message = SampleMessages.CreateFullTestAllTypes();
var any = Any.Pack(message);
var unpacked = any.Unpack<TestAllTypes>();
Assert.AreEqual(message, unpacked);
}
}
}

View File

@ -38,7 +38,7 @@ using System.IO;
namespace Google.Protobuf
{
/// <summary>
/// Readings and decodes protocol message fields.
/// Reads and decodes protocol message fields.
/// </summary>
/// <remarks>
/// <para>

View File

@ -118,6 +118,7 @@
<Compile Include="Reflection\SingleFieldAccessor.cs" />
<Compile Include="Preconditions.cs" />
<Compile Include="WellKnownTypes\Any.cs" />
<Compile Include="WellKnownTypes\AnyPartial.cs" />
<Compile Include="WellKnownTypes\Api.cs" />
<Compile Include="WellKnownTypes\Duration.cs" />
<Compile Include="WellKnownTypes\DurationPartial.cs" />

View File

@ -96,6 +96,8 @@ namespace Google.Protobuf.Reflection
return descriptor;
}
// dependencies contains direct dependencies and any *public* dependencies
// of those dependencies (transitively)... so we don't need to recurse here.
foreach (FileDescriptor dependency in dependencies)
{
dependency.DescriptorPool.descriptorsByName.TryGetValue(fullName, out result);

File diff suppressed because it is too large Load Diff

View File

@ -252,7 +252,7 @@ namespace Google.Protobuf.Reflection
{
if (fieldType != FieldType.Message)
{
throw new InvalidOperationException("MessageType is only valid for enum fields.");
throw new InvalidOperationException("MessageType is only valid for message fields.");
}
return messageType;
}

View File

@ -11,10 +11,12 @@ namespace Google.Protobuf.WellKnownTypes {
namespace Proto {
/// <summary>Holder for reflection information generated from google/protobuf/any.proto</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class Any {
#region Descriptor
/// <summary>File descriptor for google/protobuf/any.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
@ -23,9 +25,9 @@ namespace Google.Protobuf.WellKnownTypes {
static Any() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYi",
"JgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQksKE2Nv",
"bS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAGgAQGiAgNHUEKqAh5Hb29n",
"Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYi",
"JgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQksKE2Nv",
"bS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAGgAQGiAgNHUEKqAh5Hb29n",
"bGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
new pbr::FileDescriptor[] { },
@ -38,6 +40,33 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
#region Messages
/// <summary>
/// `Any` contains an arbitrary serialized message along with a URL
/// that describes the type of the serialized message.
/// JSON
/// ====
/// The JSON representation of an `Any` value uses the regular
/// representation of the deserialized, embedded message, with an
/// additional field `@type` which contains the type URL. Example:
/// package google.profile;
/// message Person {
/// string first_name = 1;
/// string last_name = 2;
/// }
/// {
/// "@type": "type.googleapis.com/google.profile.Person",
/// "firstName": &lt;string>,
/// "lastName": &lt;string>
/// }
/// If the embedded message type is well-known and has a custom JSON
/// representation, that representation will be embedded adding a field
/// `value` which holds the custom JSON in addition to the the `@type`
/// field. Example (for message [google.protobuf.Duration][google.protobuf.Duration]):
/// {
/// "@type": "type.googleapis.com/google.protobuf.Duration",
/// "value": "1.212s"
/// }
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class Any : pb::IMessage<Any> {
private static readonly pb::MessageParser<Any> _parser = new pb::MessageParser<Any>(() => new Any());
@ -66,8 +95,27 @@ namespace Google.Protobuf.WellKnownTypes {
return new Any(this);
}
/// <summary>Field number for the "type_url" field.</summary>
public const int TypeUrlFieldNumber = 1;
private string typeUrl_ = "";
/// <summary>
/// A URL/resource name whose content describes the type of the
/// serialized message.
/// For URLs which use the schema `http`, `https`, or no schema, the
/// following restrictions and interpretations apply:
/// * If no schema is provided, `https` is assumed.
/// * The last segment of the URL's path must represent the fully
/// qualified name of the type (as in `path/google.protobuf.Duration`).
/// * An HTTP GET on the URL must yield a [google.protobuf.Type][google.protobuf.Type]
/// value in binary format, or produce an error.
/// * Applications are allowed to cache lookup results based on the
/// URL, or have them precompiled into a binary to avoid any
/// lookup. Therefore, binary compatibility needs to be preserved
/// on changes to types. (Use versioned type names to manage
/// breaking changes.)
/// Schemas other than `http`, `https` (or the empty schema) might be
/// used with implementation specific semantics.
/// </summary>
public string TypeUrl {
get { return typeUrl_; }
set {
@ -75,8 +123,12 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
/// <summary>Field number for the "value" field.</summary>
public const int ValueFieldNumber = 2;
private pb::ByteString value_ = pb::ByteString.Empty;
/// <summary>
/// Must be valid serialized data of the above specified type.
/// </summary>
public pb::ByteString Value {
get { return value_; }
set {

View File

@ -0,0 +1,79 @@
#region Copyright notice and license
// Protocol Buffers - Google's data interchange format
// Copyright 2015 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endregion
using Google.Protobuf.Reflection;
namespace Google.Protobuf.WellKnownTypes
{
public partial class Any
{
// This could be moved to MessageDescriptor if we wanted to, but keeping it here means
// all the Any-specific code is in the same place.
private static string GetTypeUrl(MessageDescriptor descriptor)
{
return "type.googleapis.com/" + descriptor.FullName;
}
/// <summary>
/// Unpacks the content of this Any message into the target message type,
/// which must match the type URL within this Any message.
/// </summary>
/// <typeparam name="T">The type of message to unpack the content into.</typeparam>
/// <returns>The unpacked message.</returns>
/// <exception cref="InvalidProtocolBufferException">The target message type doesn't match the type URL in this message</exception>
public T Unpack<T>() where T : IMessage, new()
{
// Note: this doesn't perform as well is it might. We could take a MessageParser<T> in an alternative overload,
// which would be expected to perform slightly better... although the difference is likely to be negligible.
T target = new T();
string targetTypeUrl = GetTypeUrl(target.Descriptor);
if (TypeUrl != targetTypeUrl)
{
throw new InvalidProtocolBufferException(string.Format("Type url for {0} is {1}; Any message's type url is {2}",
target.Descriptor.Name, targetTypeUrl, TypeUrl));
}
target.MergeFrom(Value);
return target;
}
/// <summary>
/// Packs the specified message into an Any message.
/// </summary>
/// <param name="message">The message to pack.</param>
/// <returns>An Any message with the content and type URL of <paramref name="message"/>.</returns>
public static Any Pack(IMessage message)
{
Preconditions.CheckNotNull(message, "message");
return new Any { TypeUrl = GetTypeUrl(message.Descriptor), Value = message.ToByteString() };
}
}
}

View File

@ -11,10 +11,12 @@ namespace Google.Protobuf.WellKnownTypes {
namespace Proto {
/// <summary>Holder for reflection information generated from google/protobuf/api.proto</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class Api {
#region Descriptor
/// <summary>File descriptor for google/protobuf/api.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
@ -23,24 +25,28 @@ namespace Google.Protobuf.WellKnownTypes {
static Api() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Chlnb29nbGUvcHJvdG9idWYvYXBpLnByb3RvEg9nb29nbGUucHJvdG9idWYa",
"JGdvb2dsZS9wcm90b2J1Zi9zb3VyY2VfY29udGV4dC5wcm90bxoaZ29vZ2xl",
"L3Byb3RvYnVmL3R5cGUucHJvdG8isAEKA0FwaRIMCgRuYW1lGAEgASgJEigK",
"B21ldGhvZHMYAiADKAsyFy5nb29nbGUucHJvdG9idWYuTWV0aG9kEigKB29w",
"dGlvbnMYAyADKAsyFy5nb29nbGUucHJvdG9idWYuT3B0aW9uEg8KB3ZlcnNp",
"b24YBCABKAkSNgoOc291cmNlX2NvbnRleHQYBSABKAsyHi5nb29nbGUucHJv",
"dG9idWYuU291cmNlQ29udGV4dCKsAQoGTWV0aG9kEgwKBG5hbWUYASABKAkS",
"GAoQcmVxdWVzdF90eXBlX3VybBgCIAEoCRIZChFyZXF1ZXN0X3N0cmVhbWlu",
"ZxgDIAEoCBIZChFyZXNwb25zZV90eXBlX3VybBgEIAEoCRIaChJyZXNwb25z",
"ZV9zdHJlYW1pbmcYBSABKAgSKAoHb3B0aW9ucxgGIAMoCzIXLmdvb2dsZS5w",
"cm90b2J1Zi5PcHRpb25CSAoTY29tLmdvb2dsZS5wcm90b2J1ZkIIQXBpUHJv",
"dG9QAaICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IG",
"cHJvdG8z"));
"Chlnb29nbGUvcHJvdG9idWYvYXBpLnByb3RvEg9nb29nbGUucHJvdG9idWYa",
"JGdvb2dsZS9wcm90b2J1Zi9zb3VyY2VfY29udGV4dC5wcm90bxoaZ29vZ2xl",
"L3Byb3RvYnVmL3R5cGUucHJvdG8igQIKA0FwaRIMCgRuYW1lGAEgASgJEigK",
"B21ldGhvZHMYAiADKAsyFy5nb29nbGUucHJvdG9idWYuTWV0aG9kEigKB29w",
"dGlvbnMYAyADKAsyFy5nb29nbGUucHJvdG9idWYuT3B0aW9uEg8KB3ZlcnNp",
"b24YBCABKAkSNgoOc291cmNlX2NvbnRleHQYBSABKAsyHi5nb29nbGUucHJv",
"dG9idWYuU291cmNlQ29udGV4dBImCgZtaXhpbnMYBiADKAsyFi5nb29nbGUu",
"cHJvdG9idWYuTWl4aW4SJwoGc3ludGF4GAcgASgOMhcuZ29vZ2xlLnByb3Rv",
"YnVmLlN5bnRheCLVAQoGTWV0aG9kEgwKBG5hbWUYASABKAkSGAoQcmVxdWVz",
"dF90eXBlX3VybBgCIAEoCRIZChFyZXF1ZXN0X3N0cmVhbWluZxgDIAEoCBIZ",
"ChFyZXNwb25zZV90eXBlX3VybBgEIAEoCRIaChJyZXNwb25zZV9zdHJlYW1p",
"bmcYBSABKAgSKAoHb3B0aW9ucxgGIAMoCzIXLmdvb2dsZS5wcm90b2J1Zi5P",
"cHRpb24SJwoGc3ludGF4GAcgASgOMhcuZ29vZ2xlLnByb3RvYnVmLlN5bnRh",
"eCIjCgVNaXhpbhIMCgRuYW1lGAEgASgJEgwKBHJvb3QYAiABKAlCSwoTY29t",
"Lmdvb2dsZS5wcm90b2J1ZkIIQXBpUHJvdG9QAaABAaICA0dQQqoCHkdvb2ds",
"ZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IGcHJvdG8z"));
descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.Proto.SourceContext.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Type.Descriptor, },
new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] {
new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Api), new[]{ "Name", "Methods", "Options", "Version", "SourceContext" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Method), new[]{ "Name", "RequestTypeUrl", "RequestStreaming", "ResponseTypeUrl", "ResponseStreaming", "Options" }, null, null, null)
new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Api), new[]{ "Name", "Methods", "Options", "Version", "SourceContext", "Mixins", "Syntax" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Method), new[]{ "Name", "RequestTypeUrl", "RequestStreaming", "ResponseTypeUrl", "ResponseStreaming", "Options", "Syntax" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Mixin), new[]{ "Name", "Root" }, null, null, null)
}));
}
#endregion
@ -48,6 +54,9 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
#region Messages
/// <summary>
/// Api is a light-weight descriptor for a protocol buffer service.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class Api : pb::IMessage<Api> {
private static readonly pb::MessageParser<Api> _parser = new pb::MessageParser<Api>(() => new Api());
@ -73,14 +82,21 @@ namespace Google.Protobuf.WellKnownTypes {
options_ = other.options_.Clone();
version_ = other.version_;
SourceContext = other.sourceContext_ != null ? other.SourceContext.Clone() : null;
mixins_ = other.mixins_.Clone();
syntax_ = other.syntax_;
}
public Api Clone() {
return new Api(this);
}
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 1;
private string name_ = "";
/// <summary>
/// The fully qualified name of this api, including package name
/// followed by the api's simple name.
/// </summary>
public string Name {
get { return name_; }
set {
@ -88,24 +104,53 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
/// <summary>Field number for the "methods" field.</summary>
public const int MethodsFieldNumber = 2;
private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Method> _repeated_methods_codec
= pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Method.Parser);
private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Method> methods_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Method>();
/// <summary>
/// The methods of this api, in unspecified order.
/// </summary>
public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Method> Methods {
get { return methods_; }
}
/// <summary>Field number for the "options" field.</summary>
public const int OptionsFieldNumber = 3;
private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Option> _repeated_options_codec
= pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.Option.Parser);
private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> options_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option>();
/// <summary>
/// Any metadata attached to the API.
/// </summary>
public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> Options {
get { return options_; }
}
/// <summary>Field number for the "version" field.</summary>
public const int VersionFieldNumber = 4;
private string version_ = "";
/// <summary>
/// A version string for this api. If specified, must have the form
/// `major-version.minor-version`, as in `1.10`. If the minor version
/// is omitted, it defaults to zero. If the entire version field is
/// empty, the major version is derived from the package name, as
/// outlined below. If the field is not empty, the version in the
/// package name will be verified to be consistent with what is
/// provided here.
/// The versioning schema uses [semantic
/// versioning](http://semver.org) where the major version number
/// indicates a breaking change and the minor version an additive,
/// non-breaking change. Both version numbers are signals to users
/// what to expect from different versions, and should be carefully
/// chosen based on the product plan.
/// The major version is also reflected in the package name of the
/// API, which must end in `v&lt;major-version>`, as in
/// `google.feature.v1`. For major versions 0 and 1, the suffix can
/// be omitted. Zero major versions must only be used for
/// experimental, none-GA apis.
/// </summary>
public string Version {
get { return version_; }
set {
@ -113,8 +158,13 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
/// <summary>Field number for the "source_context" field.</summary>
public const int SourceContextFieldNumber = 5;
private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContext_;
/// <summary>
/// Source context for the protocol buffer service represented by this
/// message.
/// </summary>
public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContext {
get { return sourceContext_; }
set {
@ -122,6 +172,31 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
/// <summary>Field number for the "mixins" field.</summary>
public const int MixinsFieldNumber = 6;
private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Mixin> _repeated_mixins_codec
= pb::FieldCodec.ForMessage(50, global::Google.Protobuf.WellKnownTypes.Mixin.Parser);
private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Mixin> mixins_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Mixin>();
/// <summary>
/// Included APIs. See [Mixin][].
/// </summary>
public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Mixin> Mixins {
get { return mixins_; }
}
/// <summary>Field number for the "syntax" field.</summary>
public const int SyntaxFieldNumber = 7;
private global::Google.Protobuf.WellKnownTypes.Syntax syntax_ = global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2;
/// <summary>
/// The source syntax of the service.
/// </summary>
public global::Google.Protobuf.WellKnownTypes.Syntax Syntax {
get { return syntax_; }
set {
syntax_ = value;
}
}
public override bool Equals(object other) {
return Equals(other as Api);
}
@ -138,6 +213,8 @@ namespace Google.Protobuf.WellKnownTypes {
if(!options_.Equals(other.options_)) return false;
if (Version != other.Version) return false;
if (!object.Equals(SourceContext, other.SourceContext)) return false;
if(!mixins_.Equals(other.mixins_)) return false;
if (Syntax != other.Syntax) return false;
return true;
}
@ -148,6 +225,8 @@ namespace Google.Protobuf.WellKnownTypes {
hash ^= options_.GetHashCode();
if (Version.Length != 0) hash ^= Version.GetHashCode();
if (sourceContext_ != null) hash ^= SourceContext.GetHashCode();
hash ^= mixins_.GetHashCode();
if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) hash ^= Syntax.GetHashCode();
return hash;
}
@ -170,6 +249,11 @@ namespace Google.Protobuf.WellKnownTypes {
output.WriteRawTag(42);
output.WriteMessage(SourceContext);
}
mixins_.WriteTo(output, _repeated_mixins_codec);
if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) {
output.WriteRawTag(56);
output.WriteEnum((int) Syntax);
}
}
public int CalculateSize() {
@ -185,6 +269,10 @@ namespace Google.Protobuf.WellKnownTypes {
if (sourceContext_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(SourceContext);
}
size += mixins_.CalculateSize(_repeated_mixins_codec);
if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Syntax);
}
return size;
}
@ -206,6 +294,10 @@ namespace Google.Protobuf.WellKnownTypes {
}
SourceContext.MergeFrom(other.SourceContext);
}
mixins_.Add(other.mixins_);
if (other.Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) {
Syntax = other.Syntax;
}
}
public void MergeFrom(pb::CodedInputStream input) {
@ -238,12 +330,23 @@ namespace Google.Protobuf.WellKnownTypes {
input.ReadMessage(sourceContext_);
break;
}
case 50: {
mixins_.AddEntriesFrom(input, _repeated_mixins_codec);
break;
}
case 56: {
syntax_ = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum();
break;
}
}
}
}
}
/// <summary>
/// Method represents a method of an api.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class Method : pb::IMessage<Method> {
private static readonly pb::MessageParser<Method> _parser = new pb::MessageParser<Method>(() => new Method());
@ -270,14 +373,19 @@ namespace Google.Protobuf.WellKnownTypes {
responseTypeUrl_ = other.responseTypeUrl_;
responseStreaming_ = other.responseStreaming_;
options_ = other.options_.Clone();
syntax_ = other.syntax_;
}
public Method Clone() {
return new Method(this);
}
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 1;
private string name_ = "";
/// <summary>
/// The simple name of this method.
/// </summary>
public string Name {
get { return name_; }
set {
@ -285,8 +393,12 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
/// <summary>Field number for the "request_type_url" field.</summary>
public const int RequestTypeUrlFieldNumber = 2;
private string requestTypeUrl_ = "";
/// <summary>
/// A URL of the input message type.
/// </summary>
public string RequestTypeUrl {
get { return requestTypeUrl_; }
set {
@ -294,8 +406,12 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
/// <summary>Field number for the "request_streaming" field.</summary>
public const int RequestStreamingFieldNumber = 3;
private bool requestStreaming_;
/// <summary>
/// If true, the request is streamed.
/// </summary>
public bool RequestStreaming {
get { return requestStreaming_; }
set {
@ -303,8 +419,12 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
/// <summary>Field number for the "response_type_url" field.</summary>
public const int ResponseTypeUrlFieldNumber = 4;
private string responseTypeUrl_ = "";
/// <summary>
/// The URL of the output message type.
/// </summary>
public string ResponseTypeUrl {
get { return responseTypeUrl_; }
set {
@ -312,8 +432,12 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
/// <summary>Field number for the "response_streaming" field.</summary>
public const int ResponseStreamingFieldNumber = 5;
private bool responseStreaming_;
/// <summary>
/// If true, the response is streamed.
/// </summary>
public bool ResponseStreaming {
get { return responseStreaming_; }
set {
@ -321,14 +445,31 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
/// <summary>Field number for the "options" field.</summary>
public const int OptionsFieldNumber = 6;
private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Option> _repeated_options_codec
= pb::FieldCodec.ForMessage(50, global::Google.Protobuf.WellKnownTypes.Option.Parser);
private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> options_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option>();
/// <summary>
/// Any metadata attached to the method.
/// </summary>
public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> Options {
get { return options_; }
}
/// <summary>Field number for the "syntax" field.</summary>
public const int SyntaxFieldNumber = 7;
private global::Google.Protobuf.WellKnownTypes.Syntax syntax_ = global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2;
/// <summary>
/// The source syntax of this method.
/// </summary>
public global::Google.Protobuf.WellKnownTypes.Syntax Syntax {
get { return syntax_; }
set {
syntax_ = value;
}
}
public override bool Equals(object other) {
return Equals(other as Method);
}
@ -346,6 +487,7 @@ namespace Google.Protobuf.WellKnownTypes {
if (ResponseTypeUrl != other.ResponseTypeUrl) return false;
if (ResponseStreaming != other.ResponseStreaming) return false;
if(!options_.Equals(other.options_)) return false;
if (Syntax != other.Syntax) return false;
return true;
}
@ -357,6 +499,7 @@ namespace Google.Protobuf.WellKnownTypes {
if (ResponseTypeUrl.Length != 0) hash ^= ResponseTypeUrl.GetHashCode();
if (ResponseStreaming != false) hash ^= ResponseStreaming.GetHashCode();
hash ^= options_.GetHashCode();
if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) hash ^= Syntax.GetHashCode();
return hash;
}
@ -386,6 +529,10 @@ namespace Google.Protobuf.WellKnownTypes {
output.WriteBool(ResponseStreaming);
}
options_.WriteTo(output, _repeated_options_codec);
if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) {
output.WriteRawTag(56);
output.WriteEnum((int) Syntax);
}
}
public int CalculateSize() {
@ -406,6 +553,9 @@ namespace Google.Protobuf.WellKnownTypes {
size += 1 + 1;
}
size += options_.CalculateSize(_repeated_options_codec);
if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Syntax);
}
return size;
}
@ -429,6 +579,9 @@ namespace Google.Protobuf.WellKnownTypes {
ResponseStreaming = other.ResponseStreaming;
}
options_.Add(other.options_);
if (other.Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) {
Syntax = other.Syntax;
}
}
public void MergeFrom(pb::CodedInputStream input) {
@ -462,6 +615,211 @@ namespace Google.Protobuf.WellKnownTypes {
options_.AddEntriesFrom(input, _repeated_options_codec);
break;
}
case 56: {
syntax_ = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum();
break;
}
}
}
}
}
/// <summary>
/// Declares an API to be included in this API. The including API must
/// redeclare all the methods from the included API, but documentation
/// and options are inherited as follows:
/// - If after comment and whitespace stripping, the documentation
/// string of the redeclared method is empty, it will be inherited
/// from the original method.
/// - Each annotation belonging to the service config (http,
/// visibility) which is not set in the redeclared method will be
/// inherited.
/// - If an http annotation is inherited, the path pattern will be
/// modified as follows. Any version prefix will be replaced by the
/// version of the including API plus the [root][] path if specified.
/// Example of a simple mixin:
/// package google.acl.v1;
/// service AccessControl {
/// // Get the underlying ACL object.
/// rpc GetAcl(GetAclRequest) returns (Acl) {
/// option (google.api.http).get = "/v1/{resource=**}:getAcl";
/// }
/// }
/// package google.storage.v2;
/// service Storage {
/// // (-- see AccessControl.GetAcl --)
/// rpc GetAcl(GetAclRequest) returns (Acl);
/// // Get a data record.
/// rpc GetData(GetDataRequest) returns (Data) {
/// option (google.api.http).get = "/v2/{resource=**}";
/// }
/// }
/// Example of a mixin configuration:
/// apis:
/// - name: google.storage.v2.Storage
/// mixins:
/// - name: google.acl.v1.AccessControl
/// The mixin construct implies that all methods in `AccessControl` are
/// also declared with same name and request/response types in
/// `Storage`. A documentation generator or annotation processor will
/// see the effective `Storage.GetAcl` method after inherting
/// documentation and annotations as follows:
/// service Storage {
/// // Get the underlying ACL object.
/// rpc GetAcl(GetAclRequest) returns (Acl) {
/// option (google.api.http).get = "/v2/{resource=**}:getAcl";
/// }
/// ...
/// }
/// Note how the version in the path pattern changed from `v1` to `v2`.
/// If the `root` field in the mixin is specified, it should be a
/// relative path under which inherited HTTP paths are placed. Example:
/// apis:
/// - name: google.storage.v2.Storage
/// mixins:
/// - name: google.acl.v1.AccessControl
/// root: acls
/// This implies the following inherited HTTP annotation:
/// service Storage {
/// // Get the underlying ACL object.
/// rpc GetAcl(GetAclRequest) returns (Acl) {
/// option (google.api.http).get = "/v2/acls/{resource=**}:getAcl";
/// }
/// ...
/// }
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class Mixin : pb::IMessage<Mixin> {
private static readonly pb::MessageParser<Mixin> _parser = new pb::MessageParser<Mixin>(() => new Mixin());
public static pb::MessageParser<Mixin> Parser { get { return _parser; } }
public static pbr::MessageDescriptor Descriptor {
get { return global::Google.Protobuf.WellKnownTypes.Proto.Api.Descriptor.MessageTypes[2]; }
}
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
public Mixin() {
OnConstruction();
}
partial void OnConstruction();
public Mixin(Mixin other) : this() {
name_ = other.name_;
root_ = other.root_;
}
public Mixin Clone() {
return new Mixin(this);
}
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 1;
private string name_ = "";
/// <summary>
/// The fully qualified name of the API which is included.
/// </summary>
public string Name {
get { return name_; }
set {
name_ = pb::Preconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "root" field.</summary>
public const int RootFieldNumber = 2;
private string root_ = "";
/// <summary>
/// If non-empty specifies a path under which inherited HTTP paths
/// are rooted.
/// </summary>
public string Root {
get { return root_; }
set {
root_ = pb::Preconditions.CheckNotNull(value, "value");
}
}
public override bool Equals(object other) {
return Equals(other as Mixin);
}
public bool Equals(Mixin other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Name != other.Name) return false;
if (Root != other.Root) return false;
return true;
}
public override int GetHashCode() {
int hash = 1;
if (Name.Length != 0) hash ^= Name.GetHashCode();
if (Root.Length != 0) hash ^= Root.GetHashCode();
return hash;
}
public override string ToString() {
return pb::JsonFormatter.Default.Format(this);
}
public void WriteTo(pb::CodedOutputStream output) {
if (Name.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Name);
}
if (Root.Length != 0) {
output.WriteRawTag(18);
output.WriteString(Root);
}
}
public int CalculateSize() {
int size = 0;
if (Name.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
}
if (Root.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Root);
}
return size;
}
public void MergeFrom(Mixin other) {
if (other == null) {
return;
}
if (other.Name.Length != 0) {
Name = other.Name;
}
if (other.Root.Length != 0) {
Root = other.Root;
}
}
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
Name = input.ReadString();
break;
}
case 18: {
Root = input.ReadString();
break;
}
}
}
}

View File

@ -11,10 +11,12 @@ namespace Google.Protobuf.WellKnownTypes {
namespace Proto {
/// <summary>Holder for reflection information generated from google/protobuf/duration.proto</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class Duration {
#region Descriptor
/// <summary>File descriptor for google/protobuf/duration.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
@ -23,10 +25,10 @@ namespace Google.Protobuf.WellKnownTypes {
static Duration() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Ch5nb29nbGUvcHJvdG9idWYvZHVyYXRpb24ucHJvdG8SD2dvb2dsZS5wcm90",
"b2J1ZiIqCghEdXJhdGlvbhIPCgdzZWNvbmRzGAEgASgDEg0KBW5hbm9zGAIg",
"ASgFQlAKE2NvbS5nb29nbGUucHJvdG9idWZCDUR1cmF0aW9uUHJvdG9QAaAB",
"AaICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IGcHJv",
"Ch5nb29nbGUvcHJvdG9idWYvZHVyYXRpb24ucHJvdG8SD2dvb2dsZS5wcm90",
"b2J1ZiIqCghEdXJhdGlvbhIPCgdzZWNvbmRzGAEgASgDEg0KBW5hbm9zGAIg",
"ASgFQlAKE2NvbS5nb29nbGUucHJvdG9idWZCDUR1cmF0aW9uUHJvdG9QAaAB",
"AaICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IGcHJv",
"dG8z"));
descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
new pbr::FileDescriptor[] { },
@ -39,6 +41,40 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
#region Messages
/// <summary>
/// A Duration represents a signed, fixed-length span of time represented
/// as a count of seconds and fractions of seconds at nanosecond
/// resolution. It is independent of any calendar and concepts like "day"
/// or "month". It is related to Timestamp in that the difference between
/// two Timestamp values is a Duration and it can be added or subtracted
/// from a Timestamp. Range is approximately +-10,000 years.
/// Example 1: Compute Duration from two Timestamps in pseudo code.
/// Timestamp start = ...;
/// Timestamp end = ...;
/// Duration duration = ...;
/// duration.seconds = end.seconds - start.seconds;
/// duration.nanos = end.nanos - start.nanos;
/// if (duration.seconds &lt; 0 &amp;&amp; duration.nanos > 0) {
/// duration.seconds += 1;
/// duration.nanos -= 1000000000;
/// } else if (durations.seconds > 0 &amp;&amp; duration.nanos &lt; 0) {
/// duration.seconds -= 1;
/// duration.nanos += 1000000000;
/// }
/// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
/// Timestamp start = ...;
/// Duration duration = ...;
/// Timestamp end = ...;
/// end.seconds = start.seconds + duration.seconds;
/// end.nanos = start.nanos + duration.nanos;
/// if (end.nanos &lt; 0) {
/// end.seconds -= 1;
/// end.nanos += 1000000000;
/// } else if (end.nanos >= 1000000000) {
/// end.seconds += 1;
/// end.nanos -= 1000000000;
/// }
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class Duration : pb::IMessage<Duration> {
private static readonly pb::MessageParser<Duration> _parser = new pb::MessageParser<Duration>(() => new Duration());
@ -67,8 +103,13 @@ namespace Google.Protobuf.WellKnownTypes {
return new Duration(this);
}
/// <summary>Field number for the "seconds" field.</summary>
public const int SecondsFieldNumber = 1;
private long seconds_;
/// <summary>
/// Signed seconds of the span of time. Must be from -315,576,000,000
/// to +315,576,000,000 inclusive.
/// </summary>
public long Seconds {
get { return seconds_; }
set {
@ -76,8 +117,17 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
/// <summary>Field number for the "nanos" field.</summary>
public const int NanosFieldNumber = 2;
private int nanos_;
/// <summary>
/// Signed fractions of a second at nanosecond resolution of the span
/// of time. Durations less than one second are represented with a 0
/// `seconds` field and a positive or negative `nanos` field. For durations
/// of one second or more, a non-zero value for the `nanos` field must be
/// of the same sign as the `seconds` field. Must be from -999,999,999
/// to +999,999,999 inclusive.
/// </summary>
public int Nanos {
get { return nanos_; }
set {

View File

@ -11,10 +11,12 @@ namespace Google.Protobuf.WellKnownTypes {
namespace Proto {
/// <summary>Holder for reflection information generated from google/protobuf/empty.proto</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class Empty {
#region Descriptor
/// <summary>File descriptor for google/protobuf/empty.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
@ -23,10 +25,10 @@ namespace Google.Protobuf.WellKnownTypes {
static Empty() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Chtnb29nbGUvcHJvdG9idWYvZW1wdHkucHJvdG8SD2dvb2dsZS5wcm90b2J1",
"ZiIHCgVFbXB0eUJKChNjb20uZ29vZ2xlLnByb3RvYnVmQgpFbXB0eVByb3Rv",
"UAGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnBy",
"b3RvMw=="));
"Chtnb29nbGUvcHJvdG9idWYvZW1wdHkucHJvdG8SD2dvb2dsZS5wcm90b2J1",
"ZiIHCgVFbXB0eUJNChNjb20uZ29vZ2xlLnByb3RvYnVmQgpFbXB0eVByb3Rv",
"UAGgAQGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNi",
"BnByb3RvMw=="));
descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] {
@ -38,6 +40,15 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
#region Messages
/// <summary>
/// A generic empty message that you can re-use to avoid defining duplicated
/// empty messages in your APIs. A typical example is to use it as the request
/// or the response type of an API method. For instance:
/// service Foo {
/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
/// }
/// The JSON representation for `Empty` is empty JSON object `{}`.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class Empty : pb::IMessage<Empty> {
private static readonly pb::MessageParser<Empty> _parser = new pb::MessageParser<Empty>(() => new Empty());

View File

@ -11,10 +11,12 @@ namespace Google.Protobuf.WellKnownTypes {
namespace Proto {
/// <summary>Holder for reflection information generated from google/protobuf/field_mask.proto</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class FieldMask {
#region Descriptor
/// <summary>File descriptor for google/protobuf/field_mask.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
@ -23,10 +25,10 @@ namespace Google.Protobuf.WellKnownTypes {
static FieldMask() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CiBnb29nbGUvcHJvdG9idWYvZmllbGRfbWFzay5wcm90bxIPZ29vZ2xlLnBy",
"b3RvYnVmIhoKCUZpZWxkTWFzaxINCgVwYXRocxgBIAMoCUJOChNjb20uZ29v",
"Z2xlLnByb3RvYnVmQg5GaWVsZE1hc2tQcm90b1ABogIDR1BCqgIeR29vZ2xl",
"LlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM="));
"CiBnb29nbGUvcHJvdG9idWYvZmllbGRfbWFzay5wcm90bxIPZ29vZ2xlLnBy",
"b3RvYnVmIhoKCUZpZWxkTWFzaxINCgVwYXRocxgBIAMoCUJRChNjb20uZ29v",
"Z2xlLnByb3RvYnVmQg5GaWVsZE1hc2tQcm90b1ABoAEBogIDR1BCqgIeR29v",
"Z2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM="));
descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] {
@ -38,6 +40,103 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
#region Messages
/// <summary>
/// `FieldMask` represents a set of symbolic field paths, for example:
/// paths: "f.a"
/// paths: "f.b.d"
/// Here `f` represents a field in some root message, `a` and `b`
/// fields in the message found in `f`, and `d` a field found in the
/// message in `f.b`.
/// Field masks are used to specify a subset of fields that should be
/// returned by a get operation or modified by an update operation.
/// Field masks also have a custom JSON encoding (see below).
/// # Field Masks in Projections
/// When used in the context of a projection, a response message or
/// sub-message is filtered by the API to only contain those fields as
/// specified in the mask. For example, if the mask in the previous
/// example is applied to a response message as follows:
/// f {
/// a : 22
/// b {
/// d : 1
/// x : 2
/// }
/// y : 13
/// }
/// z: 8
/// The result will not contain specific values for fields x,y and z
/// (there value will be set to the default, and omitted in proto text
/// output):
/// f {
/// a : 22
/// b {
/// d : 1
/// }
/// }
/// A repeated field is not allowed except at the last position of a
/// field mask.
/// If a FieldMask object is not present in a get operation, the
/// operation applies to all fields (as if a FieldMask of all fields
/// had been specified).
/// Note that a field mask does not necessarily applies to the
/// top-level response message. In case of a REST get operation, the
/// field mask applies directly to the response, but in case of a REST
/// list operation, the mask instead applies to each individual message
/// in the returned resource list. In case of a REST custom method,
/// other definitions may be used. Where the mask applies will be
/// clearly documented together with its declaration in the API. In
/// any case, the effect on the returned resource/resources is required
/// behavior for APIs.
/// # Field Masks in Update Operations
/// A field mask in update operations specifies which fields of the
/// targeted resource are going to be updated. The API is required
/// to only change the values of the fields as specified in the mask
/// and leave the others untouched. If a resource is passed in to
/// describe the updated values, the API ignores the values of all
/// fields not covered by the mask.
/// In order to reset a field's value to the default, the field must
/// be in the mask and set to the default value in the provided resource.
/// Hence, in order to reset all fields of a resource, provide a default
/// instance of the resource and set all fields in the mask, or do
/// not provide a mask as described below.
/// If a field mask is not present on update, the operation applies to
/// all fields (as if a field mask of all fields has been specified).
/// Note that in the presence of schema evolution, this may mean that
/// fields the client does not know and has therefore not filled into
/// the request will be reset to their default. If this is unwanted
/// behavior, a specific service may require a client to always specify
/// a field mask, producing an error if not.
/// As with get operations, the location of the resource which
/// describes the updated values in the request message depends on the
/// operation kind. In any case, the effect of the field mask is
/// required to be honored by the API.
/// ## Considerations for HTTP REST
/// The HTTP kind of an update operation which uses a field mask must
/// be set to PATCH instead of PUT in order to satisfy HTTP semantics
/// (PUT must only be used for full updates).
/// # JSON Encoding of Field Masks
/// In JSON, a field mask is encoded as a single string where paths are
/// separated by a comma. Fields name in each path are converted
/// to/from lower-camel naming conventions.
/// As an example, consider the following message declarations:
/// message Profile {
/// User user = 1;
/// Photo photo = 2;
/// }
/// message User {
/// string display_name = 1;
/// string address = 2;
/// }
/// In proto a field mask for `Profile` may look as such:
/// mask {
/// paths: "user.display_name"
/// paths: "photo"
/// }
/// In JSON, the same mask is represented as below:
/// {
/// mask: "user.displayName,photo"
/// }
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class FieldMask : pb::IMessage<FieldMask> {
private static readonly pb::MessageParser<FieldMask> _parser = new pb::MessageParser<FieldMask>(() => new FieldMask());
@ -65,10 +164,14 @@ namespace Google.Protobuf.WellKnownTypes {
return new FieldMask(this);
}
/// <summary>Field number for the "paths" field.</summary>
public const int PathsFieldNumber = 1;
private static readonly pb::FieldCodec<string> _repeated_paths_codec
= pb::FieldCodec.ForString(10);
private readonly pbc::RepeatedField<string> paths_ = new pbc::RepeatedField<string>();
/// <summary>
/// The set of field mask paths.
/// </summary>
public pbc::RepeatedField<string> Paths {
get { return paths_; }
}

View File

@ -11,10 +11,12 @@ namespace Google.Protobuf.WellKnownTypes {
namespace Proto {
/// <summary>Holder for reflection information generated from google/protobuf/source_context.proto</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class SourceContext {
#region Descriptor
/// <summary>File descriptor for google/protobuf/source_context.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
@ -23,11 +25,11 @@ namespace Google.Protobuf.WellKnownTypes {
static SourceContext() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CiRnb29nbGUvcHJvdG9idWYvc291cmNlX2NvbnRleHQucHJvdG8SD2dvb2ds",
"ZS5wcm90b2J1ZiIiCg1Tb3VyY2VDb250ZXh0EhEKCWZpbGVfbmFtZRgBIAEo",
"CUJSChNjb20uZ29vZ2xlLnByb3RvYnVmQhJTb3VyY2VDb250ZXh0UHJvdG9Q",
"AaICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IGcHJv",
"dG8z"));
"CiRnb29nbGUvcHJvdG9idWYvc291cmNlX2NvbnRleHQucHJvdG8SD2dvb2ds",
"ZS5wcm90b2J1ZiIiCg1Tb3VyY2VDb250ZXh0EhEKCWZpbGVfbmFtZRgBIAEo",
"CUJVChNjb20uZ29vZ2xlLnByb3RvYnVmQhJTb3VyY2VDb250ZXh0UHJvdG9Q",
"AaABAaICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IG",
"cHJvdG8z"));
descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] {
@ -39,6 +41,10 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
#region Messages
/// <summary>
/// `SourceContext` represents information about the source of a
/// protobuf element, like the file in which it is defined.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class SourceContext : pb::IMessage<SourceContext> {
private static readonly pb::MessageParser<SourceContext> _parser = new pb::MessageParser<SourceContext>(() => new SourceContext());
@ -66,8 +72,13 @@ namespace Google.Protobuf.WellKnownTypes {
return new SourceContext(this);
}
/// <summary>Field number for the "file_name" field.</summary>
public const int FileNameFieldNumber = 1;
private string fileName_ = "";
/// <summary>
/// The path-qualified name of the .proto file that contained the associated
/// protobuf element. For example: `"google/protobuf/source.proto"`.
/// </summary>
public string FileName {
get { return fileName_; }
set {

View File

@ -11,10 +11,12 @@ namespace Google.Protobuf.WellKnownTypes {
namespace Proto {
/// <summary>Holder for reflection information generated from google/protobuf/struct.proto</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class Struct {
#region Descriptor
/// <summary>File descriptor for google/protobuf/struct.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
@ -23,19 +25,19 @@ namespace Google.Protobuf.WellKnownTypes {
static Struct() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Chxnb29nbGUvcHJvdG9idWYvc3RydWN0LnByb3RvEg9nb29nbGUucHJvdG9i",
"dWYihAEKBlN0cnVjdBIzCgZmaWVsZHMYASADKAsyIy5nb29nbGUucHJvdG9i",
"dWYuU3RydWN0LkZpZWxkc0VudHJ5GkUKC0ZpZWxkc0VudHJ5EgsKA2tleRgB",
"IAEoCRIlCgV2YWx1ZRgCIAEoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZToC",
"OAEi6gEKBVZhbHVlEjAKCm51bGxfdmFsdWUYASABKA4yGi5nb29nbGUucHJv",
"dG9idWYuTnVsbFZhbHVlSAASFgoMbnVtYmVyX3ZhbHVlGAIgASgBSAASFgoM",
"c3RyaW5nX3ZhbHVlGAMgASgJSAASFAoKYm9vbF92YWx1ZRgEIAEoCEgAEi8K",
"DHN0cnVjdF92YWx1ZRgFIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3RI",
"ABIwCgpsaXN0X3ZhbHVlGAYgASgLMhouZ29vZ2xlLnByb3RvYnVmLkxpc3RW",
"YWx1ZUgAQgYKBGtpbmQiMwoJTGlzdFZhbHVlEiYKBnZhbHVlcxgBIAMoCzIW",
"Lmdvb2dsZS5wcm90b2J1Zi5WYWx1ZSobCglOdWxsVmFsdWUSDgoKTlVMTF9W",
"QUxVRRAAQk4KE2NvbS5nb29nbGUucHJvdG9idWZCC1N0cnVjdFByb3RvUAGg",
"AQGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnBy",
"Chxnb29nbGUvcHJvdG9idWYvc3RydWN0LnByb3RvEg9nb29nbGUucHJvdG9i",
"dWYihAEKBlN0cnVjdBIzCgZmaWVsZHMYASADKAsyIy5nb29nbGUucHJvdG9i",
"dWYuU3RydWN0LkZpZWxkc0VudHJ5GkUKC0ZpZWxkc0VudHJ5EgsKA2tleRgB",
"IAEoCRIlCgV2YWx1ZRgCIAEoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZToC",
"OAEi6gEKBVZhbHVlEjAKCm51bGxfdmFsdWUYASABKA4yGi5nb29nbGUucHJv",
"dG9idWYuTnVsbFZhbHVlSAASFgoMbnVtYmVyX3ZhbHVlGAIgASgBSAASFgoM",
"c3RyaW5nX3ZhbHVlGAMgASgJSAASFAoKYm9vbF92YWx1ZRgEIAEoCEgAEi8K",
"DHN0cnVjdF92YWx1ZRgFIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3RI",
"ABIwCgpsaXN0X3ZhbHVlGAYgASgLMhouZ29vZ2xlLnByb3RvYnVmLkxpc3RW",
"YWx1ZUgAQgYKBGtpbmQiMwoJTGlzdFZhbHVlEiYKBnZhbHVlcxgBIAMoCzIW",
"Lmdvb2dsZS5wcm90b2J1Zi5WYWx1ZSobCglOdWxsVmFsdWUSDgoKTlVMTF9W",
"QUxVRRAAQk4KE2NvbS5nb29nbGUucHJvdG9idWZCC1N0cnVjdFByb3RvUAGg",
"AQGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnBy",
"b3RvMw=="));
descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
new pbr::FileDescriptor[] { },
@ -50,13 +52,30 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
#region Enums
/// <summary>
/// `NullValue` is a singleton enumeration to represent the null value for the
/// `Value` type union.
/// The JSON representation for `NullValue` is JSON `null`.
/// </summary>
public enum NullValue {
/// <summary>
/// Null value.
/// </summary>
NULL_VALUE = 0,
}
#endregion
#region Messages
/// <summary>
/// `Struct` represents a structured data value, consisting of fields
/// which map to dynamically typed values. In some languages, `Struct`
/// might be supported by a native representation. For example, in
/// scripting languages like JS a struct is represented as an
/// object. The details of that representation are described together
/// with the proto support for the language.
/// The JSON representation for `Struct` is JSON object.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class Struct : pb::IMessage<Struct> {
private static readonly pb::MessageParser<Struct> _parser = new pb::MessageParser<Struct>(() => new Struct());
@ -84,10 +103,14 @@ namespace Google.Protobuf.WellKnownTypes {
return new Struct(this);
}
/// <summary>Field number for the "fields" field.</summary>
public const int FieldsFieldNumber = 1;
private static readonly pbc::MapField<string, global::Google.Protobuf.WellKnownTypes.Value>.Codec _map_fields_codec
= new pbc::MapField<string, global::Google.Protobuf.WellKnownTypes.Value>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Value.Parser), 10);
private readonly pbc::MapField<string, global::Google.Protobuf.WellKnownTypes.Value> fields_ = new pbc::MapField<string, global::Google.Protobuf.WellKnownTypes.Value>();
/// <summary>
/// Map of dynamically typed values.
/// </summary>
public pbc::MapField<string, global::Google.Protobuf.WellKnownTypes.Value> Fields {
get { return fields_; }
}
@ -151,6 +174,13 @@ namespace Google.Protobuf.WellKnownTypes {
}
/// <summary>
/// `Value` represents a dynamically typed value which can be either
/// null, a number, a string, a boolean, a recursive struct value, or a
/// list of values. A producer of value is expected to set one of that
/// variants, absence of any variant indicates an error.
/// The JSON representation for `Value` is JSON value.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class Value : pb::IMessage<Value> {
private static readonly pb::MessageParser<Value> _parser = new pb::MessageParser<Value>(() => new Value());
@ -198,7 +228,11 @@ namespace Google.Protobuf.WellKnownTypes {
return new Value(this);
}
/// <summary>Field number for the "null_value" field.</summary>
public const int NullValueFieldNumber = 1;
/// <summary>
/// Represents a null value.
/// </summary>
public global::Google.Protobuf.WellKnownTypes.NullValue NullValue {
get { return kindCase_ == KindOneofCase.NullValue ? (global::Google.Protobuf.WellKnownTypes.NullValue) kind_ : global::Google.Protobuf.WellKnownTypes.NullValue.NULL_VALUE; }
set {
@ -207,7 +241,11 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
/// <summary>Field number for the "number_value" field.</summary>
public const int NumberValueFieldNumber = 2;
/// <summary>
/// Represents a double value.
/// </summary>
public double NumberValue {
get { return kindCase_ == KindOneofCase.NumberValue ? (double) kind_ : 0D; }
set {
@ -216,7 +254,11 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
/// <summary>Field number for the "string_value" field.</summary>
public const int StringValueFieldNumber = 3;
/// <summary>
/// Represents a string value.
/// </summary>
public string StringValue {
get { return kindCase_ == KindOneofCase.StringValue ? (string) kind_ : ""; }
set {
@ -225,7 +267,11 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
/// <summary>Field number for the "bool_value" field.</summary>
public const int BoolValueFieldNumber = 4;
/// <summary>
/// Represents a boolean value.
/// </summary>
public bool BoolValue {
get { return kindCase_ == KindOneofCase.BoolValue ? (bool) kind_ : false; }
set {
@ -234,7 +280,11 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
/// <summary>Field number for the "struct_value" field.</summary>
public const int StructValueFieldNumber = 5;
/// <summary>
/// Represents a structured value.
/// </summary>
public global::Google.Protobuf.WellKnownTypes.Struct StructValue {
get { return kindCase_ == KindOneofCase.StructValue ? (global::Google.Protobuf.WellKnownTypes.Struct) kind_ : null; }
set {
@ -243,7 +293,11 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
/// <summary>Field number for the "list_value" field.</summary>
public const int ListValueFieldNumber = 6;
/// <summary>
/// Represents a repeated `Value`.
/// </summary>
public global::Google.Protobuf.WellKnownTypes.ListValue ListValue {
get { return kindCase_ == KindOneofCase.ListValue ? (global::Google.Protobuf.WellKnownTypes.ListValue) kind_ : null; }
set {
@ -253,6 +307,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
private object kind_;
/// <summary>Enum of possible cases for the "kind" oneof.</summary>
public enum KindOneofCase {
None = 0,
NullValue = 1,
@ -432,6 +487,10 @@ namespace Google.Protobuf.WellKnownTypes {
}
/// <summary>
/// `ListValue` is a wrapper around a repeated field of values.
/// The JSON representation for `ListValue` is JSON array.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class ListValue : pb::IMessage<ListValue> {
private static readonly pb::MessageParser<ListValue> _parser = new pb::MessageParser<ListValue>(() => new ListValue());
@ -459,10 +518,14 @@ namespace Google.Protobuf.WellKnownTypes {
return new ListValue(this);
}
/// <summary>Field number for the "values" field.</summary>
public const int ValuesFieldNumber = 1;
private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Value> _repeated_values_codec
= pb::FieldCodec.ForMessage(10, global::Google.Protobuf.WellKnownTypes.Value.Parser);
private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Value> values_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Value>();
/// <summary>
/// Repeated field of dynamically typed values.
/// </summary>
public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Value> Values {
get { return values_; }
}

View File

@ -11,10 +11,12 @@ namespace Google.Protobuf.WellKnownTypes {
namespace Proto {
/// <summary>Holder for reflection information generated from google/protobuf/timestamp.proto</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class Timestamp {
#region Descriptor
/// <summary>File descriptor for google/protobuf/timestamp.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
@ -23,10 +25,10 @@ namespace Google.Protobuf.WellKnownTypes {
static Timestamp() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Ch9nb29nbGUvcHJvdG9idWYvdGltZXN0YW1wLnByb3RvEg9nb29nbGUucHJv",
"dG9idWYiKwoJVGltZXN0YW1wEg8KB3NlY29uZHMYASABKAMSDQoFbmFub3MY",
"AiABKAVCUQoTY29tLmdvb2dsZS5wcm90b2J1ZkIOVGltZXN0YW1wUHJvdG9Q",
"AaABAaICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IG",
"Ch9nb29nbGUvcHJvdG9idWYvdGltZXN0YW1wLnByb3RvEg9nb29nbGUucHJv",
"dG9idWYiKwoJVGltZXN0YW1wEg8KB3NlY29uZHMYASABKAMSDQoFbmFub3MY",
"AiABKAVCUQoTY29tLmdvb2dsZS5wcm90b2J1ZkIOVGltZXN0YW1wUHJvdG9Q",
"AaABAaICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IG",
"cHJvdG8z"));
descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
new pbr::FileDescriptor[] { },
@ -39,6 +41,47 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
#region Messages
/// <summary>
/// A Timestamp represents a point in time independent of any time zone
/// or calendar, represented as seconds and fractions of seconds at
/// nanosecond resolution in UTC Epoch time. It is encoded using the
/// Proleptic Gregorian Calendar which extends the Gregorian calendar
/// backwards to year one. It is encoded assuming all minutes are 60
/// seconds long, i.e. leap seconds are "smeared" so that no leap second
/// table is needed for interpretation. Range is from
/// 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.
/// By restricting to that range, we ensure that we can convert to
/// and from RFC 3339 date strings.
/// See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt).
/// Example 1: Compute Timestamp from POSIX `time()`.
/// Timestamp timestamp;
/// timestamp.set_seconds(time(NULL));
/// timestamp.set_nanos(0);
/// Example 2: Compute Timestamp from POSIX `gettimeofday()`.
/// struct timeval tv;
/// gettimeofday(&amp;tv, NULL);
/// Timestamp timestamp;
/// timestamp.set_seconds(tv.tv_sec);
/// timestamp.set_nanos(tv.tv_usec * 1000);
/// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
/// FILETIME ft;
/// GetSystemTimeAsFileTime(&amp;ft);
/// UINT64 ticks = (((UINT64)ft.dwHighDateTime) &lt;&lt; 32) | ft.dwLowDateTime;
/// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
/// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
/// Timestamp timestamp;
/// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
/// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
/// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
/// long millis = System.currentTimeMillis();
/// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
/// .setNanos((int) ((millis % 1000) * 1000000)).build();
/// Example 5: Compute Timestamp from current time in Python.
/// now = time.time()
/// seconds = int(now)
/// nanos = int((now - seconds) * 10**9)
/// timestamp = Timestamp(seconds=seconds, nanos=nanos)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class Timestamp : pb::IMessage<Timestamp> {
private static readonly pb::MessageParser<Timestamp> _parser = new pb::MessageParser<Timestamp>(() => new Timestamp());
@ -67,8 +110,14 @@ namespace Google.Protobuf.WellKnownTypes {
return new Timestamp(this);
}
/// <summary>Field number for the "seconds" field.</summary>
public const int SecondsFieldNumber = 1;
private long seconds_;
/// <summary>
/// Represents seconds of UTC time since Unix epoch
/// 1970-01-01T00:00:00Z. Must be from from 0001-01-01T00:00:00Z to
/// 9999-12-31T23:59:59Z inclusive.
/// </summary>
public long Seconds {
get { return seconds_; }
set {
@ -76,8 +125,15 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
/// <summary>Field number for the "nanos" field.</summary>
public const int NanosFieldNumber = 2;
private int nanos_;
/// <summary>
/// Non-negative fractions of a second at nanosecond resolution. Negative
/// second values with fractions must still have non-negative nanos values
/// that count forward in time. Must be from 0 to 999,999,999
/// inclusive.
/// </summary>
public int Nanos {
get { return nanos_; }
set {

View File

@ -11,10 +11,12 @@ namespace Google.Protobuf.WellKnownTypes {
namespace Proto {
/// <summary>Holder for reflection information generated from google/protobuf/type.proto</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class Type {
#region Descriptor
/// <summary>File descriptor for google/protobuf/type.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
@ -23,43 +25,46 @@ namespace Google.Protobuf.WellKnownTypes {
static Type() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Chpnb29nbGUvcHJvdG9idWYvdHlwZS5wcm90bxIPZ29vZ2xlLnByb3RvYnVm",
"Ghlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvGiRnb29nbGUvcHJvdG9idWYv",
"c291cmNlX2NvbnRleHQucHJvdG8irgEKBFR5cGUSDAoEbmFtZRgBIAEoCRIm",
"CgZmaWVsZHMYAiADKAsyFi5nb29nbGUucHJvdG9idWYuRmllbGQSDgoGb25l",
"b2ZzGAMgAygJEigKB29wdGlvbnMYBCADKAsyFy5nb29nbGUucHJvdG9idWYu",
"T3B0aW9uEjYKDnNvdXJjZV9jb250ZXh0GAUgASgLMh4uZ29vZ2xlLnByb3Rv",
"YnVmLlNvdXJjZUNvbnRleHQimwUKBUZpZWxkEikKBGtpbmQYASABKA4yGy5n",
"b29nbGUucHJvdG9idWYuRmllbGQuS2luZBI3CgtjYXJkaW5hbGl0eRgCIAEo",
"DjIiLmdvb2dsZS5wcm90b2J1Zi5GaWVsZC5DYXJkaW5hbGl0eRIOCgZudW1i",
"ZXIYAyABKAUSDAoEbmFtZRgEIAEoCRIQCgh0eXBlX3VybBgGIAEoCRITCgtv",
"bmVvZl9pbmRleBgHIAEoBRIOCgZwYWNrZWQYCCABKAgSKAoHb3B0aW9ucxgJ",
"IAMoCzIXLmdvb2dsZS5wcm90b2J1Zi5PcHRpb24iuAIKBEtpbmQSEAoMVFlQ",
"RV9VTktOT1dOEAASDwoL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AgNHUEKqAh5H",
"b29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.Proto.Any.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.SourceContext.Descriptor, },
new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] {
new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Type), new[]{ "Name", "Fields", "Oneofs", "Options", "SourceContext" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Field), new[]{ "Kind", "Cardinality", "Number", "Name", "TypeUrl", "OneofIndex", "Packed", "Options" }, null, new[]{ typeof(global::Google.Protobuf.WellKnownTypes.Field.Types.Kind), typeof(global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality) }, null),
new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Enum), new[]{ "Name", "Enumvalue", "Options", "SourceContext" }, null, null, null),
new pbr::GeneratedCodeInfo(new[] {typeof(global::Google.Protobuf.WellKnownTypes.Syntax), }, new pbr::GeneratedCodeInfo[] {
new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Type), new[]{ "Name", "Fields", "Oneofs", "Options", "SourceContext", "Syntax" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Field), new[]{ "Kind", "Cardinality", "Number", "Name", "TypeUrl", "OneofIndex", "Packed", "Options", "JsonName" }, null, new[]{ typeof(global::Google.Protobuf.WellKnownTypes.Field.Types.Kind), typeof(global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality) }, null),
new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Enum), new[]{ "Name", "Enumvalue", "Options", "SourceContext", "Syntax" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.EnumValue), new[]{ "Name", "Number", "Options" }, null, null, null),
new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Option), new[]{ "Name", "Value" }, null, null, null)
}));
@ -68,7 +73,27 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
#region Enums
/// <summary>
/// Syntax specifies the syntax in which a service element was defined.
/// </summary>
public enum Syntax {
/// <summary>
/// Syntax "proto2"
/// </summary>
SYNTAX_PROTO2 = 0,
/// <summary>
/// Syntax "proto3"
/// </summary>
SYNTAX_PROTO3 = 1,
}
#endregion
#region Messages
/// <summary>
/// A light-weight descriptor for a proto message type.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class Type : pb::IMessage<Type> {
private static readonly pb::MessageParser<Type> _parser = new pb::MessageParser<Type>(() => new Type());
@ -94,14 +119,19 @@ namespace Google.Protobuf.WellKnownTypes {
oneofs_ = other.oneofs_.Clone();
options_ = other.options_.Clone();
SourceContext = other.sourceContext_ != null ? other.SourceContext.Clone() : null;
syntax_ = other.syntax_;
}
public Type Clone() {
return new Type(this);
}
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 1;
private string name_ = "";
/// <summary>
/// The fully qualified message name.
/// </summary>
public string Name {
get { return name_; }
set {
@ -109,32 +139,48 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
/// <summary>Field number for the "fields" field.</summary>
public const int FieldsFieldNumber = 2;
private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Field> _repeated_fields_codec
= pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Field.Parser);
private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Field> fields_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Field>();
/// <summary>
/// The list of fields.
/// </summary>
public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Field> Fields {
get { return fields_; }
}
/// <summary>Field number for the "oneofs" field.</summary>
public const int OneofsFieldNumber = 3;
private static readonly pb::FieldCodec<string> _repeated_oneofs_codec
= pb::FieldCodec.ForString(26);
private readonly pbc::RepeatedField<string> oneofs_ = new pbc::RepeatedField<string>();
/// <summary>
/// The list of oneof definitions.
/// </summary>
public pbc::RepeatedField<string> Oneofs {
get { return oneofs_; }
}
/// <summary>Field number for the "options" field.</summary>
public const int OptionsFieldNumber = 4;
private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Option> _repeated_options_codec
= pb::FieldCodec.ForMessage(34, global::Google.Protobuf.WellKnownTypes.Option.Parser);
private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> options_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option>();
/// <summary>
/// The proto options.
/// </summary>
public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> Options {
get { return options_; }
}
/// <summary>Field number for the "source_context" field.</summary>
public const int SourceContextFieldNumber = 5;
private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContext_;
/// <summary>
/// The source context.
/// </summary>
public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContext {
get { return sourceContext_; }
set {
@ -142,6 +188,19 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
/// <summary>Field number for the "syntax" field.</summary>
public const int SyntaxFieldNumber = 6;
private global::Google.Protobuf.WellKnownTypes.Syntax syntax_ = global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2;
/// <summary>
/// The source syntax.
/// </summary>
public global::Google.Protobuf.WellKnownTypes.Syntax Syntax {
get { return syntax_; }
set {
syntax_ = value;
}
}
public override bool Equals(object other) {
return Equals(other as Type);
}
@ -158,6 +217,7 @@ namespace Google.Protobuf.WellKnownTypes {
if(!oneofs_.Equals(other.oneofs_)) return false;
if(!options_.Equals(other.options_)) return false;
if (!object.Equals(SourceContext, other.SourceContext)) return false;
if (Syntax != other.Syntax) return false;
return true;
}
@ -168,6 +228,7 @@ namespace Google.Protobuf.WellKnownTypes {
hash ^= oneofs_.GetHashCode();
hash ^= options_.GetHashCode();
if (sourceContext_ != null) hash ^= SourceContext.GetHashCode();
if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) hash ^= Syntax.GetHashCode();
return hash;
}
@ -187,6 +248,10 @@ namespace Google.Protobuf.WellKnownTypes {
output.WriteRawTag(42);
output.WriteMessage(SourceContext);
}
if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) {
output.WriteRawTag(48);
output.WriteEnum((int) Syntax);
}
}
public int CalculateSize() {
@ -200,6 +265,9 @@ namespace Google.Protobuf.WellKnownTypes {
if (sourceContext_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(SourceContext);
}
if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Syntax);
}
return size;
}
@ -219,6 +287,9 @@ namespace Google.Protobuf.WellKnownTypes {
}
SourceContext.MergeFrom(other.SourceContext);
}
if (other.Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) {
Syntax = other.Syntax;
}
}
public void MergeFrom(pb::CodedInputStream input) {
@ -251,12 +322,19 @@ namespace Google.Protobuf.WellKnownTypes {
input.ReadMessage(sourceContext_);
break;
}
case 48: {
syntax_ = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum();
break;
}
}
}
}
}
/// <summary>
/// Field represents a single field of a message type.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class Field : pb::IMessage<Field> {
private static readonly pb::MessageParser<Field> _parser = new pb::MessageParser<Field>(() => new Field());
@ -285,14 +363,19 @@ namespace Google.Protobuf.WellKnownTypes {
oneofIndex_ = other.oneofIndex_;
packed_ = other.packed_;
options_ = other.options_.Clone();
jsonName_ = other.jsonName_;
}
public Field Clone() {
return new Field(this);
}
/// <summary>Field number for the "kind" field.</summary>
public const int KindFieldNumber = 1;
private global::Google.Protobuf.WellKnownTypes.Field.Types.Kind kind_ = global::Google.Protobuf.WellKnownTypes.Field.Types.Kind.TYPE_UNKNOWN;
/// <summary>
/// The field kind.
/// </summary>
public global::Google.Protobuf.WellKnownTypes.Field.Types.Kind Kind {
get { return kind_; }
set {
@ -300,8 +383,12 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
/// <summary>Field number for the "cardinality" field.</summary>
public const int CardinalityFieldNumber = 2;
private global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality cardinality_ = global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality.CARDINALITY_UNKNOWN;
/// <summary>
/// The field cardinality, i.e. optional/required/repeated.
/// </summary>
public global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality Cardinality {
get { return cardinality_; }
set {
@ -309,8 +396,12 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
/// <summary>Field number for the "number" field.</summary>
public const int NumberFieldNumber = 3;
private int number_;
/// <summary>
/// The proto field number.
/// </summary>
public int Number {
get { return number_; }
set {
@ -318,8 +409,12 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 4;
private string name_ = "";
/// <summary>
/// The field name.
/// </summary>
public string Name {
get { return name_; }
set {
@ -327,8 +422,13 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
/// <summary>Field number for the "type_url" field.</summary>
public const int TypeUrlFieldNumber = 6;
private string typeUrl_ = "";
/// <summary>
/// The type URL (without the scheme) when the type is MESSAGE or ENUM,
/// such as `type.googleapis.com/google.protobuf.Empty`.
/// </summary>
public string TypeUrl {
get { return typeUrl_; }
set {
@ -336,8 +436,12 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
/// <summary>Field number for the "oneof_index" field.</summary>
public const int OneofIndexFieldNumber = 7;
private int oneofIndex_;
/// <summary>
/// Index in Type.oneofs. Starts at 1. Zero means no oneof mapping.
/// </summary>
public int OneofIndex {
get { return oneofIndex_; }
set {
@ -345,8 +449,12 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
/// <summary>Field number for the "packed" field.</summary>
public const int PackedFieldNumber = 8;
private bool packed_;
/// <summary>
/// Whether to use alternative packed wire representation.
/// </summary>
public bool Packed {
get { return packed_; }
set {
@ -354,14 +462,31 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
/// <summary>Field number for the "options" field.</summary>
public const int OptionsFieldNumber = 9;
private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Option> _repeated_options_codec
= pb::FieldCodec.ForMessage(74, global::Google.Protobuf.WellKnownTypes.Option.Parser);
private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> options_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option>();
/// <summary>
/// The proto options.
/// </summary>
public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> Options {
get { return options_; }
}
/// <summary>Field number for the "json_name" field.</summary>
public const int JsonNameFieldNumber = 10;
private string jsonName_ = "";
/// <summary>
/// The JSON name for this field.
/// </summary>
public string JsonName {
get { return jsonName_; }
set {
jsonName_ = pb::Preconditions.CheckNotNull(value, "value");
}
}
public override bool Equals(object other) {
return Equals(other as Field);
}
@ -381,6 +506,7 @@ namespace Google.Protobuf.WellKnownTypes {
if (OneofIndex != other.OneofIndex) return false;
if (Packed != other.Packed) return false;
if(!options_.Equals(other.options_)) return false;
if (JsonName != other.JsonName) return false;
return true;
}
@ -394,6 +520,7 @@ namespace Google.Protobuf.WellKnownTypes {
if (OneofIndex != 0) hash ^= OneofIndex.GetHashCode();
if (Packed != false) hash ^= Packed.GetHashCode();
hash ^= options_.GetHashCode();
if (JsonName.Length != 0) hash ^= JsonName.GetHashCode();
return hash;
}
@ -431,6 +558,10 @@ namespace Google.Protobuf.WellKnownTypes {
output.WriteBool(Packed);
}
options_.WriteTo(output, _repeated_options_codec);
if (JsonName.Length != 0) {
output.WriteRawTag(82);
output.WriteString(JsonName);
}
}
public int CalculateSize() {
@ -457,6 +588,9 @@ namespace Google.Protobuf.WellKnownTypes {
size += 1 + 1;
}
size += options_.CalculateSize(_repeated_options_codec);
if (JsonName.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(JsonName);
}
return size;
}
@ -486,6 +620,9 @@ namespace Google.Protobuf.WellKnownTypes {
Packed = other.Packed;
}
options_.Add(other.options_);
if (other.JsonName.Length != 0) {
JsonName = other.JsonName;
}
}
public void MergeFrom(pb::CodedInputStream input) {
@ -527,38 +664,120 @@ namespace Google.Protobuf.WellKnownTypes {
options_.AddEntriesFrom(input, _repeated_options_codec);
break;
}
case 82: {
JsonName = input.ReadString();
break;
}
}
}
}
#region Nested types
/// <summary>Container for nested types declared in the Field message type.</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class Types {
/// <summary>
/// Kind represents a basic field type.
/// </summary>
public enum Kind {
/// <summary>
/// Field type unknown.
/// </summary>
TYPE_UNKNOWN = 0,
/// <summary>
/// Field type double.
/// </summary>
TYPE_DOUBLE = 1,
/// <summary>
/// Field type float.
/// </summary>
TYPE_FLOAT = 2,
/// <summary>
/// Field type int64.
/// </summary>
TYPE_INT64 = 3,
/// <summary>
/// Field type uint64.
/// </summary>
TYPE_UINT64 = 4,
/// <summary>
/// Field type int32.
/// </summary>
TYPE_INT32 = 5,
/// <summary>
/// Field type fixed64.
/// </summary>
TYPE_FIXED64 = 6,
/// <summary>
/// Field type fixed32.
/// </summary>
TYPE_FIXED32 = 7,
/// <summary>
/// Field type bool.
/// </summary>
TYPE_BOOL = 8,
/// <summary>
/// Field type string.
/// </summary>
TYPE_STRING = 9,
/// <summary>
/// Field type group (deprecated proto2 type)
/// </summary>
TYPE_GROUP = 10,
/// <summary>
/// Field type message.
/// </summary>
TYPE_MESSAGE = 11,
/// <summary>
/// Field type bytes.
/// </summary>
TYPE_BYTES = 12,
/// <summary>
/// Field type uint32.
/// </summary>
TYPE_UINT32 = 13,
/// <summary>
/// Field type enum.
/// </summary>
TYPE_ENUM = 14,
/// <summary>
/// Field type sfixed32.
/// </summary>
TYPE_SFIXED32 = 15,
/// <summary>
/// Field type sfixed64.
/// </summary>
TYPE_SFIXED64 = 16,
/// <summary>
/// Field type sint32.
/// </summary>
TYPE_SINT32 = 17,
/// <summary>
/// Field type sint64.
/// </summary>
TYPE_SINT64 = 18,
}
/// <summary>
/// Cardinality represents whether a field is optional, required, or
/// repeated.
/// </summary>
public enum Cardinality {
/// <summary>
/// The field cardinality is unknown. Typically an error condition.
/// </summary>
CARDINALITY_UNKNOWN = 0,
/// <summary>
/// For optional fields.
/// </summary>
CARDINALITY_OPTIONAL = 1,
/// <summary>
/// For required fields. Not used for proto3.
/// </summary>
CARDINALITY_REQUIRED = 2,
/// <summary>
/// For repeated fields.
/// </summary>
CARDINALITY_REPEATED = 3,
}
@ -567,6 +786,9 @@ namespace Google.Protobuf.WellKnownTypes {
}
/// <summary>
/// Enum type definition.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class Enum : pb::IMessage<Enum> {
private static readonly pb::MessageParser<Enum> _parser = new pb::MessageParser<Enum>(() => new Enum());
@ -591,14 +813,19 @@ namespace Google.Protobuf.WellKnownTypes {
enumvalue_ = other.enumvalue_.Clone();
options_ = other.options_.Clone();
SourceContext = other.sourceContext_ != null ? other.SourceContext.Clone() : null;
syntax_ = other.syntax_;
}
public Enum Clone() {
return new Enum(this);
}
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 1;
private string name_ = "";
/// <summary>
/// Enum type name.
/// </summary>
public string Name {
get { return name_; }
set {
@ -606,24 +833,36 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
/// <summary>Field number for the "enumvalue" field.</summary>
public const int EnumvalueFieldNumber = 2;
private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.EnumValue> _repeated_enumvalue_codec
= pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.EnumValue.Parser);
private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.EnumValue> enumvalue_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.EnumValue>();
/// <summary>
/// Enum value definitions.
/// </summary>
public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.EnumValue> Enumvalue {
get { return enumvalue_; }
}
/// <summary>Field number for the "options" field.</summary>
public const int OptionsFieldNumber = 3;
private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Option> _repeated_options_codec
= pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.Option.Parser);
private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> options_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option>();
/// <summary>
/// Proto options for the enum type.
/// </summary>
public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> Options {
get { return options_; }
}
/// <summary>Field number for the "source_context" field.</summary>
public const int SourceContextFieldNumber = 4;
private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContext_;
/// <summary>
/// The source context.
/// </summary>
public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContext {
get { return sourceContext_; }
set {
@ -631,6 +870,19 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
/// <summary>Field number for the "syntax" field.</summary>
public const int SyntaxFieldNumber = 5;
private global::Google.Protobuf.WellKnownTypes.Syntax syntax_ = global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2;
/// <summary>
/// The source syntax.
/// </summary>
public global::Google.Protobuf.WellKnownTypes.Syntax Syntax {
get { return syntax_; }
set {
syntax_ = value;
}
}
public override bool Equals(object other) {
return Equals(other as Enum);
}
@ -646,6 +898,7 @@ namespace Google.Protobuf.WellKnownTypes {
if(!enumvalue_.Equals(other.enumvalue_)) return false;
if(!options_.Equals(other.options_)) return false;
if (!object.Equals(SourceContext, other.SourceContext)) return false;
if (Syntax != other.Syntax) return false;
return true;
}
@ -655,6 +908,7 @@ namespace Google.Protobuf.WellKnownTypes {
hash ^= enumvalue_.GetHashCode();
hash ^= options_.GetHashCode();
if (sourceContext_ != null) hash ^= SourceContext.GetHashCode();
if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) hash ^= Syntax.GetHashCode();
return hash;
}
@ -673,6 +927,10 @@ namespace Google.Protobuf.WellKnownTypes {
output.WriteRawTag(34);
output.WriteMessage(SourceContext);
}
if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) {
output.WriteRawTag(40);
output.WriteEnum((int) Syntax);
}
}
public int CalculateSize() {
@ -685,6 +943,9 @@ namespace Google.Protobuf.WellKnownTypes {
if (sourceContext_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(SourceContext);
}
if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Syntax);
}
return size;
}
@ -703,6 +964,9 @@ namespace Google.Protobuf.WellKnownTypes {
}
SourceContext.MergeFrom(other.SourceContext);
}
if (other.Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) {
Syntax = other.Syntax;
}
}
public void MergeFrom(pb::CodedInputStream input) {
@ -731,12 +995,19 @@ namespace Google.Protobuf.WellKnownTypes {
input.ReadMessage(sourceContext_);
break;
}
case 40: {
syntax_ = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum();
break;
}
}
}
}
}
/// <summary>
/// Enum value definition.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class EnumValue : pb::IMessage<EnumValue> {
private static readonly pb::MessageParser<EnumValue> _parser = new pb::MessageParser<EnumValue>(() => new EnumValue());
@ -766,8 +1037,12 @@ namespace Google.Protobuf.WellKnownTypes {
return new EnumValue(this);
}
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 1;
private string name_ = "";
/// <summary>
/// Enum value name.
/// </summary>
public string Name {
get { return name_; }
set {
@ -775,8 +1050,12 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
/// <summary>Field number for the "number" field.</summary>
public const int NumberFieldNumber = 2;
private int number_;
/// <summary>
/// Enum value number.
/// </summary>
public int Number {
get { return number_; }
set {
@ -784,10 +1063,14 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
/// <summary>Field number for the "options" field.</summary>
public const int OptionsFieldNumber = 3;
private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Option> _repeated_options_codec
= pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.Option.Parser);
private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> options_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option>();
/// <summary>
/// Proto options for the enum value.
/// </summary>
public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> Options {
get { return options_; }
}
@ -883,6 +1166,9 @@ namespace Google.Protobuf.WellKnownTypes {
}
/// <summary>
/// Proto option attached to messages/fields/enums etc.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class Option : pb::IMessage<Option> {
private static readonly pb::MessageParser<Option> _parser = new pb::MessageParser<Option>(() => new Option());
@ -911,8 +1197,12 @@ namespace Google.Protobuf.WellKnownTypes {
return new Option(this);
}
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 1;
private string name_ = "";
/// <summary>
/// Proto option name.
/// </summary>
public string Name {
get { return name_; }
set {
@ -920,8 +1210,12 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
/// <summary>Field number for the "value" field.</summary>
public const int ValueFieldNumber = 2;
private global::Google.Protobuf.WellKnownTypes.Any value_;
/// <summary>
/// Proto option value.
/// </summary>
public global::Google.Protobuf.WellKnownTypes.Any Value {
get { return value_; }
set {

View File

@ -9,10 +9,12 @@ using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Google.Protobuf.WellKnownTypes {
/// <summary>Holder for reflection information generated from google/protobuf/wrappers.proto</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class Wrappers {
#region Descriptor
/// <summary>File descriptor for google/protobuf/wrappers.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
@ -21,15 +23,15 @@ namespace Google.Protobuf.WellKnownTypes {
static Wrappers() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Ch5nb29nbGUvcHJvdG9idWYvd3JhcHBlcnMucHJvdG8SD2dvb2dsZS5wcm90",
"b2J1ZiIcCgtEb3VibGVWYWx1ZRINCgV2YWx1ZRgBIAEoASIbCgpGbG9hdFZh",
"bHVlEg0KBXZhbHVlGAEgASgCIhsKCkludDY0VmFsdWUSDQoFdmFsdWUYASAB",
"KAMiHAoLVUludDY0VmFsdWUSDQoFdmFsdWUYASABKAQiGwoKSW50MzJWYWx1",
"ZRINCgV2YWx1ZRgBIAEoBSIcCgtVSW50MzJWYWx1ZRINCgV2YWx1ZRgBIAEo",
"DSIaCglCb29sVmFsdWUSDQoFdmFsdWUYASABKAgiHAoLU3RyaW5nVmFsdWUS",
"DQoFdmFsdWUYASABKAkiGwoKQnl0ZXNWYWx1ZRINCgV2YWx1ZRgBIAEoDEJN",
"ChNjb20uZ29vZ2xlLnByb3RvYnVmQg1XcmFwcGVyc1Byb3RvUAGiAgNHUEKq",
"Ah5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw=="));
"Ch5nb29nbGUvcHJvdG9idWYvd3JhcHBlcnMucHJvdG8SD2dvb2dsZS5wcm90",
"b2J1ZiIcCgtEb3VibGVWYWx1ZRINCgV2YWx1ZRgBIAEoASIbCgpGbG9hdFZh",
"bHVlEg0KBXZhbHVlGAEgASgCIhsKCkludDY0VmFsdWUSDQoFdmFsdWUYASAB",
"KAMiHAoLVUludDY0VmFsdWUSDQoFdmFsdWUYASABKAQiGwoKSW50MzJWYWx1",
"ZRINCgV2YWx1ZRgBIAEoBSIcCgtVSW50MzJWYWx1ZRINCgV2YWx1ZRgBIAEo",
"DSIaCglCb29sVmFsdWUSDQoFdmFsdWUYASABKAgiHAoLU3RyaW5nVmFsdWUS",
"DQoFdmFsdWUYASABKAkiGwoKQnl0ZXNWYWx1ZRINCgV2YWx1ZRgBIAEoDEJQ",
"ChNjb20uZ29vZ2xlLnByb3RvYnVmQg1XcmFwcGVyc1Byb3RvUAGgAQGiAgNH",
"UEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] {
@ -48,6 +50,10 @@ namespace Google.Protobuf.WellKnownTypes {
}
#region Messages
/// <summary>
/// Wrapper message for `double`.
/// The JSON representation for `DoubleValue` is JSON number.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class DoubleValue : pb::IMessage<DoubleValue> {
private static readonly pb::MessageParser<DoubleValue> _parser = new pb::MessageParser<DoubleValue>(() => new DoubleValue());
@ -75,8 +81,12 @@ namespace Google.Protobuf.WellKnownTypes {
return new DoubleValue(this);
}
/// <summary>Field number for the "value" field.</summary>
public const int ValueFieldNumber = 1;
private double value_;
/// <summary>
/// The double value.
/// </summary>
public double Value {
get { return value_; }
set {
@ -150,6 +160,10 @@ namespace Google.Protobuf.WellKnownTypes {
}
/// <summary>
/// Wrapper message for `float`.
/// The JSON representation for `FloatValue` is JSON number.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class FloatValue : pb::IMessage<FloatValue> {
private static readonly pb::MessageParser<FloatValue> _parser = new pb::MessageParser<FloatValue>(() => new FloatValue());
@ -177,8 +191,12 @@ namespace Google.Protobuf.WellKnownTypes {
return new FloatValue(this);
}
/// <summary>Field number for the "value" field.</summary>
public const int ValueFieldNumber = 1;
private float value_;
/// <summary>
/// The float value.
/// </summary>
public float Value {
get { return value_; }
set {
@ -252,6 +270,10 @@ namespace Google.Protobuf.WellKnownTypes {
}
/// <summary>
/// Wrapper message for `int64`.
/// The JSON representation for `Int64Value` is JSON string.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class Int64Value : pb::IMessage<Int64Value> {
private static readonly pb::MessageParser<Int64Value> _parser = new pb::MessageParser<Int64Value>(() => new Int64Value());
@ -279,8 +301,12 @@ namespace Google.Protobuf.WellKnownTypes {
return new Int64Value(this);
}
/// <summary>Field number for the "value" field.</summary>
public const int ValueFieldNumber = 1;
private long value_;
/// <summary>
/// The int64 value.
/// </summary>
public long Value {
get { return value_; }
set {
@ -354,6 +380,10 @@ namespace Google.Protobuf.WellKnownTypes {
}
/// <summary>
/// Wrapper message for `uint64`.
/// The JSON representation for `UInt64Value` is JSON string.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class UInt64Value : pb::IMessage<UInt64Value> {
private static readonly pb::MessageParser<UInt64Value> _parser = new pb::MessageParser<UInt64Value>(() => new UInt64Value());
@ -381,8 +411,12 @@ namespace Google.Protobuf.WellKnownTypes {
return new UInt64Value(this);
}
/// <summary>Field number for the "value" field.</summary>
public const int ValueFieldNumber = 1;
private ulong value_;
/// <summary>
/// The uint64 value.
/// </summary>
public ulong Value {
get { return value_; }
set {
@ -456,6 +490,10 @@ namespace Google.Protobuf.WellKnownTypes {
}
/// <summary>
/// Wrapper message for `int32`.
/// The JSON representation for `Int32Value` is JSON number.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class Int32Value : pb::IMessage<Int32Value> {
private static readonly pb::MessageParser<Int32Value> _parser = new pb::MessageParser<Int32Value>(() => new Int32Value());
@ -483,8 +521,12 @@ namespace Google.Protobuf.WellKnownTypes {
return new Int32Value(this);
}
/// <summary>Field number for the "value" field.</summary>
public const int ValueFieldNumber = 1;
private int value_;
/// <summary>
/// The int32 value.
/// </summary>
public int Value {
get { return value_; }
set {
@ -558,6 +600,10 @@ namespace Google.Protobuf.WellKnownTypes {
}
/// <summary>
/// Wrapper message for `uint32`.
/// The JSON representation for `UInt32Value` is JSON number.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class UInt32Value : pb::IMessage<UInt32Value> {
private static readonly pb::MessageParser<UInt32Value> _parser = new pb::MessageParser<UInt32Value>(() => new UInt32Value());
@ -585,8 +631,12 @@ namespace Google.Protobuf.WellKnownTypes {
return new UInt32Value(this);
}
/// <summary>Field number for the "value" field.</summary>
public const int ValueFieldNumber = 1;
private uint value_;
/// <summary>
/// The uint32 value.
/// </summary>
public uint Value {
get { return value_; }
set {
@ -660,6 +710,10 @@ namespace Google.Protobuf.WellKnownTypes {
}
/// <summary>
/// Wrapper message for `bool`.
/// The JSON representation for `BoolValue` is JSON `true` and `false`.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class BoolValue : pb::IMessage<BoolValue> {
private static readonly pb::MessageParser<BoolValue> _parser = new pb::MessageParser<BoolValue>(() => new BoolValue());
@ -687,8 +741,12 @@ namespace Google.Protobuf.WellKnownTypes {
return new BoolValue(this);
}
/// <summary>Field number for the "value" field.</summary>
public const int ValueFieldNumber = 1;
private bool value_;
/// <summary>
/// The bool value.
/// </summary>
public bool Value {
get { return value_; }
set {
@ -762,6 +820,10 @@ namespace Google.Protobuf.WellKnownTypes {
}
/// <summary>
/// Wrapper message for `string`.
/// The JSON representation for `StringValue` is JSON string.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class StringValue : pb::IMessage<StringValue> {
private static readonly pb::MessageParser<StringValue> _parser = new pb::MessageParser<StringValue>(() => new StringValue());
@ -789,8 +851,12 @@ namespace Google.Protobuf.WellKnownTypes {
return new StringValue(this);
}
/// <summary>Field number for the "value" field.</summary>
public const int ValueFieldNumber = 1;
private string value_ = "";
/// <summary>
/// The string value.
/// </summary>
public string Value {
get { return value_; }
set {
@ -864,6 +930,10 @@ namespace Google.Protobuf.WellKnownTypes {
}
/// <summary>
/// Wrapper message for `bytes`.
/// The JSON representation for `BytesValue` is JSON string.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class BytesValue : pb::IMessage<BytesValue> {
private static readonly pb::MessageParser<BytesValue> _parser = new pb::MessageParser<BytesValue>(() => new BytesValue());
@ -891,8 +961,12 @@ namespace Google.Protobuf.WellKnownTypes {
return new BytesValue(this);
}
/// <summary>Field number for the "value" field.</summary>
public const int ValueFieldNumber = 1;
private pb::ByteString value_ = pb::ByteString.Empty;
/// <summary>
/// The bytes value.
/// </summary>
public pb::ByteString Value {
get { return value_; }
set {

View File

@ -92,3 +92,8 @@ do
PROCESS_ROUND=$((PROCESS_ROUND + 1))
done
cd ..
if test -x objectivec/generate_descriptors_proto.sh; then
echo "Generating messages for objc."
objectivec/generate_descriptors_proto.sh $@
fi

View File

@ -202,9 +202,9 @@ if [[ "${DO_XCODE_IOS_TESTS}" == "yes" ]] ; then
# Don't need to worry about form factors or retina/non retina;
# just pick a mix of OS Versions and 32/64 bit.
-destination "platform=iOS Simulator,name=iPhone 4s,OS=7.1" # 32bit
-destination "platform=iOS Simulator,name=iPhone 6,OS=8.3" # 64bit
-destination "platform=iOS Simulator,name=iPhone 6,OS=8.4" # 64bit
-destination "platform=iOS Simulator,name=iPad 2,OS=7.1" # 32bit
-destination "platform=iOS Simulator,name=iPad Air,OS=8.3" # 64bit
-destination "platform=iOS Simulator,name=iPad Air,OS=8.4" # 64bit
)
header "Doing Xcode iOS build/tests - Debug"
"${XCODEBUILD_TEST_BASE_IOS[@]}" -configuration Debug test

View File

@ -46,12 +46,20 @@
// Used in the generated code to give sizes to enums. int32_t was chosen based
// on the fact that Protocol Buffers enums are limited to this range.
// The complexity and double definition here are so we get the nice name
// for objective C, but also define the name with a trailing underscore so
// the Swift bridge will have one where the names line up to support short
// names since they are scoped to the enum.
// https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/InteractingWithCAPIs.html#//apple_ref/doc/uid/TP40014216-CH8-XID_11
#define GPB_ENUM(X) NS_ENUM(int32_t, X)
#if !__has_feature(objc_fixed_enum)
#error All supported Xcode versions should support objc_fixed_enum.
#endif
// If the headers are imported into Objective-C++, we can run into an issue
// where the defintion of NS_ENUM (really CF_ENUM) changes based on the C++
// standard that is in effect. If it isn't C++11 or higher, the definition
// doesn't allow us to forward declare. We work around this one case by
// providing a local definition. The default case has to use NS_ENUM for the
// magic that is Swift bridging of enums.
#if (__cplusplus && __cplusplus < 201103L)
#define GPB_ENUM(X) enum X : int32_t X; enum X : int32_t
#else
#define GPB_ENUM(X) NS_ENUM(int32_t, X)
#endif
// GPB_ENUM_FWD_DECLARE is used for forward declaring enums, ex:
// GPB_ENUM_FWD_DECLARE(Foo_Enum)
// @property (nonatomic) Foo_Enum value;

View File

@ -360,30 +360,30 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic, readonly) NSUInteger count;
+ (instancetype)dictionary;
+ (instancetype)dictionaryWithValue:(id)value
forKey:(uint32_t)key;
+ (instancetype)dictionaryWithValues:(const id GPB_UNSAFE_UNRETAINED [])values
forKeys:(const uint32_t [])keys
count:(NSUInteger)count;
+ (instancetype)dictionaryWithObject:(id)object
forKey:(uint32_t)key;
+ (instancetype)dictionaryWithObjects:(const id GPB_UNSAFE_UNRETAINED [])objects
forKeys:(const uint32_t [])keys
count:(NSUInteger)count;
+ (instancetype)dictionaryWithDictionary:(GPBUInt32ObjectDictionary *)dictionary;
+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- (instancetype)initWithValues:(const id GPB_UNSAFE_UNRETAINED [])values
forKeys:(const uint32_t [])keys
count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithObjects:(const id GPB_UNSAFE_UNRETAINED [])objects
forKeys:(const uint32_t [])keys
count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithDictionary:(GPBUInt32ObjectDictionary *)dictionary;
- (instancetype)initWithCapacity:(NSUInteger)numItems;
- (id)valueForKey:(uint32_t)key;
- (id)objectForKey:(uint32_t)key;
- (void)enumerateKeysAndValuesUsingBlock:
(void (^)(uint32_t key, id value, BOOL *stop))block;
- (void)enumerateKeysAndObjectsUsingBlock:
(void (^)(uint32_t key, id object, BOOL *stop))block;
- (void)addEntriesFromDictionary:(GPBUInt32ObjectDictionary *)otherDictionary;
- (void)setValue:(id)value forKey:(uint32_t)key;
- (void)setObject:(id)object forKey:(uint32_t)key;
- (void)removeValueForKey:(uint32_t)aKey;
- (void)removeObjectForKey:(uint32_t)aKey;
- (void)removeAll;
@end
@ -706,30 +706,30 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic, readonly) NSUInteger count;
+ (instancetype)dictionary;
+ (instancetype)dictionaryWithValue:(id)value
forKey:(int32_t)key;
+ (instancetype)dictionaryWithValues:(const id GPB_UNSAFE_UNRETAINED [])values
forKeys:(const int32_t [])keys
count:(NSUInteger)count;
+ (instancetype)dictionaryWithObject:(id)object
forKey:(int32_t)key;
+ (instancetype)dictionaryWithObjects:(const id GPB_UNSAFE_UNRETAINED [])objects
forKeys:(const int32_t [])keys
count:(NSUInteger)count;
+ (instancetype)dictionaryWithDictionary:(GPBInt32ObjectDictionary *)dictionary;
+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- (instancetype)initWithValues:(const id GPB_UNSAFE_UNRETAINED [])values
forKeys:(const int32_t [])keys
count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithObjects:(const id GPB_UNSAFE_UNRETAINED [])objects
forKeys:(const int32_t [])keys
count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithDictionary:(GPBInt32ObjectDictionary *)dictionary;
- (instancetype)initWithCapacity:(NSUInteger)numItems;
- (id)valueForKey:(int32_t)key;
- (id)objectForKey:(int32_t)key;
- (void)enumerateKeysAndValuesUsingBlock:
(void (^)(int32_t key, id value, BOOL *stop))block;
- (void)enumerateKeysAndObjectsUsingBlock:
(void (^)(int32_t key, id object, BOOL *stop))block;
- (void)addEntriesFromDictionary:(GPBInt32ObjectDictionary *)otherDictionary;
- (void)setValue:(id)value forKey:(int32_t)key;
- (void)setObject:(id)object forKey:(int32_t)key;
- (void)removeValueForKey:(int32_t)aKey;
- (void)removeObjectForKey:(int32_t)aKey;
- (void)removeAll;
@end
@ -1052,30 +1052,30 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic, readonly) NSUInteger count;
+ (instancetype)dictionary;
+ (instancetype)dictionaryWithValue:(id)value
forKey:(uint64_t)key;
+ (instancetype)dictionaryWithValues:(const id GPB_UNSAFE_UNRETAINED [])values
forKeys:(const uint64_t [])keys
count:(NSUInteger)count;
+ (instancetype)dictionaryWithObject:(id)object
forKey:(uint64_t)key;
+ (instancetype)dictionaryWithObjects:(const id GPB_UNSAFE_UNRETAINED [])objects
forKeys:(const uint64_t [])keys
count:(NSUInteger)count;
+ (instancetype)dictionaryWithDictionary:(GPBUInt64ObjectDictionary *)dictionary;
+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- (instancetype)initWithValues:(const id GPB_UNSAFE_UNRETAINED [])values
forKeys:(const uint64_t [])keys
count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithObjects:(const id GPB_UNSAFE_UNRETAINED [])objects
forKeys:(const uint64_t [])keys
count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithDictionary:(GPBUInt64ObjectDictionary *)dictionary;
- (instancetype)initWithCapacity:(NSUInteger)numItems;
- (id)valueForKey:(uint64_t)key;
- (id)objectForKey:(uint64_t)key;
- (void)enumerateKeysAndValuesUsingBlock:
(void (^)(uint64_t key, id value, BOOL *stop))block;
- (void)enumerateKeysAndObjectsUsingBlock:
(void (^)(uint64_t key, id object, BOOL *stop))block;
- (void)addEntriesFromDictionary:(GPBUInt64ObjectDictionary *)otherDictionary;
- (void)setValue:(id)value forKey:(uint64_t)key;
- (void)setObject:(id)object forKey:(uint64_t)key;
- (void)removeValueForKey:(uint64_t)aKey;
- (void)removeObjectForKey:(uint64_t)aKey;
- (void)removeAll;
@end
@ -1398,30 +1398,30 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic, readonly) NSUInteger count;
+ (instancetype)dictionary;
+ (instancetype)dictionaryWithValue:(id)value
forKey:(int64_t)key;
+ (instancetype)dictionaryWithValues:(const id GPB_UNSAFE_UNRETAINED [])values
forKeys:(const int64_t [])keys
count:(NSUInteger)count;
+ (instancetype)dictionaryWithObject:(id)object
forKey:(int64_t)key;
+ (instancetype)dictionaryWithObjects:(const id GPB_UNSAFE_UNRETAINED [])objects
forKeys:(const int64_t [])keys
count:(NSUInteger)count;
+ (instancetype)dictionaryWithDictionary:(GPBInt64ObjectDictionary *)dictionary;
+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- (instancetype)initWithValues:(const id GPB_UNSAFE_UNRETAINED [])values
forKeys:(const int64_t [])keys
count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithObjects:(const id GPB_UNSAFE_UNRETAINED [])objects
forKeys:(const int64_t [])keys
count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithDictionary:(GPBInt64ObjectDictionary *)dictionary;
- (instancetype)initWithCapacity:(NSUInteger)numItems;
- (id)valueForKey:(int64_t)key;
- (id)objectForKey:(int64_t)key;
- (void)enumerateKeysAndValuesUsingBlock:
(void (^)(int64_t key, id value, BOOL *stop))block;
- (void)enumerateKeysAndObjectsUsingBlock:
(void (^)(int64_t key, id object, BOOL *stop))block;
- (void)addEntriesFromDictionary:(GPBInt64ObjectDictionary *)otherDictionary;
- (void)setValue:(id)value forKey:(int64_t)key;
- (void)setObject:(id)object forKey:(int64_t)key;
- (void)removeValueForKey:(int64_t)aKey;
- (void)removeObjectForKey:(int64_t)aKey;
- (void)removeAll;
@end
@ -1744,30 +1744,30 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic, readonly) NSUInteger count;
+ (instancetype)dictionary;
+ (instancetype)dictionaryWithValue:(id)value
forKey:(BOOL)key;
+ (instancetype)dictionaryWithValues:(const id GPB_UNSAFE_UNRETAINED [])values
forKeys:(const BOOL [])keys
count:(NSUInteger)count;
+ (instancetype)dictionaryWithObject:(id)object
forKey:(BOOL)key;
+ (instancetype)dictionaryWithObjects:(const id GPB_UNSAFE_UNRETAINED [])objects
forKeys:(const BOOL [])keys
count:(NSUInteger)count;
+ (instancetype)dictionaryWithDictionary:(GPBBoolObjectDictionary *)dictionary;
+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
- (instancetype)initWithValues:(const id GPB_UNSAFE_UNRETAINED [])values
forKeys:(const BOOL [])keys
count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithObjects:(const id GPB_UNSAFE_UNRETAINED [])objects
forKeys:(const BOOL [])keys
count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithDictionary:(GPBBoolObjectDictionary *)dictionary;
- (instancetype)initWithCapacity:(NSUInteger)numItems;
- (id)valueForKey:(BOOL)key;
- (id)objectForKey:(BOOL)key;
- (void)enumerateKeysAndValuesUsingBlock:
(void (^)(BOOL key, id value, BOOL *stop))block;
- (void)enumerateKeysAndObjectsUsingBlock:
(void (^)(BOOL key, id object, BOOL *stop))block;
- (void)addEntriesFromDictionary:(GPBBoolObjectDictionary *)otherDictionary;
- (void)setValue:(id)value forKey:(BOOL)key;
- (void)setObject:(id)object forKey:(BOOL)key;
- (void)removeValueForKey:(BOOL)aKey;
- (void)removeObjectForKey:(BOOL)aKey;
- (void)removeAll;
@end
@ -2107,13 +2107,13 @@ NS_ASSUME_NONNULL_END
//%DICTIONARY_KEY_TO_POD_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, Double, double)
//%DICTIONARY_KEY_TO_ENUM_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, Enum, int32_t)
//%PDDM-DEFINE DICTIONARY_KEY_TO_POD_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, VALUE_NAME, VALUE_TYPE)
//%DICTIONARY_COMMON_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, VALUE_NAME, VALUE_TYPE, POD)
//%DICTIONARY_COMMON_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, VALUE_NAME, VALUE_TYPE, POD, value)
//%PDDM-DEFINE DICTIONARY_POD_KEY_TO_OBJECT_INTERFACE(KEY_NAME, KEY_TYPE, VALUE_NAME, VALUE_TYPE)
//%DICTIONARY_COMMON_INTERFACE(KEY_NAME, KEY_TYPE, , POD, VALUE_NAME, VALUE_TYPE, OBJECT)
//%DICTIONARY_COMMON_INTERFACE(KEY_NAME, KEY_TYPE, , POD, VALUE_NAME, VALUE_TYPE, OBJECT, object)
//%PDDM-DEFINE VALUE_FOR_KEY_POD(KEY_TYPE, VALUE_TYPE)
//%- (BOOL)valueForKey:(KEY_TYPE)key value:(nullable VALUE_TYPE *)value;
//%PDDM-DEFINE VALUE_FOR_KEY_OBJECT(KEY_TYPE, VALUE_TYPE)
//%- (VALUE_TYPE)valueForKey:(KEY_TYPE)key;
//%- (VALUE_TYPE)objectForKey:(KEY_TYPE)key;
//%PDDM-DEFINE VALUE_FOR_KEY_Enum(KEY_TYPE, VALUE_TYPE)
//%VALUE_FOR_KEY_POD(KEY_TYPE, VALUE_TYPE)
//%PDDM-DEFINE ARRAY_ARG_MODIFIERPOD()
@ -2122,7 +2122,7 @@ NS_ASSUME_NONNULL_END
// Nothing
//%PDDM-DEFINE ARRAY_ARG_MODIFIEROBJECT()
//%GPB_UNSAFE_UNRETAINED ##
//%PDDM-DEFINE DICTIONARY_COMMON_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, VALUE_NAME, VALUE_TYPE, VHELPER)
//%PDDM-DEFINE DICTIONARY_COMMON_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, VALUE_NAME, VALUE_TYPE, VHELPER, VNAME)
//%#pragma mark - KEY_NAME -> VALUE_NAME
//%
//%@interface GPB##KEY_NAME##VALUE_NAME##Dictionary : NSObject <NSCopying>
@ -2130,25 +2130,25 @@ NS_ASSUME_NONNULL_END
//%@property(nonatomic, readonly) NSUInteger count;
//%
//%+ (instancetype)dictionary;
//%+ (instancetype)dictionaryWithValue:(VALUE_TYPE)value
//% forKey:(KEY_TYPE##KisP$S##KisP)key;
//%+ (instancetype)dictionaryWithValues:(const VALUE_TYPE ARRAY_ARG_MODIFIER##VHELPER()[])values
//% forKeys:(const KEY_TYPE##KisP$S##KisP ARRAY_ARG_MODIFIER##KHELPER()[])keys
//% count:(NSUInteger)count;
//%+ (instancetype)dictionaryWith##VNAME$u##:(VALUE_TYPE)##VNAME
//% ##VNAME$S## forKey:(KEY_TYPE##KisP$S##KisP)key;
//%+ (instancetype)dictionaryWith##VNAME$u##s:(const VALUE_TYPE ARRAY_ARG_MODIFIER##VHELPER()[])##VNAME##s
//% ##VNAME$S## forKeys:(const KEY_TYPE##KisP$S##KisP ARRAY_ARG_MODIFIER##KHELPER()[])keys
//% ##VNAME$S## count:(NSUInteger)count;
//%+ (instancetype)dictionaryWithDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)dictionary;
//%+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
//%
//%- (instancetype)initWithValues:(const VALUE_TYPE ARRAY_ARG_MODIFIER##VHELPER()[])values
//% forKeys:(const KEY_TYPE##KisP$S##KisP ARRAY_ARG_MODIFIER##KHELPER()[])keys
//% count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
//%- (instancetype)initWith##VNAME$u##s:(const VALUE_TYPE ARRAY_ARG_MODIFIER##VHELPER()[])##VNAME##s
//% ##VNAME$S## forKeys:(const KEY_TYPE##KisP$S##KisP ARRAY_ARG_MODIFIER##KHELPER()[])keys
//% ##VNAME$S## count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
//%- (instancetype)initWithDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)dictionary;
//%- (instancetype)initWithCapacity:(NSUInteger)numItems;
//%
//%DICTIONARY_IMMUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER)
//%DICTIONARY_IMMUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER, VNAME)
//%
//%- (void)addEntriesFromDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)otherDictionary;
//%
//%DICTIONARY_MUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER)
//%DICTIONARY_MUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER, VNAME)
//%
//%@end
//%
@ -2189,7 +2189,7 @@ NS_ASSUME_NONNULL_END
//%// is not a valid enumerator as defined by validationFunc. If the actual value is
//%// desired, use "raw" version of the method.
//%
//%DICTIONARY_IMMUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER)
//%DICTIONARY_IMMUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER, value)
//%
//%// These methods bypass the validationFunc to provide access to values that were not
//%// known at the time the binary was compiled.
@ -2206,21 +2206,21 @@ NS_ASSUME_NONNULL_END
//%// to the default value. Use the rawValue methods below to assign non enumerator
//%// values.
//%
//%DICTIONARY_MUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER)
//%DICTIONARY_MUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER, value)
//%
//%@end
//%
//%PDDM-DEFINE DICTIONARY_IMMUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER)
//%PDDM-DEFINE DICTIONARY_IMMUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER, VNAME)
//%VALUE_FOR_KEY_##VHELPER(KEY_TYPE##KisP$S##KisP, VALUE_TYPE)
//%
//%- (void)enumerateKeysAndValuesUsingBlock:
//% (void (^)(KEY_TYPE KisP##key, VALUE_TYPE value, BOOL *stop))block;
//%- (void)enumerateKeysAnd##VNAME$u##sUsingBlock:
//% (void (^)(KEY_TYPE KisP##key, VALUE_TYPE VNAME, BOOL *stop))block;
//%PDDM-DEFINE DICTIONARY_MUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER)
//%- (void)setValue:(VALUE_TYPE)value forKey:(KEY_TYPE##KisP$S##KisP)key;
//%PDDM-DEFINE DICTIONARY_MUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER, VNAME)
//%- (void)set##VNAME$u##:(VALUE_TYPE)##VNAME forKey:(KEY_TYPE##KisP$S##KisP)key;
//%DICTIONARY_EXTRA_MUTABLE_METHODS_##VHELPER(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE)
//%- (void)removeValueForKey:(KEY_TYPE##KisP$S##KisP)aKey;
//%- (void)remove##VNAME$u##ForKey:(KEY_TYPE##KisP$S##KisP)aKey;
//%- (void)removeAll;
//%PDDM-DEFINE DICTIONARY_EXTRA_MUTABLE_METHODS_POD(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE)

File diff suppressed because it is too large Load Diff

View File

@ -58,6 +58,7 @@
F4487C831AAF6AB300531423 /* GPBMessageTests+Merge.m in Sources */ = {isa = PBXBuildFile; fileRef = F4487C821AAF6AB300531423 /* GPBMessageTests+Merge.m */; };
F45C69CC16DFD08D0081955B /* GPBExtensionInternals.m in Sources */ = {isa = PBXBuildFile; fileRef = F45C69CB16DFD08D0081955B /* GPBExtensionInternals.m */; };
F45E57C71AE6DC6A000B7D99 /* text_format_map_unittest_data.txt in Resources */ = {isa = PBXBuildFile; fileRef = F45E57C61AE6DC6A000B7D99 /* text_format_map_unittest_data.txt */; };
F4B51B1E1BBC610700744318 /* GPBObjectiveCPlusPlusTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4B51B1D1BBC610700744318 /* GPBObjectiveCPlusPlusTest.mm */; };
F4E675971B21D0000054530B /* Any.pbobjc.m in Sources */ = {isa = PBXBuildFile; fileRef = F4E675871B21D0000054530B /* Any.pbobjc.m */; };
F4E675991B21D0000054530B /* Api.pbobjc.m in Sources */ = {isa = PBXBuildFile; fileRef = F4E675891B21D0000054530B /* Api.pbobjc.m */; };
F4E6759B1B21D0000054530B /* Empty.pbobjc.m in Sources */ = {isa = PBXBuildFile; fileRef = F4E6758B1B21D0000054530B /* Empty.pbobjc.m */; };
@ -193,6 +194,7 @@
F45C69CB16DFD08D0081955B /* GPBExtensionInternals.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBExtensionInternals.m; sourceTree = "<group>"; };
F45E57C61AE6DC6A000B7D99 /* text_format_map_unittest_data.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = text_format_map_unittest_data.txt; sourceTree = "<group>"; };
F4AC9E1D1A8BEB3500BD6E83 /* unittest_cycle.proto */ = {isa = PBXFileReference; lastKnownFileType = text; path = unittest_cycle.proto; sourceTree = "<group>"; };
F4B51B1D1BBC610700744318 /* GPBObjectiveCPlusPlusTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPBObjectiveCPlusPlusTest.mm; sourceTree = "<group>"; };
F4B6B8AF1A9CC98000892426 /* GPBUnknownField_PackagePrivate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPBUnknownField_PackagePrivate.h; sourceTree = "<group>"; };
F4B6B8B21A9CCBDA00892426 /* GPBUnknownFieldSet_PackagePrivate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPBUnknownFieldSet_PackagePrivate.h; sourceTree = "<group>"; };
F4B6B8B61A9CD1DE00892426 /* GPBExtensionInternals.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPBExtensionInternals.h; sourceTree = "<group>"; };
@ -415,6 +417,7 @@
F4487C821AAF6AB300531423 /* GPBMessageTests+Merge.m */,
F4487C741AADF7F500531423 /* GPBMessageTests+Runtime.m */,
F4487C7E1AAF62CD00531423 /* GPBMessageTests+Serialization.m */,
F4B51B1D1BBC610700744318 /* GPBObjectiveCPlusPlusTest.mm */,
F41C175C1833D3310064ED4D /* GPBPerfTests.m */,
8BA9364418DA5F4B0056FA2A /* GPBStringTests.m */,
8B4248BA1A8C256A00BC1EC6 /* GPBSwiftTests.swift */,
@ -668,6 +671,7 @@
8BBEA4AA147C727D00C4ADB7 /* GPBCodedOuputStreamTests.m in Sources */,
F4E675B21B21D0A70054530B /* SourceContext.pbobjc.m in Sources */,
8BBEA4AC147C727D00C4ADB7 /* GPBMessageTests.m in Sources */,
F4B51B1E1BBC610700744318 /* GPBObjectiveCPlusPlusTest.mm in Sources */,
F4487C7F1AAF62CD00531423 /* GPBMessageTests+Serialization.m in Sources */,
8B4248DC1A92933A00BC1EC6 /* GPBWellKnownTypesTest.m in Sources */,
F4E675B01B21D0A70054530B /* Empty.pbobjc.m in Sources */,

View File

@ -66,6 +66,7 @@
F4487C851AAF6AC500531423 /* GPBMessageTests+Merge.m in Sources */ = {isa = PBXBuildFile; fileRef = F4487C841AAF6AC500531423 /* GPBMessageTests+Merge.m */; };
F45C69CC16DFD08D0081955B /* GPBExtensionInternals.m in Sources */ = {isa = PBXBuildFile; fileRef = F45C69CB16DFD08D0081955B /* GPBExtensionInternals.m */; };
F45E57C91AE6DC98000B7D99 /* text_format_map_unittest_data.txt in Resources */ = {isa = PBXBuildFile; fileRef = F45E57C81AE6DC98000B7D99 /* text_format_map_unittest_data.txt */; };
F4B51B1C1BBC5C7100744318 /* GPBObjectiveCPlusPlusTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4B51B1B1BBC5C7100744318 /* GPBObjectiveCPlusPlusTest.mm */; };
F4E675C81B21D1610054530B /* Any.pbobjc.m in Sources */ = {isa = PBXBuildFile; fileRef = F4E675B71B21D1440054530B /* Any.pbobjc.m */; };
F4E675C91B21D1610054530B /* Api.pbobjc.m in Sources */ = {isa = PBXBuildFile; fileRef = F4E675B91B21D1440054530B /* Api.pbobjc.m */; };
F4E675CA1B21D1610054530B /* Empty.pbobjc.m in Sources */ = {isa = PBXBuildFile; fileRef = F4E675BC1B21D1440054530B /* Empty.pbobjc.m */; };
@ -214,6 +215,7 @@
F45C69CB16DFD08D0081955B /* GPBExtensionInternals.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBExtensionInternals.m; sourceTree = "<group>"; };
F45E57C81AE6DC98000B7D99 /* text_format_map_unittest_data.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = text_format_map_unittest_data.txt; sourceTree = "<group>"; };
F4AC9E1C1A8BEB1000BD6E83 /* unittest_cycle.proto */ = {isa = PBXFileReference; lastKnownFileType = text; path = unittest_cycle.proto; sourceTree = "<group>"; };
F4B51B1B1BBC5C7100744318 /* GPBObjectiveCPlusPlusTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPBObjectiveCPlusPlusTest.mm; sourceTree = "<group>"; };
F4B6B8B01A9CC99500892426 /* GPBUnknownField_PackagePrivate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPBUnknownField_PackagePrivate.h; sourceTree = "<group>"; };
F4B6B8B11A9CCBBB00892426 /* GPBUnknownFieldSet_PackagePrivate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPBUnknownFieldSet_PackagePrivate.h; sourceTree = "<group>"; };
F4B6B8B31A9CD1C600892426 /* GPBExtensionInternals.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPBExtensionInternals.h; sourceTree = "<group>"; };
@ -453,6 +455,7 @@
F4487C841AAF6AC500531423 /* GPBMessageTests+Merge.m */,
F4487C761AADF84900531423 /* GPBMessageTests+Runtime.m */,
F4487C801AAF62FC00531423 /* GPBMessageTests+Serialization.m */,
F4B51B1B1BBC5C7100744318 /* GPBObjectiveCPlusPlusTest.mm */,
F41C175C1833D3310064ED4D /* GPBPerfTests.m */,
8BA9364418DA5F4B0056FA2A /* GPBStringTests.m */,
8B4248B31A8BD96E00BC1EC6 /* GPBSwiftTests.swift */,
@ -770,6 +773,7 @@
F4E675CE1B21D1610054530B /* Type.pbobjc.m in Sources */,
F4353D1F1AB88243005A6198 /* GPBDescriptorTests.m in Sources */,
F4E675CF1B21D1610054530B /* Wrappers.pbobjc.m in Sources */,
F4B51B1C1BBC5C7100744318 /* GPBObjectiveCPlusPlusTest.mm in Sources */,
F4E675C81B21D1610054530B /* Any.pbobjc.m in Sources */,
8B4248B41A8BD96E00BC1EC6 /* GPBSwiftTests.swift in Sources */,
5102DABC1891A073002037B6 /* GPBConcurrencyTests.m in Sources */,

View File

@ -167,10 +167,10 @@
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 Fewer pairs; not equal
@ -468,10 +468,10 @@
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 Fewer pairs; not equal
@ -769,10 +769,10 @@
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 Fewer pairs; not equal
@ -1070,10 +1070,10 @@
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 Fewer pairs; not equal
@ -1371,10 +1371,10 @@
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 Fewer pairs; not equal
@ -1672,10 +1672,10 @@
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 Fewer pairs; not equal
@ -1973,10 +1973,10 @@
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 Fewer pairs; not equal
@ -2161,46 +2161,46 @@
GPBBoolObjectDictionary *dict = [[GPBBoolObjectDictionary alloc] init];
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 0U);
XCTAssertNil([dict valueForKey:YES]);
[dict enumerateKeysAndValuesUsingBlock:^(BOOL aKey, id aValue, BOOL *stop) {
#pragma unused(aKey, aValue, stop)
XCTAssertNil([dict objectForKey:YES]);
[dict enumerateKeysAndObjectsUsingBlock:^(BOOL aKey, id aObject, BOOL *stop) {
#pragma unused(aKey, aObject, stop)
XCTFail(@"Shouldn't get here!");
}];
[dict release];
}
- (void)testOne {
GPBBoolObjectDictionary *dict = [GPBBoolObjectDictionary dictionaryWithValue:@"abc" forKey:YES];
GPBBoolObjectDictionary *dict = [GPBBoolObjectDictionary dictionaryWithObject:@"abc" forKey:YES];
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 1U);
XCTAssertEqualObjects([dict valueForKey:YES], @"abc");
XCTAssertNil([dict valueForKey:NO]);
[dict enumerateKeysAndValuesUsingBlock:^(BOOL aKey, id aValue, BOOL *stop) {
XCTAssertEqualObjects([dict objectForKey:YES], @"abc");
XCTAssertNil([dict objectForKey:NO]);
[dict enumerateKeysAndObjectsUsingBlock:^(BOOL aKey, id aObject, BOOL *stop) {
XCTAssertEqual(aKey, YES);
XCTAssertEqualObjects(aValue, @"abc");
XCTAssertEqualObjects(aObject, @"abc");
XCTAssertNotEqual(stop, NULL);
}];
}
- (void)testBasics {
const BOOL kKeys[] = { YES, NO };
const id kValues[] = { @"abc", @"def" };
const id kObjects[] = { @"abc", @"def" };
GPBBoolObjectDictionary *dict =
[[GPBBoolObjectDictionary alloc] initWithValues:kValues
forKeys:kKeys
count:GPBARRAYSIZE(kValues)];
[[GPBBoolObjectDictionary alloc] initWithObjects:kObjects
forKeys:kKeys
count:GPBARRAYSIZE(kObjects)];
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 2U);
XCTAssertEqualObjects([dict valueForKey:YES], @"abc");
XCTAssertEqualObjects([dict valueForKey:NO], @"def");
XCTAssertEqualObjects([dict objectForKey:YES], @"abc");
XCTAssertEqualObjects([dict objectForKey:NO], @"def");
__block NSUInteger idx = 0;
BOOL *seenKeys = malloc(2 * sizeof(BOOL));
id *seenValues = malloc(2 * sizeof(id));
[dict enumerateKeysAndValuesUsingBlock:^(BOOL aKey, id aValue, BOOL *stop) {
id *seenObjects = malloc(2 * sizeof(id));
[dict enumerateKeysAndObjectsUsingBlock:^(BOOL aKey, id aObject, BOOL *stop) {
XCTAssertLessThan(idx, 2U);
seenKeys[idx] = aKey;
seenValues[idx] = aValue;
seenObjects[idx] = aObject;
XCTAssertNotEqual(stop, NULL);
++idx;
}];
@ -2209,18 +2209,18 @@
for (int j = 0; (j < 2) && !foundKey; ++j) {
if (kKeys[i] == seenKeys[j]) {
foundKey = YES;
XCTAssertEqualObjects(kValues[i], seenValues[j], @"i = %d, j = %d", i, j);
XCTAssertEqualObjects(kObjects[i], seenObjects[j], @"i = %d, j = %d", i, j);
}
}
XCTAssertTrue(foundKey, @"i = %d", i);
}
free(seenKeys);
free(seenValues);
free(seenObjects);
// Stopping the enumeration.
idx = 0;
[dict enumerateKeysAndValuesUsingBlock:^(BOOL aKey, id aValue, BOOL *stop) {
#pragma unused(aKey, aValue)
[dict enumerateKeysAndObjectsUsingBlock:^(BOOL aKey, id aObject, BOOL *stop) {
#pragma unused(aKey, aObject)
if (idx == 0) *stop = YES;
XCTAssertNotEqual(idx, 2U);
++idx;
@ -2231,33 +2231,33 @@
- (void)testEquality {
const BOOL kKeys1[] = { YES, NO };
const BOOL kKeys2[] = { NO, YES };
const id kValues1[] = { @"abc", @"def" };
const id kValues2[] = { @"def", @"abc" };
const id kValues3[] = { @"def" };
const id kObjects1[] = { @"abc", @"def" };
const id kObjects2[] = { @"def", @"abc" };
const id kObjects3[] = { @"def" };
GPBBoolObjectDictionary *dict1 =
[[GPBBoolObjectDictionary alloc] initWithValues:kValues1
forKeys:kKeys1
count:GPBARRAYSIZE(kValues1)];
[[GPBBoolObjectDictionary alloc] initWithObjects:kObjects1
forKeys:kKeys1
count:GPBARRAYSIZE(kObjects1)];
XCTAssertNotNil(dict1);
GPBBoolObjectDictionary *dict1prime =
[[GPBBoolObjectDictionary alloc] initWithValues:kValues1
forKeys:kKeys1
count:GPBARRAYSIZE(kValues1)];
[[GPBBoolObjectDictionary alloc] initWithObjects:kObjects1
forKeys:kKeys1
count:GPBARRAYSIZE(kObjects1)];
XCTAssertNotNil(dict1prime);
GPBBoolObjectDictionary *dict2 =
[[GPBBoolObjectDictionary alloc] initWithValues:kValues2
forKeys:kKeys1
count:GPBARRAYSIZE(kValues2)];
[[GPBBoolObjectDictionary alloc] initWithObjects:kObjects2
forKeys:kKeys1
count:GPBARRAYSIZE(kObjects2)];
XCTAssertNotNil(dict2);
GPBBoolObjectDictionary *dict3 =
[[GPBBoolObjectDictionary alloc] initWithValues:kValues1
forKeys:kKeys2
count:GPBARRAYSIZE(kValues1)];
[[GPBBoolObjectDictionary alloc] initWithObjects:kObjects1
forKeys:kKeys2
count:GPBARRAYSIZE(kObjects1)];
XCTAssertNotNil(dict3);
GPBBoolObjectDictionary *dict4 =
[[GPBBoolObjectDictionary alloc] initWithValues:kValues3
forKeys:kKeys1
count:GPBARRAYSIZE(kValues3)];
[[GPBBoolObjectDictionary alloc] initWithObjects:kObjects3
forKeys:kKeys1
count:GPBARRAYSIZE(kObjects3)];
XCTAssertNotNil(dict4);
// 1/1Prime should be different objects, but equal.
@ -2266,10 +2266,10 @@
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different objects; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same objects; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 Fewer pairs; not equal
@ -2284,11 +2284,11 @@
- (void)testCopy {
const BOOL kKeys[] = { YES, NO };
const id kValues[] = { @"abc", @"def" };
const id kObjects[] = { @"abc", @"def" };
GPBBoolObjectDictionary *dict =
[[GPBBoolObjectDictionary alloc] initWithValues:kValues
forKeys:kKeys
count:GPBARRAYSIZE(kValues)];
[[GPBBoolObjectDictionary alloc] initWithObjects:kObjects
forKeys:kKeys
count:GPBARRAYSIZE(kObjects)];
XCTAssertNotNil(dict);
GPBBoolObjectDictionary *dict2 = [dict copy];
@ -2305,11 +2305,11 @@
- (void)testDictionaryFromDictionary {
const BOOL kKeys[] = { YES, NO };
const id kValues[] = { @"abc", @"def" };
const id kObjects[] = { @"abc", @"def" };
GPBBoolObjectDictionary *dict =
[[GPBBoolObjectDictionary alloc] initWithValues:kValues
forKeys:kKeys
count:GPBARRAYSIZE(kValues)];
[[GPBBoolObjectDictionary alloc] initWithObjects:kObjects
forKeys:kKeys
count:GPBARRAYSIZE(kObjects)];
XCTAssertNotNil(dict);
GPBBoolObjectDictionary *dict2 =
@ -2327,85 +2327,85 @@
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 0U);
[dict setValue:@"abc" forKey:YES];
[dict setObject:@"abc" forKey:YES];
XCTAssertEqual(dict.count, 1U);
const BOOL kKeys[] = { NO };
const id kValues[] = { @"def" };
const id kObjects[] = { @"def" };
GPBBoolObjectDictionary *dict2 =
[[GPBBoolObjectDictionary alloc] initWithValues:kValues
forKeys:kKeys
count:GPBARRAYSIZE(kValues)];
[[GPBBoolObjectDictionary alloc] initWithObjects:kObjects
forKeys:kKeys
count:GPBARRAYSIZE(kObjects)];
XCTAssertNotNil(dict2);
[dict addEntriesFromDictionary:dict2];
XCTAssertEqual(dict.count, 2U);
XCTAssertEqualObjects([dict valueForKey:YES], @"abc");
XCTAssertEqualObjects([dict valueForKey:NO], @"def");
XCTAssertEqualObjects([dict objectForKey:YES], @"abc");
XCTAssertEqualObjects([dict objectForKey:NO], @"def");
[dict2 release];
}
- (void)testRemove {
const BOOL kKeys[] = { YES, NO};
const id kValues[] = { @"abc", @"def" };
const id kObjects[] = { @"abc", @"def" };
GPBBoolObjectDictionary *dict =
[[GPBBoolObjectDictionary alloc] initWithValues:kValues
forKeys:kKeys
count:GPBARRAYSIZE(kValues)];
[[GPBBoolObjectDictionary alloc] initWithObjects:kObjects
forKeys:kKeys
count:GPBARRAYSIZE(kObjects)];
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 2U);
[dict removeValueForKey:NO];
[dict removeObjectForKey:NO];
XCTAssertEqual(dict.count, 1U);
XCTAssertEqualObjects([dict valueForKey:YES], @"abc");
XCTAssertNil([dict valueForKey:NO]);
XCTAssertEqualObjects([dict objectForKey:YES], @"abc");
XCTAssertNil([dict objectForKey:NO]);
// Remove again does nothing.
[dict removeValueForKey:NO];
[dict removeObjectForKey:NO];
XCTAssertEqual(dict.count, 1U);
XCTAssertEqualObjects([dict valueForKey:YES], @"abc");
XCTAssertNil([dict valueForKey:NO]);
XCTAssertEqualObjects([dict objectForKey:YES], @"abc");
XCTAssertNil([dict objectForKey:NO]);
[dict removeAll];
XCTAssertEqual(dict.count, 0U);
XCTAssertNil([dict valueForKey:YES]);
XCTAssertNil([dict valueForKey:NO]);
XCTAssertNil([dict objectForKey:YES]);
XCTAssertNil([dict objectForKey:NO]);
[dict release];
}
- (void)testInplaceMutation {
const BOOL kKeys[] = { YES, NO };
const id kValues[] = { @"abc", @"def" };
const id kObjects[] = { @"abc", @"def" };
GPBBoolObjectDictionary *dict =
[[GPBBoolObjectDictionary alloc] initWithValues:kValues
forKeys:kKeys
count:GPBARRAYSIZE(kValues)];
[[GPBBoolObjectDictionary alloc] initWithObjects:kObjects
forKeys:kKeys
count:GPBARRAYSIZE(kObjects)];
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 2U);
XCTAssertEqualObjects([dict valueForKey:YES], @"abc");
XCTAssertEqualObjects([dict valueForKey:NO], @"def");
XCTAssertEqualObjects([dict objectForKey:YES], @"abc");
XCTAssertEqualObjects([dict objectForKey:NO], @"def");
[dict setValue:@"def" forKey:YES];
[dict setObject:@"def" forKey:YES];
XCTAssertEqual(dict.count, 2U);
XCTAssertEqualObjects([dict valueForKey:YES], @"def");
XCTAssertEqualObjects([dict valueForKey:NO], @"def");
XCTAssertEqualObjects([dict objectForKey:YES], @"def");
XCTAssertEqualObjects([dict objectForKey:NO], @"def");
[dict setValue:@"abc" forKey:NO];
[dict setObject:@"abc" forKey:NO];
XCTAssertEqual(dict.count, 2U);
XCTAssertEqualObjects([dict valueForKey:YES], @"def");
XCTAssertEqualObjects([dict valueForKey:NO], @"abc");
XCTAssertEqualObjects([dict objectForKey:YES], @"def");
XCTAssertEqualObjects([dict objectForKey:NO], @"abc");
const BOOL kKeys2[] = { NO, YES };
const id kValues2[] = { @"def", @"abc" };
const id kObjects2[] = { @"def", @"abc" };
GPBBoolObjectDictionary *dict2 =
[[GPBBoolObjectDictionary alloc] initWithValues:kValues2
forKeys:kKeys2
count:GPBARRAYSIZE(kValues2)];
[[GPBBoolObjectDictionary alloc] initWithObjects:kObjects2
forKeys:kKeys2
count:GPBARRAYSIZE(kObjects2)];
XCTAssertNotNil(dict2);
[dict addEntriesFromDictionary:dict2];
XCTAssertEqual(dict.count, 2U);
XCTAssertEqualObjects([dict valueForKey:YES], @"abc");
XCTAssertEqualObjects([dict valueForKey:NO], @"def");
XCTAssertEqualObjects([dict objectForKey:YES], @"abc");
XCTAssertEqualObjects([dict objectForKey:NO], @"def");
[dict2 release];
[dict release];

View File

@ -211,10 +211,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -568,10 +568,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -925,10 +925,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -1282,10 +1282,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -1639,10 +1639,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -1996,10 +1996,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -2353,10 +2353,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -2710,10 +2710,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -3071,10 +3071,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -3366,48 +3366,48 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
GPBInt32ObjectDictionary *dict = [[GPBInt32ObjectDictionary alloc] init];
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 0U);
XCTAssertNil([dict valueForKey:11]);
[dict enumerateKeysAndValuesUsingBlock:^(int32_t aKey, id aValue, BOOL *stop) {
#pragma unused(aKey, aValue, stop)
XCTAssertNil([dict objectForKey:11]);
[dict enumerateKeysAndObjectsUsingBlock:^(int32_t aKey, id aObject, BOOL *stop) {
#pragma unused(aKey, aObject, stop)
XCTFail(@"Shouldn't get here!");
}];
[dict release];
}
- (void)testOne {
GPBInt32ObjectDictionary *dict = [GPBInt32ObjectDictionary dictionaryWithValue:@"abc" forKey:11];
GPBInt32ObjectDictionary *dict = [GPBInt32ObjectDictionary dictionaryWithObject:@"abc" forKey:11];
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 1U);
XCTAssertEqualObjects([dict valueForKey:11], @"abc");
XCTAssertNil([dict valueForKey:12]);
[dict enumerateKeysAndValuesUsingBlock:^(int32_t aKey, id aValue, BOOL *stop) {
XCTAssertEqualObjects([dict objectForKey:11], @"abc");
XCTAssertNil([dict objectForKey:12]);
[dict enumerateKeysAndObjectsUsingBlock:^(int32_t aKey, id aObject, BOOL *stop) {
XCTAssertEqual(aKey, 11);
XCTAssertEqualObjects(aValue, @"abc");
XCTAssertEqualObjects(aObject, @"abc");
XCTAssertNotEqual(stop, NULL);
}];
}
- (void)testBasics {
const int32_t kKeys[] = { 11, 12, 13 };
const id kValues[] = { @"abc", @"def", @"ghi" };
const id kObjects[] = { @"abc", @"def", @"ghi" };
GPBInt32ObjectDictionary *dict =
[[GPBInt32ObjectDictionary alloc] initWithValues:kValues
forKeys:kKeys
count:GPBARRAYSIZE(kValues)];
[[GPBInt32ObjectDictionary alloc] initWithObjects:kObjects
forKeys:kKeys
count:GPBARRAYSIZE(kObjects)];
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 3U);
XCTAssertEqualObjects([dict valueForKey:11], @"abc");
XCTAssertEqualObjects([dict valueForKey:12], @"def");
XCTAssertEqualObjects([dict valueForKey:13], @"ghi");
XCTAssertNil([dict valueForKey:14]);
XCTAssertEqualObjects([dict objectForKey:11], @"abc");
XCTAssertEqualObjects([dict objectForKey:12], @"def");
XCTAssertEqualObjects([dict objectForKey:13], @"ghi");
XCTAssertNil([dict objectForKey:14]);
__block NSUInteger idx = 0;
int32_t *seenKeys = malloc(3 * sizeof(int32_t));
id *seenValues = malloc(3 * sizeof(id));
[dict enumerateKeysAndValuesUsingBlock:^(int32_t aKey, id aValue, BOOL *stop) {
id *seenObjects = malloc(3 * sizeof(id));
[dict enumerateKeysAndObjectsUsingBlock:^(int32_t aKey, id aObject, BOOL *stop) {
XCTAssertLessThan(idx, 3U);
seenKeys[idx] = aKey;
seenValues[idx] = aValue;
seenObjects[idx] = aObject;
XCTAssertNotEqual(stop, NULL);
++idx;
}];
@ -3416,18 +3416,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
for (int j = 0; (j < 3) && !foundKey; ++j) {
if (kKeys[i] == seenKeys[j]) {
foundKey = YES;
XCTAssertEqualObjects(kValues[i], seenValues[j], @"i = %d, j = %d", i, j);
XCTAssertEqualObjects(kObjects[i], seenObjects[j], @"i = %d, j = %d", i, j);
}
}
XCTAssertTrue(foundKey, @"i = %d", i);
}
free(seenKeys);
free(seenValues);
free(seenObjects);
// Stopping the enumeration.
idx = 0;
[dict enumerateKeysAndValuesUsingBlock:^(int32_t aKey, id aValue, BOOL *stop) {
#pragma unused(aKey, aValue)
[dict enumerateKeysAndObjectsUsingBlock:^(int32_t aKey, id aObject, BOOL *stop) {
#pragma unused(aKey, aObject)
if (idx == 1) *stop = YES;
XCTAssertNotEqual(idx, 2U);
++idx;
@ -3438,33 +3438,33 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
- (void)testEquality {
const int32_t kKeys1[] = { 11, 12, 13, 14 };
const int32_t kKeys2[] = { 12, 11, 14 };
const id kValues1[] = { @"abc", @"def", @"ghi" };
const id kValues2[] = { @"abc", @"jkl", @"ghi" };
const id kValues3[] = { @"abc", @"def", @"ghi", @"jkl" };
const id kObjects1[] = { @"abc", @"def", @"ghi" };
const id kObjects2[] = { @"abc", @"jkl", @"ghi" };
const id kObjects3[] = { @"abc", @"def", @"ghi", @"jkl" };
GPBInt32ObjectDictionary *dict1 =
[[GPBInt32ObjectDictionary alloc] initWithValues:kValues1
forKeys:kKeys1
count:GPBARRAYSIZE(kValues1)];
[[GPBInt32ObjectDictionary alloc] initWithObjects:kObjects1
forKeys:kKeys1
count:GPBARRAYSIZE(kObjects1)];
XCTAssertNotNil(dict1);
GPBInt32ObjectDictionary *dict1prime =
[[GPBInt32ObjectDictionary alloc] initWithValues:kValues1
forKeys:kKeys1
count:GPBARRAYSIZE(kValues1)];
[[GPBInt32ObjectDictionary alloc] initWithObjects:kObjects1
forKeys:kKeys1
count:GPBARRAYSIZE(kObjects1)];
XCTAssertNotNil(dict1prime);
GPBInt32ObjectDictionary *dict2 =
[[GPBInt32ObjectDictionary alloc] initWithValues:kValues2
forKeys:kKeys1
count:GPBARRAYSIZE(kValues2)];
[[GPBInt32ObjectDictionary alloc] initWithObjects:kObjects2
forKeys:kKeys1
count:GPBARRAYSIZE(kObjects2)];
XCTAssertNotNil(dict2);
GPBInt32ObjectDictionary *dict3 =
[[GPBInt32ObjectDictionary alloc] initWithValues:kValues1
forKeys:kKeys2
count:GPBARRAYSIZE(kValues1)];
[[GPBInt32ObjectDictionary alloc] initWithObjects:kObjects1
forKeys:kKeys2
count:GPBARRAYSIZE(kObjects1)];
XCTAssertNotNil(dict3);
GPBInt32ObjectDictionary *dict4 =
[[GPBInt32ObjectDictionary alloc] initWithValues:kValues3
forKeys:kKeys1
count:GPBARRAYSIZE(kValues3)];
[[GPBInt32ObjectDictionary alloc] initWithObjects:kObjects3
forKeys:kKeys1
count:GPBARRAYSIZE(kObjects3)];
XCTAssertNotNil(dict4);
// 1/1Prime should be different objects, but equal.
@ -3473,10 +3473,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different objects; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same objects; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -3491,11 +3491,11 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
- (void)testCopy {
const int32_t kKeys[] = { 11, 12, 13, 14 };
const id kValues[] = { @"abc", @"def", @"ghi", @"jkl" };
const id kObjects[] = { @"abc", @"def", @"ghi", @"jkl" };
GPBInt32ObjectDictionary *dict =
[[GPBInt32ObjectDictionary alloc] initWithValues:kValues
forKeys:kKeys
count:GPBARRAYSIZE(kValues)];
[[GPBInt32ObjectDictionary alloc] initWithObjects:kObjects
forKeys:kKeys
count:GPBARRAYSIZE(kObjects)];
XCTAssertNotNil(dict);
GPBInt32ObjectDictionary *dict2 = [dict copy];
@ -3512,11 +3512,11 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
- (void)testDictionaryFromDictionary {
const int32_t kKeys[] = { 11, 12, 13, 14 };
const id kValues[] = { @"abc", @"def", @"ghi", @"jkl" };
const id kObjects[] = { @"abc", @"def", @"ghi", @"jkl" };
GPBInt32ObjectDictionary *dict =
[[GPBInt32ObjectDictionary alloc] initWithValues:kValues
forKeys:kKeys
count:GPBARRAYSIZE(kValues)];
[[GPBInt32ObjectDictionary alloc] initWithObjects:kObjects
forKeys:kKeys
count:GPBARRAYSIZE(kObjects)];
XCTAssertNotNil(dict);
GPBInt32ObjectDictionary *dict2 =
@ -3534,108 +3534,108 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 0U);
[dict setValue:@"abc" forKey:11];
[dict setObject:@"abc" forKey:11];
XCTAssertEqual(dict.count, 1U);
const int32_t kKeys[] = { 12, 13, 14 };
const id kValues[] = { @"def", @"ghi", @"jkl" };
const id kObjects[] = { @"def", @"ghi", @"jkl" };
GPBInt32ObjectDictionary *dict2 =
[[GPBInt32ObjectDictionary alloc] initWithValues:kValues
forKeys:kKeys
count:GPBARRAYSIZE(kValues)];
[[GPBInt32ObjectDictionary alloc] initWithObjects:kObjects
forKeys:kKeys
count:GPBARRAYSIZE(kObjects)];
XCTAssertNotNil(dict2);
[dict addEntriesFromDictionary:dict2];
XCTAssertEqual(dict.count, 4U);
XCTAssertEqualObjects([dict valueForKey:11], @"abc");
XCTAssertEqualObjects([dict valueForKey:12], @"def");
XCTAssertEqualObjects([dict valueForKey:13], @"ghi");
XCTAssertEqualObjects([dict valueForKey:14], @"jkl");
XCTAssertEqualObjects([dict objectForKey:11], @"abc");
XCTAssertEqualObjects([dict objectForKey:12], @"def");
XCTAssertEqualObjects([dict objectForKey:13], @"ghi");
XCTAssertEqualObjects([dict objectForKey:14], @"jkl");
[dict2 release];
}
- (void)testRemove {
const int32_t kKeys[] = { 11, 12, 13, 14 };
const id kValues[] = { @"abc", @"def", @"ghi", @"jkl" };
const id kObjects[] = { @"abc", @"def", @"ghi", @"jkl" };
GPBInt32ObjectDictionary *dict =
[[GPBInt32ObjectDictionary alloc] initWithValues:kValues
forKeys:kKeys
count:GPBARRAYSIZE(kValues)];
[[GPBInt32ObjectDictionary alloc] initWithObjects:kObjects
forKeys:kKeys
count:GPBARRAYSIZE(kObjects)];
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 4U);
[dict removeValueForKey:12];
[dict removeObjectForKey:12];
XCTAssertEqual(dict.count, 3U);
XCTAssertEqualObjects([dict valueForKey:11], @"abc");
XCTAssertNil([dict valueForKey:12]);
XCTAssertEqualObjects([dict valueForKey:13], @"ghi");
XCTAssertEqualObjects([dict valueForKey:14], @"jkl");
XCTAssertEqualObjects([dict objectForKey:11], @"abc");
XCTAssertNil([dict objectForKey:12]);
XCTAssertEqualObjects([dict objectForKey:13], @"ghi");
XCTAssertEqualObjects([dict objectForKey:14], @"jkl");
// Remove again does nothing.
[dict removeValueForKey:12];
[dict removeObjectForKey:12];
XCTAssertEqual(dict.count, 3U);
XCTAssertEqualObjects([dict valueForKey:11], @"abc");
XCTAssertNil([dict valueForKey:12]);
XCTAssertEqualObjects([dict valueForKey:13], @"ghi");
XCTAssertEqualObjects([dict valueForKey:14], @"jkl");
XCTAssertEqualObjects([dict objectForKey:11], @"abc");
XCTAssertNil([dict objectForKey:12]);
XCTAssertEqualObjects([dict objectForKey:13], @"ghi");
XCTAssertEqualObjects([dict objectForKey:14], @"jkl");
[dict removeValueForKey:14];
[dict removeObjectForKey:14];
XCTAssertEqual(dict.count, 2U);
XCTAssertEqualObjects([dict valueForKey:11], @"abc");
XCTAssertNil([dict valueForKey:12]);
XCTAssertEqualObjects([dict valueForKey:13], @"ghi");
XCTAssertNil([dict valueForKey:14]);
XCTAssertEqualObjects([dict objectForKey:11], @"abc");
XCTAssertNil([dict objectForKey:12]);
XCTAssertEqualObjects([dict objectForKey:13], @"ghi");
XCTAssertNil([dict objectForKey:14]);
[dict removeAll];
XCTAssertEqual(dict.count, 0U);
XCTAssertNil([dict valueForKey:11]);
XCTAssertNil([dict valueForKey:12]);
XCTAssertNil([dict valueForKey:13]);
XCTAssertNil([dict valueForKey:14]);
XCTAssertNil([dict objectForKey:11]);
XCTAssertNil([dict objectForKey:12]);
XCTAssertNil([dict objectForKey:13]);
XCTAssertNil([dict objectForKey:14]);
[dict release];
}
- (void)testInplaceMutation {
const int32_t kKeys[] = { 11, 12, 13, 14 };
const id kValues[] = { @"abc", @"def", @"ghi", @"jkl" };
const id kObjects[] = { @"abc", @"def", @"ghi", @"jkl" };
GPBInt32ObjectDictionary *dict =
[[GPBInt32ObjectDictionary alloc] initWithValues:kValues
forKeys:kKeys
count:GPBARRAYSIZE(kValues)];
[[GPBInt32ObjectDictionary alloc] initWithObjects:kObjects
forKeys:kKeys
count:GPBARRAYSIZE(kObjects)];
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 4U);
XCTAssertEqualObjects([dict valueForKey:11], @"abc");
XCTAssertEqualObjects([dict valueForKey:12], @"def");
XCTAssertEqualObjects([dict valueForKey:13], @"ghi");
XCTAssertEqualObjects([dict valueForKey:14], @"jkl");
XCTAssertEqualObjects([dict objectForKey:11], @"abc");
XCTAssertEqualObjects([dict objectForKey:12], @"def");
XCTAssertEqualObjects([dict objectForKey:13], @"ghi");
XCTAssertEqualObjects([dict objectForKey:14], @"jkl");
[dict setValue:@"jkl" forKey:11];
[dict setObject:@"jkl" forKey:11];
XCTAssertEqual(dict.count, 4U);
XCTAssertEqualObjects([dict valueForKey:11], @"jkl");
XCTAssertEqualObjects([dict valueForKey:12], @"def");
XCTAssertEqualObjects([dict valueForKey:13], @"ghi");
XCTAssertEqualObjects([dict valueForKey:14], @"jkl");
XCTAssertEqualObjects([dict objectForKey:11], @"jkl");
XCTAssertEqualObjects([dict objectForKey:12], @"def");
XCTAssertEqualObjects([dict objectForKey:13], @"ghi");
XCTAssertEqualObjects([dict objectForKey:14], @"jkl");
[dict setValue:@"def" forKey:14];
[dict setObject:@"def" forKey:14];
XCTAssertEqual(dict.count, 4U);
XCTAssertEqualObjects([dict valueForKey:11], @"jkl");
XCTAssertEqualObjects([dict valueForKey:12], @"def");
XCTAssertEqualObjects([dict valueForKey:13], @"ghi");
XCTAssertEqualObjects([dict valueForKey:14], @"def");
XCTAssertEqualObjects([dict objectForKey:11], @"jkl");
XCTAssertEqualObjects([dict objectForKey:12], @"def");
XCTAssertEqualObjects([dict objectForKey:13], @"ghi");
XCTAssertEqualObjects([dict objectForKey:14], @"def");
const int32_t kKeys2[] = { 12, 13 };
const id kValues2[] = { @"ghi", @"abc" };
const id kObjects2[] = { @"ghi", @"abc" };
GPBInt32ObjectDictionary *dict2 =
[[GPBInt32ObjectDictionary alloc] initWithValues:kValues2
forKeys:kKeys2
count:GPBARRAYSIZE(kValues2)];
[[GPBInt32ObjectDictionary alloc] initWithObjects:kObjects2
forKeys:kKeys2
count:GPBARRAYSIZE(kObjects2)];
XCTAssertNotNil(dict2);
[dict addEntriesFromDictionary:dict2];
XCTAssertEqual(dict.count, 4U);
XCTAssertEqualObjects([dict valueForKey:11], @"jkl");
XCTAssertEqualObjects([dict valueForKey:12], @"ghi");
XCTAssertEqualObjects([dict valueForKey:13], @"abc");
XCTAssertEqualObjects([dict valueForKey:14], @"def");
XCTAssertEqualObjects([dict objectForKey:11], @"jkl");
XCTAssertEqualObjects([dict objectForKey:12], @"ghi");
XCTAssertEqualObjects([dict objectForKey:13], @"abc");
XCTAssertEqualObjects([dict objectForKey:14], @"def");
[dict2 release];
[dict release];

View File

@ -211,10 +211,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -568,10 +568,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -925,10 +925,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -1282,10 +1282,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -1639,10 +1639,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -1996,10 +1996,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -2353,10 +2353,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -2710,10 +2710,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -3071,10 +3071,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -3366,48 +3366,48 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
GPBInt64ObjectDictionary *dict = [[GPBInt64ObjectDictionary alloc] init];
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 0U);
XCTAssertNil([dict valueForKey:21LL]);
[dict enumerateKeysAndValuesUsingBlock:^(int64_t aKey, id aValue, BOOL *stop) {
#pragma unused(aKey, aValue, stop)
XCTAssertNil([dict objectForKey:21LL]);
[dict enumerateKeysAndObjectsUsingBlock:^(int64_t aKey, id aObject, BOOL *stop) {
#pragma unused(aKey, aObject, stop)
XCTFail(@"Shouldn't get here!");
}];
[dict release];
}
- (void)testOne {
GPBInt64ObjectDictionary *dict = [GPBInt64ObjectDictionary dictionaryWithValue:@"abc" forKey:21LL];
GPBInt64ObjectDictionary *dict = [GPBInt64ObjectDictionary dictionaryWithObject:@"abc" forKey:21LL];
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 1U);
XCTAssertEqualObjects([dict valueForKey:21LL], @"abc");
XCTAssertNil([dict valueForKey:22LL]);
[dict enumerateKeysAndValuesUsingBlock:^(int64_t aKey, id aValue, BOOL *stop) {
XCTAssertEqualObjects([dict objectForKey:21LL], @"abc");
XCTAssertNil([dict objectForKey:22LL]);
[dict enumerateKeysAndObjectsUsingBlock:^(int64_t aKey, id aObject, BOOL *stop) {
XCTAssertEqual(aKey, 21LL);
XCTAssertEqualObjects(aValue, @"abc");
XCTAssertEqualObjects(aObject, @"abc");
XCTAssertNotEqual(stop, NULL);
}];
}
- (void)testBasics {
const int64_t kKeys[] = { 21LL, 22LL, 23LL };
const id kValues[] = { @"abc", @"def", @"ghi" };
const id kObjects[] = { @"abc", @"def", @"ghi" };
GPBInt64ObjectDictionary *dict =
[[GPBInt64ObjectDictionary alloc] initWithValues:kValues
forKeys:kKeys
count:GPBARRAYSIZE(kValues)];
[[GPBInt64ObjectDictionary alloc] initWithObjects:kObjects
forKeys:kKeys
count:GPBARRAYSIZE(kObjects)];
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 3U);
XCTAssertEqualObjects([dict valueForKey:21LL], @"abc");
XCTAssertEqualObjects([dict valueForKey:22LL], @"def");
XCTAssertEqualObjects([dict valueForKey:23LL], @"ghi");
XCTAssertNil([dict valueForKey:24LL]);
XCTAssertEqualObjects([dict objectForKey:21LL], @"abc");
XCTAssertEqualObjects([dict objectForKey:22LL], @"def");
XCTAssertEqualObjects([dict objectForKey:23LL], @"ghi");
XCTAssertNil([dict objectForKey:24LL]);
__block NSUInteger idx = 0;
int64_t *seenKeys = malloc(3 * sizeof(int64_t));
id *seenValues = malloc(3 * sizeof(id));
[dict enumerateKeysAndValuesUsingBlock:^(int64_t aKey, id aValue, BOOL *stop) {
id *seenObjects = malloc(3 * sizeof(id));
[dict enumerateKeysAndObjectsUsingBlock:^(int64_t aKey, id aObject, BOOL *stop) {
XCTAssertLessThan(idx, 3U);
seenKeys[idx] = aKey;
seenValues[idx] = aValue;
seenObjects[idx] = aObject;
XCTAssertNotEqual(stop, NULL);
++idx;
}];
@ -3416,18 +3416,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
for (int j = 0; (j < 3) && !foundKey; ++j) {
if (kKeys[i] == seenKeys[j]) {
foundKey = YES;
XCTAssertEqualObjects(kValues[i], seenValues[j], @"i = %d, j = %d", i, j);
XCTAssertEqualObjects(kObjects[i], seenObjects[j], @"i = %d, j = %d", i, j);
}
}
XCTAssertTrue(foundKey, @"i = %d", i);
}
free(seenKeys);
free(seenValues);
free(seenObjects);
// Stopping the enumeration.
idx = 0;
[dict enumerateKeysAndValuesUsingBlock:^(int64_t aKey, id aValue, BOOL *stop) {
#pragma unused(aKey, aValue)
[dict enumerateKeysAndObjectsUsingBlock:^(int64_t aKey, id aObject, BOOL *stop) {
#pragma unused(aKey, aObject)
if (idx == 1) *stop = YES;
XCTAssertNotEqual(idx, 2U);
++idx;
@ -3438,33 +3438,33 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
- (void)testEquality {
const int64_t kKeys1[] = { 21LL, 22LL, 23LL, 24LL };
const int64_t kKeys2[] = { 22LL, 21LL, 24LL };
const id kValues1[] = { @"abc", @"def", @"ghi" };
const id kValues2[] = { @"abc", @"jkl", @"ghi" };
const id kValues3[] = { @"abc", @"def", @"ghi", @"jkl" };
const id kObjects1[] = { @"abc", @"def", @"ghi" };
const id kObjects2[] = { @"abc", @"jkl", @"ghi" };
const id kObjects3[] = { @"abc", @"def", @"ghi", @"jkl" };
GPBInt64ObjectDictionary *dict1 =
[[GPBInt64ObjectDictionary alloc] initWithValues:kValues1
forKeys:kKeys1
count:GPBARRAYSIZE(kValues1)];
[[GPBInt64ObjectDictionary alloc] initWithObjects:kObjects1
forKeys:kKeys1
count:GPBARRAYSIZE(kObjects1)];
XCTAssertNotNil(dict1);
GPBInt64ObjectDictionary *dict1prime =
[[GPBInt64ObjectDictionary alloc] initWithValues:kValues1
forKeys:kKeys1
count:GPBARRAYSIZE(kValues1)];
[[GPBInt64ObjectDictionary alloc] initWithObjects:kObjects1
forKeys:kKeys1
count:GPBARRAYSIZE(kObjects1)];
XCTAssertNotNil(dict1prime);
GPBInt64ObjectDictionary *dict2 =
[[GPBInt64ObjectDictionary alloc] initWithValues:kValues2
forKeys:kKeys1
count:GPBARRAYSIZE(kValues2)];
[[GPBInt64ObjectDictionary alloc] initWithObjects:kObjects2
forKeys:kKeys1
count:GPBARRAYSIZE(kObjects2)];
XCTAssertNotNil(dict2);
GPBInt64ObjectDictionary *dict3 =
[[GPBInt64ObjectDictionary alloc] initWithValues:kValues1
forKeys:kKeys2
count:GPBARRAYSIZE(kValues1)];
[[GPBInt64ObjectDictionary alloc] initWithObjects:kObjects1
forKeys:kKeys2
count:GPBARRAYSIZE(kObjects1)];
XCTAssertNotNil(dict3);
GPBInt64ObjectDictionary *dict4 =
[[GPBInt64ObjectDictionary alloc] initWithValues:kValues3
forKeys:kKeys1
count:GPBARRAYSIZE(kValues3)];
[[GPBInt64ObjectDictionary alloc] initWithObjects:kObjects3
forKeys:kKeys1
count:GPBARRAYSIZE(kObjects3)];
XCTAssertNotNil(dict4);
// 1/1Prime should be different objects, but equal.
@ -3473,10 +3473,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different objects; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same objects; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -3491,11 +3491,11 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
- (void)testCopy {
const int64_t kKeys[] = { 21LL, 22LL, 23LL, 24LL };
const id kValues[] = { @"abc", @"def", @"ghi", @"jkl" };
const id kObjects[] = { @"abc", @"def", @"ghi", @"jkl" };
GPBInt64ObjectDictionary *dict =
[[GPBInt64ObjectDictionary alloc] initWithValues:kValues
forKeys:kKeys
count:GPBARRAYSIZE(kValues)];
[[GPBInt64ObjectDictionary alloc] initWithObjects:kObjects
forKeys:kKeys
count:GPBARRAYSIZE(kObjects)];
XCTAssertNotNil(dict);
GPBInt64ObjectDictionary *dict2 = [dict copy];
@ -3512,11 +3512,11 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
- (void)testDictionaryFromDictionary {
const int64_t kKeys[] = { 21LL, 22LL, 23LL, 24LL };
const id kValues[] = { @"abc", @"def", @"ghi", @"jkl" };
const id kObjects[] = { @"abc", @"def", @"ghi", @"jkl" };
GPBInt64ObjectDictionary *dict =
[[GPBInt64ObjectDictionary alloc] initWithValues:kValues
forKeys:kKeys
count:GPBARRAYSIZE(kValues)];
[[GPBInt64ObjectDictionary alloc] initWithObjects:kObjects
forKeys:kKeys
count:GPBARRAYSIZE(kObjects)];
XCTAssertNotNil(dict);
GPBInt64ObjectDictionary *dict2 =
@ -3534,108 +3534,108 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 0U);
[dict setValue:@"abc" forKey:21LL];
[dict setObject:@"abc" forKey:21LL];
XCTAssertEqual(dict.count, 1U);
const int64_t kKeys[] = { 22LL, 23LL, 24LL };
const id kValues[] = { @"def", @"ghi", @"jkl" };
const id kObjects[] = { @"def", @"ghi", @"jkl" };
GPBInt64ObjectDictionary *dict2 =
[[GPBInt64ObjectDictionary alloc] initWithValues:kValues
forKeys:kKeys
count:GPBARRAYSIZE(kValues)];
[[GPBInt64ObjectDictionary alloc] initWithObjects:kObjects
forKeys:kKeys
count:GPBARRAYSIZE(kObjects)];
XCTAssertNotNil(dict2);
[dict addEntriesFromDictionary:dict2];
XCTAssertEqual(dict.count, 4U);
XCTAssertEqualObjects([dict valueForKey:21LL], @"abc");
XCTAssertEqualObjects([dict valueForKey:22LL], @"def");
XCTAssertEqualObjects([dict valueForKey:23LL], @"ghi");
XCTAssertEqualObjects([dict valueForKey:24LL], @"jkl");
XCTAssertEqualObjects([dict objectForKey:21LL], @"abc");
XCTAssertEqualObjects([dict objectForKey:22LL], @"def");
XCTAssertEqualObjects([dict objectForKey:23LL], @"ghi");
XCTAssertEqualObjects([dict objectForKey:24LL], @"jkl");
[dict2 release];
}
- (void)testRemove {
const int64_t kKeys[] = { 21LL, 22LL, 23LL, 24LL };
const id kValues[] = { @"abc", @"def", @"ghi", @"jkl" };
const id kObjects[] = { @"abc", @"def", @"ghi", @"jkl" };
GPBInt64ObjectDictionary *dict =
[[GPBInt64ObjectDictionary alloc] initWithValues:kValues
forKeys:kKeys
count:GPBARRAYSIZE(kValues)];
[[GPBInt64ObjectDictionary alloc] initWithObjects:kObjects
forKeys:kKeys
count:GPBARRAYSIZE(kObjects)];
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 4U);
[dict removeValueForKey:22LL];
[dict removeObjectForKey:22LL];
XCTAssertEqual(dict.count, 3U);
XCTAssertEqualObjects([dict valueForKey:21LL], @"abc");
XCTAssertNil([dict valueForKey:22LL]);
XCTAssertEqualObjects([dict valueForKey:23LL], @"ghi");
XCTAssertEqualObjects([dict valueForKey:24LL], @"jkl");
XCTAssertEqualObjects([dict objectForKey:21LL], @"abc");
XCTAssertNil([dict objectForKey:22LL]);
XCTAssertEqualObjects([dict objectForKey:23LL], @"ghi");
XCTAssertEqualObjects([dict objectForKey:24LL], @"jkl");
// Remove again does nothing.
[dict removeValueForKey:22LL];
[dict removeObjectForKey:22LL];
XCTAssertEqual(dict.count, 3U);
XCTAssertEqualObjects([dict valueForKey:21LL], @"abc");
XCTAssertNil([dict valueForKey:22LL]);
XCTAssertEqualObjects([dict valueForKey:23LL], @"ghi");
XCTAssertEqualObjects([dict valueForKey:24LL], @"jkl");
XCTAssertEqualObjects([dict objectForKey:21LL], @"abc");
XCTAssertNil([dict objectForKey:22LL]);
XCTAssertEqualObjects([dict objectForKey:23LL], @"ghi");
XCTAssertEqualObjects([dict objectForKey:24LL], @"jkl");
[dict removeValueForKey:24LL];
[dict removeObjectForKey:24LL];
XCTAssertEqual(dict.count, 2U);
XCTAssertEqualObjects([dict valueForKey:21LL], @"abc");
XCTAssertNil([dict valueForKey:22LL]);
XCTAssertEqualObjects([dict valueForKey:23LL], @"ghi");
XCTAssertNil([dict valueForKey:24LL]);
XCTAssertEqualObjects([dict objectForKey:21LL], @"abc");
XCTAssertNil([dict objectForKey:22LL]);
XCTAssertEqualObjects([dict objectForKey:23LL], @"ghi");
XCTAssertNil([dict objectForKey:24LL]);
[dict removeAll];
XCTAssertEqual(dict.count, 0U);
XCTAssertNil([dict valueForKey:21LL]);
XCTAssertNil([dict valueForKey:22LL]);
XCTAssertNil([dict valueForKey:23LL]);
XCTAssertNil([dict valueForKey:24LL]);
XCTAssertNil([dict objectForKey:21LL]);
XCTAssertNil([dict objectForKey:22LL]);
XCTAssertNil([dict objectForKey:23LL]);
XCTAssertNil([dict objectForKey:24LL]);
[dict release];
}
- (void)testInplaceMutation {
const int64_t kKeys[] = { 21LL, 22LL, 23LL, 24LL };
const id kValues[] = { @"abc", @"def", @"ghi", @"jkl" };
const id kObjects[] = { @"abc", @"def", @"ghi", @"jkl" };
GPBInt64ObjectDictionary *dict =
[[GPBInt64ObjectDictionary alloc] initWithValues:kValues
forKeys:kKeys
count:GPBARRAYSIZE(kValues)];
[[GPBInt64ObjectDictionary alloc] initWithObjects:kObjects
forKeys:kKeys
count:GPBARRAYSIZE(kObjects)];
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 4U);
XCTAssertEqualObjects([dict valueForKey:21LL], @"abc");
XCTAssertEqualObjects([dict valueForKey:22LL], @"def");
XCTAssertEqualObjects([dict valueForKey:23LL], @"ghi");
XCTAssertEqualObjects([dict valueForKey:24LL], @"jkl");
XCTAssertEqualObjects([dict objectForKey:21LL], @"abc");
XCTAssertEqualObjects([dict objectForKey:22LL], @"def");
XCTAssertEqualObjects([dict objectForKey:23LL], @"ghi");
XCTAssertEqualObjects([dict objectForKey:24LL], @"jkl");
[dict setValue:@"jkl" forKey:21LL];
[dict setObject:@"jkl" forKey:21LL];
XCTAssertEqual(dict.count, 4U);
XCTAssertEqualObjects([dict valueForKey:21LL], @"jkl");
XCTAssertEqualObjects([dict valueForKey:22LL], @"def");
XCTAssertEqualObjects([dict valueForKey:23LL], @"ghi");
XCTAssertEqualObjects([dict valueForKey:24LL], @"jkl");
XCTAssertEqualObjects([dict objectForKey:21LL], @"jkl");
XCTAssertEqualObjects([dict objectForKey:22LL], @"def");
XCTAssertEqualObjects([dict objectForKey:23LL], @"ghi");
XCTAssertEqualObjects([dict objectForKey:24LL], @"jkl");
[dict setValue:@"def" forKey:24LL];
[dict setObject:@"def" forKey:24LL];
XCTAssertEqual(dict.count, 4U);
XCTAssertEqualObjects([dict valueForKey:21LL], @"jkl");
XCTAssertEqualObjects([dict valueForKey:22LL], @"def");
XCTAssertEqualObjects([dict valueForKey:23LL], @"ghi");
XCTAssertEqualObjects([dict valueForKey:24LL], @"def");
XCTAssertEqualObjects([dict objectForKey:21LL], @"jkl");
XCTAssertEqualObjects([dict objectForKey:22LL], @"def");
XCTAssertEqualObjects([dict objectForKey:23LL], @"ghi");
XCTAssertEqualObjects([dict objectForKey:24LL], @"def");
const int64_t kKeys2[] = { 22LL, 23LL };
const id kValues2[] = { @"ghi", @"abc" };
const id kObjects2[] = { @"ghi", @"abc" };
GPBInt64ObjectDictionary *dict2 =
[[GPBInt64ObjectDictionary alloc] initWithValues:kValues2
forKeys:kKeys2
count:GPBARRAYSIZE(kValues2)];
[[GPBInt64ObjectDictionary alloc] initWithObjects:kObjects2
forKeys:kKeys2
count:GPBARRAYSIZE(kObjects2)];
XCTAssertNotNil(dict2);
[dict addEntriesFromDictionary:dict2];
XCTAssertEqual(dict.count, 4U);
XCTAssertEqualObjects([dict valueForKey:21LL], @"jkl");
XCTAssertEqualObjects([dict valueForKey:22LL], @"ghi");
XCTAssertEqualObjects([dict valueForKey:23LL], @"abc");
XCTAssertEqualObjects([dict valueForKey:24LL], @"def");
XCTAssertEqualObjects([dict objectForKey:21LL], @"jkl");
XCTAssertEqualObjects([dict objectForKey:22LL], @"ghi");
XCTAssertEqualObjects([dict objectForKey:23LL], @"abc");
XCTAssertEqualObjects([dict objectForKey:24LL], @"def");
[dict2 release];
[dict release];

View File

@ -211,10 +211,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -568,10 +568,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -925,10 +925,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -1282,10 +1282,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -1639,10 +1639,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -1996,10 +1996,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -2353,10 +2353,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -2710,10 +2710,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -3071,10 +3071,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal

View File

@ -211,10 +211,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -568,10 +568,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -925,10 +925,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -1282,10 +1282,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -1639,10 +1639,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -1996,10 +1996,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -2353,10 +2353,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -2710,10 +2710,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -3071,10 +3071,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -3366,48 +3366,48 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
GPBUInt32ObjectDictionary *dict = [[GPBUInt32ObjectDictionary alloc] init];
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 0U);
XCTAssertNil([dict valueForKey:1U]);
[dict enumerateKeysAndValuesUsingBlock:^(uint32_t aKey, id aValue, BOOL *stop) {
#pragma unused(aKey, aValue, stop)
XCTAssertNil([dict objectForKey:1U]);
[dict enumerateKeysAndObjectsUsingBlock:^(uint32_t aKey, id aObject, BOOL *stop) {
#pragma unused(aKey, aObject, stop)
XCTFail(@"Shouldn't get here!");
}];
[dict release];
}
- (void)testOne {
GPBUInt32ObjectDictionary *dict = [GPBUInt32ObjectDictionary dictionaryWithValue:@"abc" forKey:1U];
GPBUInt32ObjectDictionary *dict = [GPBUInt32ObjectDictionary dictionaryWithObject:@"abc" forKey:1U];
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 1U);
XCTAssertEqualObjects([dict valueForKey:1U], @"abc");
XCTAssertNil([dict valueForKey:2U]);
[dict enumerateKeysAndValuesUsingBlock:^(uint32_t aKey, id aValue, BOOL *stop) {
XCTAssertEqualObjects([dict objectForKey:1U], @"abc");
XCTAssertNil([dict objectForKey:2U]);
[dict enumerateKeysAndObjectsUsingBlock:^(uint32_t aKey, id aObject, BOOL *stop) {
XCTAssertEqual(aKey, 1U);
XCTAssertEqualObjects(aValue, @"abc");
XCTAssertEqualObjects(aObject, @"abc");
XCTAssertNotEqual(stop, NULL);
}];
}
- (void)testBasics {
const uint32_t kKeys[] = { 1U, 2U, 3U };
const id kValues[] = { @"abc", @"def", @"ghi" };
const id kObjects[] = { @"abc", @"def", @"ghi" };
GPBUInt32ObjectDictionary *dict =
[[GPBUInt32ObjectDictionary alloc] initWithValues:kValues
forKeys:kKeys
count:GPBARRAYSIZE(kValues)];
[[GPBUInt32ObjectDictionary alloc] initWithObjects:kObjects
forKeys:kKeys
count:GPBARRAYSIZE(kObjects)];
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 3U);
XCTAssertEqualObjects([dict valueForKey:1U], @"abc");
XCTAssertEqualObjects([dict valueForKey:2U], @"def");
XCTAssertEqualObjects([dict valueForKey:3U], @"ghi");
XCTAssertNil([dict valueForKey:4U]);
XCTAssertEqualObjects([dict objectForKey:1U], @"abc");
XCTAssertEqualObjects([dict objectForKey:2U], @"def");
XCTAssertEqualObjects([dict objectForKey:3U], @"ghi");
XCTAssertNil([dict objectForKey:4U]);
__block NSUInteger idx = 0;
uint32_t *seenKeys = malloc(3 * sizeof(uint32_t));
id *seenValues = malloc(3 * sizeof(id));
[dict enumerateKeysAndValuesUsingBlock:^(uint32_t aKey, id aValue, BOOL *stop) {
id *seenObjects = malloc(3 * sizeof(id));
[dict enumerateKeysAndObjectsUsingBlock:^(uint32_t aKey, id aObject, BOOL *stop) {
XCTAssertLessThan(idx, 3U);
seenKeys[idx] = aKey;
seenValues[idx] = aValue;
seenObjects[idx] = aObject;
XCTAssertNotEqual(stop, NULL);
++idx;
}];
@ -3416,18 +3416,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
for (int j = 0; (j < 3) && !foundKey; ++j) {
if (kKeys[i] == seenKeys[j]) {
foundKey = YES;
XCTAssertEqualObjects(kValues[i], seenValues[j], @"i = %d, j = %d", i, j);
XCTAssertEqualObjects(kObjects[i], seenObjects[j], @"i = %d, j = %d", i, j);
}
}
XCTAssertTrue(foundKey, @"i = %d", i);
}
free(seenKeys);
free(seenValues);
free(seenObjects);
// Stopping the enumeration.
idx = 0;
[dict enumerateKeysAndValuesUsingBlock:^(uint32_t aKey, id aValue, BOOL *stop) {
#pragma unused(aKey, aValue)
[dict enumerateKeysAndObjectsUsingBlock:^(uint32_t aKey, id aObject, BOOL *stop) {
#pragma unused(aKey, aObject)
if (idx == 1) *stop = YES;
XCTAssertNotEqual(idx, 2U);
++idx;
@ -3438,33 +3438,33 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
- (void)testEquality {
const uint32_t kKeys1[] = { 1U, 2U, 3U, 4U };
const uint32_t kKeys2[] = { 2U, 1U, 4U };
const id kValues1[] = { @"abc", @"def", @"ghi" };
const id kValues2[] = { @"abc", @"jkl", @"ghi" };
const id kValues3[] = { @"abc", @"def", @"ghi", @"jkl" };
const id kObjects1[] = { @"abc", @"def", @"ghi" };
const id kObjects2[] = { @"abc", @"jkl", @"ghi" };
const id kObjects3[] = { @"abc", @"def", @"ghi", @"jkl" };
GPBUInt32ObjectDictionary *dict1 =
[[GPBUInt32ObjectDictionary alloc] initWithValues:kValues1
forKeys:kKeys1
count:GPBARRAYSIZE(kValues1)];
[[GPBUInt32ObjectDictionary alloc] initWithObjects:kObjects1
forKeys:kKeys1
count:GPBARRAYSIZE(kObjects1)];
XCTAssertNotNil(dict1);
GPBUInt32ObjectDictionary *dict1prime =
[[GPBUInt32ObjectDictionary alloc] initWithValues:kValues1
forKeys:kKeys1
count:GPBARRAYSIZE(kValues1)];
[[GPBUInt32ObjectDictionary alloc] initWithObjects:kObjects1
forKeys:kKeys1
count:GPBARRAYSIZE(kObjects1)];
XCTAssertNotNil(dict1prime);
GPBUInt32ObjectDictionary *dict2 =
[[GPBUInt32ObjectDictionary alloc] initWithValues:kValues2
forKeys:kKeys1
count:GPBARRAYSIZE(kValues2)];
[[GPBUInt32ObjectDictionary alloc] initWithObjects:kObjects2
forKeys:kKeys1
count:GPBARRAYSIZE(kObjects2)];
XCTAssertNotNil(dict2);
GPBUInt32ObjectDictionary *dict3 =
[[GPBUInt32ObjectDictionary alloc] initWithValues:kValues1
forKeys:kKeys2
count:GPBARRAYSIZE(kValues1)];
[[GPBUInt32ObjectDictionary alloc] initWithObjects:kObjects1
forKeys:kKeys2
count:GPBARRAYSIZE(kObjects1)];
XCTAssertNotNil(dict3);
GPBUInt32ObjectDictionary *dict4 =
[[GPBUInt32ObjectDictionary alloc] initWithValues:kValues3
forKeys:kKeys1
count:GPBARRAYSIZE(kValues3)];
[[GPBUInt32ObjectDictionary alloc] initWithObjects:kObjects3
forKeys:kKeys1
count:GPBARRAYSIZE(kObjects3)];
XCTAssertNotNil(dict4);
// 1/1Prime should be different objects, but equal.
@ -3473,10 +3473,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different objects; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same objects; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -3491,11 +3491,11 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
- (void)testCopy {
const uint32_t kKeys[] = { 1U, 2U, 3U, 4U };
const id kValues[] = { @"abc", @"def", @"ghi", @"jkl" };
const id kObjects[] = { @"abc", @"def", @"ghi", @"jkl" };
GPBUInt32ObjectDictionary *dict =
[[GPBUInt32ObjectDictionary alloc] initWithValues:kValues
forKeys:kKeys
count:GPBARRAYSIZE(kValues)];
[[GPBUInt32ObjectDictionary alloc] initWithObjects:kObjects
forKeys:kKeys
count:GPBARRAYSIZE(kObjects)];
XCTAssertNotNil(dict);
GPBUInt32ObjectDictionary *dict2 = [dict copy];
@ -3512,11 +3512,11 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
- (void)testDictionaryFromDictionary {
const uint32_t kKeys[] = { 1U, 2U, 3U, 4U };
const id kValues[] = { @"abc", @"def", @"ghi", @"jkl" };
const id kObjects[] = { @"abc", @"def", @"ghi", @"jkl" };
GPBUInt32ObjectDictionary *dict =
[[GPBUInt32ObjectDictionary alloc] initWithValues:kValues
forKeys:kKeys
count:GPBARRAYSIZE(kValues)];
[[GPBUInt32ObjectDictionary alloc] initWithObjects:kObjects
forKeys:kKeys
count:GPBARRAYSIZE(kObjects)];
XCTAssertNotNil(dict);
GPBUInt32ObjectDictionary *dict2 =
@ -3534,108 +3534,108 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 0U);
[dict setValue:@"abc" forKey:1U];
[dict setObject:@"abc" forKey:1U];
XCTAssertEqual(dict.count, 1U);
const uint32_t kKeys[] = { 2U, 3U, 4U };
const id kValues[] = { @"def", @"ghi", @"jkl" };
const id kObjects[] = { @"def", @"ghi", @"jkl" };
GPBUInt32ObjectDictionary *dict2 =
[[GPBUInt32ObjectDictionary alloc] initWithValues:kValues
forKeys:kKeys
count:GPBARRAYSIZE(kValues)];
[[GPBUInt32ObjectDictionary alloc] initWithObjects:kObjects
forKeys:kKeys
count:GPBARRAYSIZE(kObjects)];
XCTAssertNotNil(dict2);
[dict addEntriesFromDictionary:dict2];
XCTAssertEqual(dict.count, 4U);
XCTAssertEqualObjects([dict valueForKey:1U], @"abc");
XCTAssertEqualObjects([dict valueForKey:2U], @"def");
XCTAssertEqualObjects([dict valueForKey:3U], @"ghi");
XCTAssertEqualObjects([dict valueForKey:4U], @"jkl");
XCTAssertEqualObjects([dict objectForKey:1U], @"abc");
XCTAssertEqualObjects([dict objectForKey:2U], @"def");
XCTAssertEqualObjects([dict objectForKey:3U], @"ghi");
XCTAssertEqualObjects([dict objectForKey:4U], @"jkl");
[dict2 release];
}
- (void)testRemove {
const uint32_t kKeys[] = { 1U, 2U, 3U, 4U };
const id kValues[] = { @"abc", @"def", @"ghi", @"jkl" };
const id kObjects[] = { @"abc", @"def", @"ghi", @"jkl" };
GPBUInt32ObjectDictionary *dict =
[[GPBUInt32ObjectDictionary alloc] initWithValues:kValues
forKeys:kKeys
count:GPBARRAYSIZE(kValues)];
[[GPBUInt32ObjectDictionary alloc] initWithObjects:kObjects
forKeys:kKeys
count:GPBARRAYSIZE(kObjects)];
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 4U);
[dict removeValueForKey:2U];
[dict removeObjectForKey:2U];
XCTAssertEqual(dict.count, 3U);
XCTAssertEqualObjects([dict valueForKey:1U], @"abc");
XCTAssertNil([dict valueForKey:2U]);
XCTAssertEqualObjects([dict valueForKey:3U], @"ghi");
XCTAssertEqualObjects([dict valueForKey:4U], @"jkl");
XCTAssertEqualObjects([dict objectForKey:1U], @"abc");
XCTAssertNil([dict objectForKey:2U]);
XCTAssertEqualObjects([dict objectForKey:3U], @"ghi");
XCTAssertEqualObjects([dict objectForKey:4U], @"jkl");
// Remove again does nothing.
[dict removeValueForKey:2U];
[dict removeObjectForKey:2U];
XCTAssertEqual(dict.count, 3U);
XCTAssertEqualObjects([dict valueForKey:1U], @"abc");
XCTAssertNil([dict valueForKey:2U]);
XCTAssertEqualObjects([dict valueForKey:3U], @"ghi");
XCTAssertEqualObjects([dict valueForKey:4U], @"jkl");
XCTAssertEqualObjects([dict objectForKey:1U], @"abc");
XCTAssertNil([dict objectForKey:2U]);
XCTAssertEqualObjects([dict objectForKey:3U], @"ghi");
XCTAssertEqualObjects([dict objectForKey:4U], @"jkl");
[dict removeValueForKey:4U];
[dict removeObjectForKey:4U];
XCTAssertEqual(dict.count, 2U);
XCTAssertEqualObjects([dict valueForKey:1U], @"abc");
XCTAssertNil([dict valueForKey:2U]);
XCTAssertEqualObjects([dict valueForKey:3U], @"ghi");
XCTAssertNil([dict valueForKey:4U]);
XCTAssertEqualObjects([dict objectForKey:1U], @"abc");
XCTAssertNil([dict objectForKey:2U]);
XCTAssertEqualObjects([dict objectForKey:3U], @"ghi");
XCTAssertNil([dict objectForKey:4U]);
[dict removeAll];
XCTAssertEqual(dict.count, 0U);
XCTAssertNil([dict valueForKey:1U]);
XCTAssertNil([dict valueForKey:2U]);
XCTAssertNil([dict valueForKey:3U]);
XCTAssertNil([dict valueForKey:4U]);
XCTAssertNil([dict objectForKey:1U]);
XCTAssertNil([dict objectForKey:2U]);
XCTAssertNil([dict objectForKey:3U]);
XCTAssertNil([dict objectForKey:4U]);
[dict release];
}
- (void)testInplaceMutation {
const uint32_t kKeys[] = { 1U, 2U, 3U, 4U };
const id kValues[] = { @"abc", @"def", @"ghi", @"jkl" };
const id kObjects[] = { @"abc", @"def", @"ghi", @"jkl" };
GPBUInt32ObjectDictionary *dict =
[[GPBUInt32ObjectDictionary alloc] initWithValues:kValues
forKeys:kKeys
count:GPBARRAYSIZE(kValues)];
[[GPBUInt32ObjectDictionary alloc] initWithObjects:kObjects
forKeys:kKeys
count:GPBARRAYSIZE(kObjects)];
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 4U);
XCTAssertEqualObjects([dict valueForKey:1U], @"abc");
XCTAssertEqualObjects([dict valueForKey:2U], @"def");
XCTAssertEqualObjects([dict valueForKey:3U], @"ghi");
XCTAssertEqualObjects([dict valueForKey:4U], @"jkl");
XCTAssertEqualObjects([dict objectForKey:1U], @"abc");
XCTAssertEqualObjects([dict objectForKey:2U], @"def");
XCTAssertEqualObjects([dict objectForKey:3U], @"ghi");
XCTAssertEqualObjects([dict objectForKey:4U], @"jkl");
[dict setValue:@"jkl" forKey:1U];
[dict setObject:@"jkl" forKey:1U];
XCTAssertEqual(dict.count, 4U);
XCTAssertEqualObjects([dict valueForKey:1U], @"jkl");
XCTAssertEqualObjects([dict valueForKey:2U], @"def");
XCTAssertEqualObjects([dict valueForKey:3U], @"ghi");
XCTAssertEqualObjects([dict valueForKey:4U], @"jkl");
XCTAssertEqualObjects([dict objectForKey:1U], @"jkl");
XCTAssertEqualObjects([dict objectForKey:2U], @"def");
XCTAssertEqualObjects([dict objectForKey:3U], @"ghi");
XCTAssertEqualObjects([dict objectForKey:4U], @"jkl");
[dict setValue:@"def" forKey:4U];
[dict setObject:@"def" forKey:4U];
XCTAssertEqual(dict.count, 4U);
XCTAssertEqualObjects([dict valueForKey:1U], @"jkl");
XCTAssertEqualObjects([dict valueForKey:2U], @"def");
XCTAssertEqualObjects([dict valueForKey:3U], @"ghi");
XCTAssertEqualObjects([dict valueForKey:4U], @"def");
XCTAssertEqualObjects([dict objectForKey:1U], @"jkl");
XCTAssertEqualObjects([dict objectForKey:2U], @"def");
XCTAssertEqualObjects([dict objectForKey:3U], @"ghi");
XCTAssertEqualObjects([dict objectForKey:4U], @"def");
const uint32_t kKeys2[] = { 2U, 3U };
const id kValues2[] = { @"ghi", @"abc" };
const id kObjects2[] = { @"ghi", @"abc" };
GPBUInt32ObjectDictionary *dict2 =
[[GPBUInt32ObjectDictionary alloc] initWithValues:kValues2
forKeys:kKeys2
count:GPBARRAYSIZE(kValues2)];
[[GPBUInt32ObjectDictionary alloc] initWithObjects:kObjects2
forKeys:kKeys2
count:GPBARRAYSIZE(kObjects2)];
XCTAssertNotNil(dict2);
[dict addEntriesFromDictionary:dict2];
XCTAssertEqual(dict.count, 4U);
XCTAssertEqualObjects([dict valueForKey:1U], @"jkl");
XCTAssertEqualObjects([dict valueForKey:2U], @"ghi");
XCTAssertEqualObjects([dict valueForKey:3U], @"abc");
XCTAssertEqualObjects([dict valueForKey:4U], @"def");
XCTAssertEqualObjects([dict objectForKey:1U], @"jkl");
XCTAssertEqualObjects([dict objectForKey:2U], @"ghi");
XCTAssertEqualObjects([dict objectForKey:3U], @"abc");
XCTAssertEqualObjects([dict objectForKey:4U], @"def");
[dict2 release];
[dict release];

View File

@ -211,10 +211,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -568,10 +568,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -925,10 +925,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -1282,10 +1282,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -1639,10 +1639,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -1996,10 +1996,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -2353,10 +2353,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -2710,10 +2710,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -3071,10 +3071,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different values; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same values; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -3366,48 +3366,48 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
GPBUInt64ObjectDictionary *dict = [[GPBUInt64ObjectDictionary alloc] init];
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 0U);
XCTAssertNil([dict valueForKey:31ULL]);
[dict enumerateKeysAndValuesUsingBlock:^(uint64_t aKey, id aValue, BOOL *stop) {
#pragma unused(aKey, aValue, stop)
XCTAssertNil([dict objectForKey:31ULL]);
[dict enumerateKeysAndObjectsUsingBlock:^(uint64_t aKey, id aObject, BOOL *stop) {
#pragma unused(aKey, aObject, stop)
XCTFail(@"Shouldn't get here!");
}];
[dict release];
}
- (void)testOne {
GPBUInt64ObjectDictionary *dict = [GPBUInt64ObjectDictionary dictionaryWithValue:@"abc" forKey:31ULL];
GPBUInt64ObjectDictionary *dict = [GPBUInt64ObjectDictionary dictionaryWithObject:@"abc" forKey:31ULL];
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 1U);
XCTAssertEqualObjects([dict valueForKey:31ULL], @"abc");
XCTAssertNil([dict valueForKey:32ULL]);
[dict enumerateKeysAndValuesUsingBlock:^(uint64_t aKey, id aValue, BOOL *stop) {
XCTAssertEqualObjects([dict objectForKey:31ULL], @"abc");
XCTAssertNil([dict objectForKey:32ULL]);
[dict enumerateKeysAndObjectsUsingBlock:^(uint64_t aKey, id aObject, BOOL *stop) {
XCTAssertEqual(aKey, 31ULL);
XCTAssertEqualObjects(aValue, @"abc");
XCTAssertEqualObjects(aObject, @"abc");
XCTAssertNotEqual(stop, NULL);
}];
}
- (void)testBasics {
const uint64_t kKeys[] = { 31ULL, 32ULL, 33ULL };
const id kValues[] = { @"abc", @"def", @"ghi" };
const id kObjects[] = { @"abc", @"def", @"ghi" };
GPBUInt64ObjectDictionary *dict =
[[GPBUInt64ObjectDictionary alloc] initWithValues:kValues
forKeys:kKeys
count:GPBARRAYSIZE(kValues)];
[[GPBUInt64ObjectDictionary alloc] initWithObjects:kObjects
forKeys:kKeys
count:GPBARRAYSIZE(kObjects)];
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 3U);
XCTAssertEqualObjects([dict valueForKey:31ULL], @"abc");
XCTAssertEqualObjects([dict valueForKey:32ULL], @"def");
XCTAssertEqualObjects([dict valueForKey:33ULL], @"ghi");
XCTAssertNil([dict valueForKey:34ULL]);
XCTAssertEqualObjects([dict objectForKey:31ULL], @"abc");
XCTAssertEqualObjects([dict objectForKey:32ULL], @"def");
XCTAssertEqualObjects([dict objectForKey:33ULL], @"ghi");
XCTAssertNil([dict objectForKey:34ULL]);
__block NSUInteger idx = 0;
uint64_t *seenKeys = malloc(3 * sizeof(uint64_t));
id *seenValues = malloc(3 * sizeof(id));
[dict enumerateKeysAndValuesUsingBlock:^(uint64_t aKey, id aValue, BOOL *stop) {
id *seenObjects = malloc(3 * sizeof(id));
[dict enumerateKeysAndObjectsUsingBlock:^(uint64_t aKey, id aObject, BOOL *stop) {
XCTAssertLessThan(idx, 3U);
seenKeys[idx] = aKey;
seenValues[idx] = aValue;
seenObjects[idx] = aObject;
XCTAssertNotEqual(stop, NULL);
++idx;
}];
@ -3416,18 +3416,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
for (int j = 0; (j < 3) && !foundKey; ++j) {
if (kKeys[i] == seenKeys[j]) {
foundKey = YES;
XCTAssertEqualObjects(kValues[i], seenValues[j], @"i = %d, j = %d", i, j);
XCTAssertEqualObjects(kObjects[i], seenObjects[j], @"i = %d, j = %d", i, j);
}
}
XCTAssertTrue(foundKey, @"i = %d", i);
}
free(seenKeys);
free(seenValues);
free(seenObjects);
// Stopping the enumeration.
idx = 0;
[dict enumerateKeysAndValuesUsingBlock:^(uint64_t aKey, id aValue, BOOL *stop) {
#pragma unused(aKey, aValue)
[dict enumerateKeysAndObjectsUsingBlock:^(uint64_t aKey, id aObject, BOOL *stop) {
#pragma unused(aKey, aObject)
if (idx == 1) *stop = YES;
XCTAssertNotEqual(idx, 2U);
++idx;
@ -3438,33 +3438,33 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
- (void)testEquality {
const uint64_t kKeys1[] = { 31ULL, 32ULL, 33ULL, 34ULL };
const uint64_t kKeys2[] = { 32ULL, 31ULL, 34ULL };
const id kValues1[] = { @"abc", @"def", @"ghi" };
const id kValues2[] = { @"abc", @"jkl", @"ghi" };
const id kValues3[] = { @"abc", @"def", @"ghi", @"jkl" };
const id kObjects1[] = { @"abc", @"def", @"ghi" };
const id kObjects2[] = { @"abc", @"jkl", @"ghi" };
const id kObjects3[] = { @"abc", @"def", @"ghi", @"jkl" };
GPBUInt64ObjectDictionary *dict1 =
[[GPBUInt64ObjectDictionary alloc] initWithValues:kValues1
forKeys:kKeys1
count:GPBARRAYSIZE(kValues1)];
[[GPBUInt64ObjectDictionary alloc] initWithObjects:kObjects1
forKeys:kKeys1
count:GPBARRAYSIZE(kObjects1)];
XCTAssertNotNil(dict1);
GPBUInt64ObjectDictionary *dict1prime =
[[GPBUInt64ObjectDictionary alloc] initWithValues:kValues1
forKeys:kKeys1
count:GPBARRAYSIZE(kValues1)];
[[GPBUInt64ObjectDictionary alloc] initWithObjects:kObjects1
forKeys:kKeys1
count:GPBARRAYSIZE(kObjects1)];
XCTAssertNotNil(dict1prime);
GPBUInt64ObjectDictionary *dict2 =
[[GPBUInt64ObjectDictionary alloc] initWithValues:kValues2
forKeys:kKeys1
count:GPBARRAYSIZE(kValues2)];
[[GPBUInt64ObjectDictionary alloc] initWithObjects:kObjects2
forKeys:kKeys1
count:GPBARRAYSIZE(kObjects2)];
XCTAssertNotNil(dict2);
GPBUInt64ObjectDictionary *dict3 =
[[GPBUInt64ObjectDictionary alloc] initWithValues:kValues1
forKeys:kKeys2
count:GPBARRAYSIZE(kValues1)];
[[GPBUInt64ObjectDictionary alloc] initWithObjects:kObjects1
forKeys:kKeys2
count:GPBARRAYSIZE(kObjects1)];
XCTAssertNotNil(dict3);
GPBUInt64ObjectDictionary *dict4 =
[[GPBUInt64ObjectDictionary alloc] initWithValues:kValues3
forKeys:kKeys1
count:GPBARRAYSIZE(kValues3)];
[[GPBUInt64ObjectDictionary alloc] initWithObjects:kObjects3
forKeys:kKeys1
count:GPBARRAYSIZE(kObjects3)];
XCTAssertNotNil(dict4);
// 1/1Prime should be different objects, but equal.
@ -3473,10 +3473,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
// Equal, so they must have same hash.
XCTAssertEqual([dict1 hash], [dict1prime hash]);
// 2 is save keys, different values; not equal.
// 2 is same keys, different objects; not equal.
XCTAssertNotEqualObjects(dict1, dict2);
// 3 is different keys, samae values; not equal.
// 3 is different keys, same objects; not equal.
XCTAssertNotEqualObjects(dict1, dict3);
// 4 extra pair; not equal
@ -3491,11 +3491,11 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
- (void)testCopy {
const uint64_t kKeys[] = { 31ULL, 32ULL, 33ULL, 34ULL };
const id kValues[] = { @"abc", @"def", @"ghi", @"jkl" };
const id kObjects[] = { @"abc", @"def", @"ghi", @"jkl" };
GPBUInt64ObjectDictionary *dict =
[[GPBUInt64ObjectDictionary alloc] initWithValues:kValues
forKeys:kKeys
count:GPBARRAYSIZE(kValues)];
[[GPBUInt64ObjectDictionary alloc] initWithObjects:kObjects
forKeys:kKeys
count:GPBARRAYSIZE(kObjects)];
XCTAssertNotNil(dict);
GPBUInt64ObjectDictionary *dict2 = [dict copy];
@ -3512,11 +3512,11 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
- (void)testDictionaryFromDictionary {
const uint64_t kKeys[] = { 31ULL, 32ULL, 33ULL, 34ULL };
const id kValues[] = { @"abc", @"def", @"ghi", @"jkl" };
const id kObjects[] = { @"abc", @"def", @"ghi", @"jkl" };
GPBUInt64ObjectDictionary *dict =
[[GPBUInt64ObjectDictionary alloc] initWithValues:kValues
forKeys:kKeys
count:GPBARRAYSIZE(kValues)];
[[GPBUInt64ObjectDictionary alloc] initWithObjects:kObjects
forKeys:kKeys
count:GPBARRAYSIZE(kObjects)];
XCTAssertNotNil(dict);
GPBUInt64ObjectDictionary *dict2 =
@ -3534,108 +3534,108 @@ static BOOL TestingEnum_IsValidValue(int32_t value) {
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 0U);
[dict setValue:@"abc" forKey:31ULL];
[dict setObject:@"abc" forKey:31ULL];
XCTAssertEqual(dict.count, 1U);
const uint64_t kKeys[] = { 32ULL, 33ULL, 34ULL };
const id kValues[] = { @"def", @"ghi", @"jkl" };
const id kObjects[] = { @"def", @"ghi", @"jkl" };
GPBUInt64ObjectDictionary *dict2 =
[[GPBUInt64ObjectDictionary alloc] initWithValues:kValues
forKeys:kKeys
count:GPBARRAYSIZE(kValues)];
[[GPBUInt64ObjectDictionary alloc] initWithObjects:kObjects
forKeys:kKeys
count:GPBARRAYSIZE(kObjects)];
XCTAssertNotNil(dict2);
[dict addEntriesFromDictionary:dict2];
XCTAssertEqual(dict.count, 4U);
XCTAssertEqualObjects([dict valueForKey:31ULL], @"abc");
XCTAssertEqualObjects([dict valueForKey:32ULL], @"def");
XCTAssertEqualObjects([dict valueForKey:33ULL], @"ghi");
XCTAssertEqualObjects([dict valueForKey:34ULL], @"jkl");
XCTAssertEqualObjects([dict objectForKey:31ULL], @"abc");
XCTAssertEqualObjects([dict objectForKey:32ULL], @"def");
XCTAssertEqualObjects([dict objectForKey:33ULL], @"ghi");
XCTAssertEqualObjects([dict objectForKey:34ULL], @"jkl");
[dict2 release];
}
- (void)testRemove {
const uint64_t kKeys[] = { 31ULL, 32ULL, 33ULL, 34ULL };
const id kValues[] = { @"abc", @"def", @"ghi", @"jkl" };
const id kObjects[] = { @"abc", @"def", @"ghi", @"jkl" };
GPBUInt64ObjectDictionary *dict =
[[GPBUInt64ObjectDictionary alloc] initWithValues:kValues
forKeys:kKeys
count:GPBARRAYSIZE(kValues)];
[[GPBUInt64ObjectDictionary alloc] initWithObjects:kObjects
forKeys:kKeys
count:GPBARRAYSIZE(kObjects)];
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 4U);
[dict removeValueForKey:32ULL];
[dict removeObjectForKey:32ULL];
XCTAssertEqual(dict.count, 3U);
XCTAssertEqualObjects([dict valueForKey:31ULL], @"abc");
XCTAssertNil([dict valueForKey:32ULL]);
XCTAssertEqualObjects([dict valueForKey:33ULL], @"ghi");
XCTAssertEqualObjects([dict valueForKey:34ULL], @"jkl");
XCTAssertEqualObjects([dict objectForKey:31ULL], @"abc");
XCTAssertNil([dict objectForKey:32ULL]);
XCTAssertEqualObjects([dict objectForKey:33ULL], @"ghi");
XCTAssertEqualObjects([dict objectForKey:34ULL], @"jkl");
// Remove again does nothing.
[dict removeValueForKey:32ULL];
[dict removeObjectForKey:32ULL];
XCTAssertEqual(dict.count, 3U);
XCTAssertEqualObjects([dict valueForKey:31ULL], @"abc");
XCTAssertNil([dict valueForKey:32ULL]);
XCTAssertEqualObjects([dict valueForKey:33ULL], @"ghi");
XCTAssertEqualObjects([dict valueForKey:34ULL], @"jkl");
XCTAssertEqualObjects([dict objectForKey:31ULL], @"abc");
XCTAssertNil([dict objectForKey:32ULL]);
XCTAssertEqualObjects([dict objectForKey:33ULL], @"ghi");
XCTAssertEqualObjects([dict objectForKey:34ULL], @"jkl");
[dict removeValueForKey:34ULL];
[dict removeObjectForKey:34ULL];
XCTAssertEqual(dict.count, 2U);
XCTAssertEqualObjects([dict valueForKey:31ULL], @"abc");
XCTAssertNil([dict valueForKey:32ULL]);
XCTAssertEqualObjects([dict valueForKey:33ULL], @"ghi");
XCTAssertNil([dict valueForKey:34ULL]);
XCTAssertEqualObjects([dict objectForKey:31ULL], @"abc");
XCTAssertNil([dict objectForKey:32ULL]);
XCTAssertEqualObjects([dict objectForKey:33ULL], @"ghi");
XCTAssertNil([dict objectForKey:34ULL]);
[dict removeAll];
XCTAssertEqual(dict.count, 0U);
XCTAssertNil([dict valueForKey:31ULL]);
XCTAssertNil([dict valueForKey:32ULL]);
XCTAssertNil([dict valueForKey:33ULL]);
XCTAssertNil([dict valueForKey:34ULL]);
XCTAssertNil([dict objectForKey:31ULL]);
XCTAssertNil([dict objectForKey:32ULL]);
XCTAssertNil([dict objectForKey:33ULL]);
XCTAssertNil([dict objectForKey:34ULL]);
[dict release];
}
- (void)testInplaceMutation {
const uint64_t kKeys[] = { 31ULL, 32ULL, 33ULL, 34ULL };
const id kValues[] = { @"abc", @"def", @"ghi", @"jkl" };
const id kObjects[] = { @"abc", @"def", @"ghi", @"jkl" };
GPBUInt64ObjectDictionary *dict =
[[GPBUInt64ObjectDictionary alloc] initWithValues:kValues
forKeys:kKeys
count:GPBARRAYSIZE(kValues)];
[[GPBUInt64ObjectDictionary alloc] initWithObjects:kObjects
forKeys:kKeys
count:GPBARRAYSIZE(kObjects)];
XCTAssertNotNil(dict);
XCTAssertEqual(dict.count, 4U);
XCTAssertEqualObjects([dict valueForKey:31ULL], @"abc");
XCTAssertEqualObjects([dict valueForKey:32ULL], @"def");
XCTAssertEqualObjects([dict valueForKey:33ULL], @"ghi");
XCTAssertEqualObjects([dict valueForKey:34ULL], @"jkl");
XCTAssertEqualObjects([dict objectForKey:31ULL], @"abc");
XCTAssertEqualObjects([dict objectForKey:32ULL], @"def");
XCTAssertEqualObjects([dict objectForKey:33ULL], @"ghi");
XCTAssertEqualObjects([dict objectForKey:34ULL], @"jkl");
[dict setValue:@"jkl" forKey:31ULL];
[dict setObject:@"jkl" forKey:31ULL];
XCTAssertEqual(dict.count, 4U);
XCTAssertEqualObjects([dict valueForKey:31ULL], @"jkl");
XCTAssertEqualObjects([dict valueForKey:32ULL], @"def");
XCTAssertEqualObjects([dict valueForKey:33ULL], @"ghi");
XCTAssertEqualObjects([dict valueForKey:34ULL], @"jkl");
XCTAssertEqualObjects([dict objectForKey:31ULL], @"jkl");
XCTAssertEqualObjects([dict objectForKey:32ULL], @"def");
XCTAssertEqualObjects([dict objectForKey:33ULL], @"ghi");
XCTAssertEqualObjects([dict objectForKey:34ULL], @"jkl");
[dict setValue:@"def" forKey:34ULL];
[dict setObject:@"def" forKey:34ULL];
XCTAssertEqual(dict.count, 4U);
XCTAssertEqualObjects([dict valueForKey:31ULL], @"jkl");
XCTAssertEqualObjects([dict valueForKey:32ULL], @"def");
XCTAssertEqualObjects([dict valueForKey:33ULL], @"ghi");
XCTAssertEqualObjects([dict valueForKey:34ULL], @"def");
XCTAssertEqualObjects([dict objectForKey:31ULL], @"jkl");
XCTAssertEqualObjects([dict objectForKey:32ULL], @"def");
XCTAssertEqualObjects([dict objectForKey:33ULL], @"ghi");
XCTAssertEqualObjects([dict objectForKey:34ULL], @"def");
const uint64_t kKeys2[] = { 32ULL, 33ULL };
const id kValues2[] = { @"ghi", @"abc" };
const id kObjects2[] = { @"ghi", @"abc" };
GPBUInt64ObjectDictionary *dict2 =
[[GPBUInt64ObjectDictionary alloc] initWithValues:kValues2
forKeys:kKeys2
count:GPBARRAYSIZE(kValues2)];
[[GPBUInt64ObjectDictionary alloc] initWithObjects:kObjects2
forKeys:kKeys2
count:GPBARRAYSIZE(kObjects2)];
XCTAssertNotNil(dict2);
[dict addEntriesFromDictionary:dict2];
XCTAssertEqual(dict.count, 4U);
XCTAssertEqualObjects([dict valueForKey:31ULL], @"jkl");
XCTAssertEqualObjects([dict valueForKey:32ULL], @"ghi");
XCTAssertEqualObjects([dict valueForKey:33ULL], @"abc");
XCTAssertEqualObjects([dict valueForKey:34ULL], @"def");
XCTAssertEqualObjects([dict objectForKey:31ULL], @"jkl");
XCTAssertEqualObjects([dict objectForKey:32ULL], @"ghi");
XCTAssertEqualObjects([dict objectForKey:33ULL], @"abc");
XCTAssertEqualObjects([dict objectForKey:34ULL], @"def");
[dict2 release];
[dict release];

View File

@ -45,12 +45,12 @@
//%TESTS_FOR_ENUM_VALUE_RAW_ADDITIONS(KEY_NAME, KEY_TYPE, KisP, KSUFFIX, KEY1, KEY2, KEY3, KEY4)
//%PDDM-DEFINE TESTS_FOR_POD_VALUE(KEY_NAME, KEY_TYPE, KisP, KSUFFIX, KEY1, KEY2, KEY3, KEY4, VALUE_NAME, VALUE_TYPE, VACCESSOR, VAL1, VAL2, VAL3, VAL4)
//%TESTS_COMMON(KEY_NAME, KEY_TYPE, KisP, KSUFFIX, KEY1, KEY2, KEY3, KEY4, VALUE_NAME, VALUE_TYPE, , POD, VACCESSOR, VAL1, VAL2, VAL3, VAL4)
//%TESTS_COMMON(KEY_NAME, KEY_TYPE, KisP, KSUFFIX, KEY1, KEY2, KEY3, KEY4, VALUE_NAME, VALUE_TYPE, , value, POD, VACCESSOR, VAL1, VAL2, VAL3, VAL4)
//%PDDM-DEFINE TESTS_FOR_POD_KEY_OBJECT_VALUE(KEY_NAME, KEY_TYPE, KEY1, KEY2, KEY3, KEY4, VALUE_NAME, VALUE_TYPE, VAL1, VAL2, VAL3, VAL4)
//%TESTS_COMMON(KEY_NAME, KEY_TYPE, , , KEY1, KEY2, KEY3, KEY4, VALUE_NAME, VALUE_TYPE, Objects, OBJECT, , VAL1, VAL2, VAL3, VAL4)
//%TESTS_COMMON(KEY_NAME, KEY_TYPE, , , KEY1, KEY2, KEY3, KEY4, VALUE_NAME, VALUE_TYPE, Objects, object, OBJECT, , VAL1, VAL2, VAL3, VAL4)
//%PDDM-DEFINE TESTS_COMMON(KEY_NAME, KEY_TYPE, KisP, KSUFFIX, KEY1, KEY2, KEY3, KEY4, VALUE_NAME, VALUE_TYPE, VSUFFIX, VHELPER, VACCESSOR, VAL1, VAL2, VAL3, VAL4)
//%PDDM-DEFINE TESTS_COMMON(KEY_NAME, KEY_TYPE, KisP, KSUFFIX, KEY1, KEY2, KEY3, KEY4, VALUE_NAME, VALUE_TYPE, VSUFFIX, VNAME, VHELPER, VACCESSOR, VAL1, VAL2, VAL3, VAL4)
//%#pragma mark - KEY_NAME -> VALUE_NAME
//%
//%@interface GPB##KEY_NAME##VALUE_NAME##DictionaryTests : XCTestCase
@ -63,47 +63,47 @@
//% XCTAssertNotNil(dict);
//% XCTAssertEqual(dict.count, 0U);
//%VALUE_NOT_FOUND##VHELPER(dict, KEY1)
//% [dict enumerateKeysAndValuesUsingBlock:^(KEY_TYPE KisP##aKey, VALUE_TYPE aValue, BOOL *stop) {
//% #pragma unused(aKey, aValue, stop)
//% [dict enumerateKeysAnd##VNAME$u##sUsingBlock:^(KEY_TYPE KisP##aKey, VALUE_TYPE a##VNAME$u, BOOL *stop) {
//% #pragma unused(aKey, a##VNAME$u, stop)
//% XCTFail(@"Shouldn't get here!");
//% }];
//% [dict release];
//%}
//%
//%- (void)testOne {
//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict = [GPB##KEY_NAME##VALUE_NAME##Dictionary dictionaryWithValue:VAL1 forKey:KEY1];
//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict = [GPB##KEY_NAME##VALUE_NAME##Dictionary dictionaryWith##VNAME$u##:VAL1 forKey:KEY1];
//% XCTAssertNotNil(dict);
//% XCTAssertEqual(dict.count, 1U);
//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, value)TEST_VALUE##VHELPER(dict, value, KEY1, VAL1)
//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, VNAME)TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL1)
//%VALUE_NOT_FOUND##VHELPER(dict, KEY2)
//% [dict enumerateKeysAndValuesUsingBlock:^(KEY_TYPE KisP##aKey, VALUE_TYPE aValue, BOOL *stop) {
//% [dict enumerateKeysAnd##VNAME$u##sUsingBlock:^(KEY_TYPE KisP##aKey, VALUE_TYPE a##VNAME$u, BOOL *stop) {
//% XCTAssertEqual##KSUFFIX(aKey, KEY1);
//% XCTAssertEqual##VSUFFIX(aValue, VAL1);
//% XCTAssertEqual##VSUFFIX(a##VNAME$u, VAL1);
//% XCTAssertNotEqual(stop, NULL);
//% }];
//%}
//%
//%- (void)testBasics {
//% const KEY_TYPE KisP##kKeys[] = { KEY1, KEY2, KEY3 };
//% const VALUE_TYPE kValues[] = { VAL1, VAL2, VAL3 };
//% const VALUE_TYPE k##VNAME$u##s[] = { VAL1, VAL2, VAL3 };
//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict =
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues
//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys
//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues)];
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s)];
//% XCTAssertNotNil(dict);
//% XCTAssertEqual(dict.count, 3U);
//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, value)TEST_VALUE##VHELPER(dict, value, KEY1, VAL1)
//%TEST_VALUE##VHELPER(dict, value, KEY2, VAL2)
//%TEST_VALUE##VHELPER(dict, value, KEY3, VAL3)
//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, VNAME)TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL1)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY2, VAL2)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY3, VAL3)
//%VALUE_NOT_FOUND##VHELPER(dict, KEY4)
//%
//% __block NSUInteger idx = 0;
//% KEY_TYPE KisP##*seenKeys = malloc(3 * sizeof(KEY_TYPE##KisP));
//% VALUE_TYPE *seenValues = malloc(3 * sizeof(VALUE_TYPE));
//% [dict enumerateKeysAndValuesUsingBlock:^(KEY_TYPE KisP##aKey, VALUE_TYPE aValue, BOOL *stop) {
//% VALUE_TYPE *seen##VNAME$u##s = malloc(3 * sizeof(VALUE_TYPE));
//% [dict enumerateKeysAnd##VNAME$u##sUsingBlock:^(KEY_TYPE KisP##aKey, VALUE_TYPE a##VNAME$u, BOOL *stop) {
//% XCTAssertLessThan(idx, 3U);
//% seenKeys[idx] = aKey;
//% seenValues[idx] = aValue;
//% seen##VNAME$u##s[idx] = a##VNAME$u##;
//% XCTAssertNotEqual(stop, NULL);
//% ++idx;
//% }];
@ -112,18 +112,18 @@
//% for (int j = 0; (j < 3) && !foundKey; ++j) {
//% if (COMPARE_KEYS##KSUFFIX(kKeys[i], seenKeys[j])) {
//% foundKey = YES;
//% XCTAssertEqual##VSUFFIX(kValues[i], seenValues[j], @"i = %d, j = %d", i, j);
//% XCTAssertEqual##VSUFFIX(k##VNAME$u##s[i], seen##VNAME$u##s[j], @"i = %d, j = %d", i, j);
//% }
//% }
//% XCTAssertTrue(foundKey, @"i = %d", i);
//% }
//% free(seenKeys);
//% free(seenValues);
//% free(seen##VNAME$u##s);
//%
//% // Stopping the enumeration.
//% idx = 0;
//% [dict enumerateKeysAndValuesUsingBlock:^(KEY_TYPE KisP##aKey, VALUE_TYPE aValue, BOOL *stop) {
//% #pragma unused(aKey, aValue)
//% [dict enumerateKeysAnd##VNAME$u##sUsingBlock:^(KEY_TYPE KisP##aKey, VALUE_TYPE a##VNAME$u, BOOL *stop) {
//% #pragma unused(aKey, a##VNAME$u)
//% if (idx == 1) *stop = YES;
//% XCTAssertNotEqual(idx, 2U);
//% ++idx;
@ -134,33 +134,33 @@
//%- (void)testEquality {
//% const KEY_TYPE KisP##kKeys1[] = { KEY1, KEY2, KEY3, KEY4 };
//% const KEY_TYPE KisP##kKeys2[] = { KEY2, KEY1, KEY4 };
//% const VALUE_TYPE kValues1[] = { VAL1, VAL2, VAL3 };
//% const VALUE_TYPE kValues2[] = { VAL1, VAL4, VAL3 };
//% const VALUE_TYPE kValues3[] = { VAL1, VAL2, VAL3, VAL4 };
//% const VALUE_TYPE k##VNAME$u##s1[] = { VAL1, VAL2, VAL3 };
//% const VALUE_TYPE k##VNAME$u##s2[] = { VAL1, VAL4, VAL3 };
//% const VALUE_TYPE k##VNAME$u##s3[] = { VAL1, VAL2, VAL3, VAL4 };
//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict1 =
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues1
//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys1
//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues1)];
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s1
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys1
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s1)];
//% XCTAssertNotNil(dict1);
//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict1prime =
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues1
//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys1
//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues1)];
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s1
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys1
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s1)];
//% XCTAssertNotNil(dict1prime);
//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict2 =
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues2
//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys1
//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues2)];
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s2
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys1
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s2)];
//% XCTAssertNotNil(dict2);
//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict3 =
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues1
//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys2
//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues1)];
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s1
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys2
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s1)];
//% XCTAssertNotNil(dict3);
//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict4 =
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues3
//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys1
//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues3)];
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s3
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys1
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s3)];
//% XCTAssertNotNil(dict4);
//%
//% // 1/1Prime should be different objects, but equal.
@ -169,10 +169,10 @@
//% // Equal, so they must have same hash.
//% XCTAssertEqual([dict1 hash], [dict1prime hash]);
//%
//% // 2 is save keys, different values; not equal.
//% // 2 is same keys, different ##VNAME##s; not equal.
//% XCTAssertNotEqualObjects(dict1, dict2);
//%
//% // 3 is different keys, samae values; not equal.
//% // 3 is different keys, same ##VNAME##s; not equal.
//% XCTAssertNotEqualObjects(dict1, dict3);
//%
//% // 4 extra pair; not equal
@ -187,11 +187,11 @@
//%
//%- (void)testCopy {
//% const KEY_TYPE KisP##kKeys[] = { KEY1, KEY2, KEY3, KEY4 };
//% const VALUE_TYPE kValues[] = { VAL1, VAL2, VAL3, VAL4 };
//% const VALUE_TYPE k##VNAME$u##s[] = { VAL1, VAL2, VAL3, VAL4 };
//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict =
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues
//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys
//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues)];
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s)];
//% XCTAssertNotNil(dict);
//%
//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict2 = [dict copy];
@ -208,11 +208,11 @@
//%
//%- (void)testDictionaryFromDictionary {
//% const KEY_TYPE KisP##kKeys[] = { KEY1, KEY2, KEY3, KEY4 };
//% const VALUE_TYPE kValues[] = { VAL1, VAL2, VAL3, VAL4 };
//% const VALUE_TYPE k##VNAME$u##s[] = { VAL1, VAL2, VAL3, VAL4 };
//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict =
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues
//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys
//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues)];
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s)];
//% XCTAssertNotNil(dict);
//%
//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict2 =
@ -230,56 +230,56 @@
//% XCTAssertNotNil(dict);
//%
//% XCTAssertEqual(dict.count, 0U);
//% [dict setValue:VAL1 forKey:KEY1];
//% [dict set##VNAME$u##:VAL1 forKey:KEY1];
//% XCTAssertEqual(dict.count, 1U);
//%
//% const KEY_TYPE KisP##kKeys[] = { KEY2, KEY3, KEY4 };
//% const VALUE_TYPE kValues[] = { VAL2, VAL3, VAL4 };
//% const VALUE_TYPE k##VNAME$u##s[] = { VAL2, VAL3, VAL4 };
//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict2 =
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues
//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys
//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues)];
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s)];
//% XCTAssertNotNil(dict2);
//% [dict add##VACCESSOR##EntriesFromDictionary:dict2];
//% XCTAssertEqual(dict.count, 4U);
//%
//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, value)TEST_VALUE##VHELPER(dict, value, KEY1, VAL1)
//%TEST_VALUE##VHELPER(dict, value, KEY2, VAL2)
//%TEST_VALUE##VHELPER(dict, value, KEY3, VAL3)
//%TEST_VALUE##VHELPER(dict, value, KEY4, VAL4)
//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, VNAME)TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL1)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY2, VAL2)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY3, VAL3)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY4, VAL4)
//% [dict2 release];
//%}
//%
//%- (void)testRemove {
//% const KEY_TYPE KisP##kKeys[] = { KEY1, KEY2, KEY3, KEY4 };
//% const VALUE_TYPE kValues[] = { VAL1, VAL2, VAL3, VAL4 };
//% const VALUE_TYPE k##VNAME$u##s[] = { VAL1, VAL2, VAL3, VAL4 };
//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict =
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues
//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys
//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues)];
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s)];
//% XCTAssertNotNil(dict);
//% XCTAssertEqual(dict.count, 4U);
//%
//% [dict removeValueForKey:KEY2];
//% [dict remove##VNAME$u##ForKey:KEY2];
//% XCTAssertEqual(dict.count, 3U);
//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, value)TEST_VALUE##VHELPER(dict, value, KEY1, VAL1)
//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, VNAME)TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL1)
//%VALUE_NOT_FOUND##VHELPER(dict, KEY2)
//%TEST_VALUE##VHELPER(dict, value, KEY3, VAL3)
//%TEST_VALUE##VHELPER(dict, value, KEY4, VAL4)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY3, VAL3)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY4, VAL4)
//%
//% // Remove again does nothing.
//% [dict removeValueForKey:KEY2];
//% [dict remove##VNAME$u##ForKey:KEY2];
//% XCTAssertEqual(dict.count, 3U);
//%TEST_VALUE##VHELPER(dict, value, KEY1, VAL1)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL1)
//%VALUE_NOT_FOUND##VHELPER(dict, KEY2)
//%TEST_VALUE##VHELPER(dict, value, KEY3, VAL3)
//%TEST_VALUE##VHELPER(dict, value, KEY4, VAL4)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY3, VAL3)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY4, VAL4)
//%
//% [dict removeValueForKey:KEY4];
//% [dict remove##VNAME$u##ForKey:KEY4];
//% XCTAssertEqual(dict.count, 2U);
//%TEST_VALUE##VHELPER(dict, value, KEY1, VAL1)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL1)
//%VALUE_NOT_FOUND##VHELPER(dict, KEY2)
//%TEST_VALUE##VHELPER(dict, value, KEY3, VAL3)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY3, VAL3)
//%VALUE_NOT_FOUND##VHELPER(dict, KEY4)
//%
//% [dict removeAll];
@ -293,45 +293,45 @@
//%
//%- (void)testInplaceMutation {
//% const KEY_TYPE KisP##kKeys[] = { KEY1, KEY2, KEY3, KEY4 };
//% const VALUE_TYPE kValues[] = { VAL1, VAL2, VAL3, VAL4 };
//% const VALUE_TYPE k##VNAME$u##s[] = { VAL1, VAL2, VAL3, VAL4 };
//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict =
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues
//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys
//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues)];
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s)];
//% XCTAssertNotNil(dict);
//% XCTAssertEqual(dict.count, 4U);
//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, value)TEST_VALUE##VHELPER(dict, value, KEY1, VAL1)
//%TEST_VALUE##VHELPER(dict, value, KEY2, VAL2)
//%TEST_VALUE##VHELPER(dict, value, KEY3, VAL3)
//%TEST_VALUE##VHELPER(dict, value, KEY4, VAL4)
//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, VNAME)TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL1)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY2, VAL2)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY3, VAL3)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY4, VAL4)
//%
//% [dict setValue:VAL4 forKey:KEY1];
//% [dict set##VNAME$u##:VAL4 forKey:KEY1];
//% XCTAssertEqual(dict.count, 4U);
//%TEST_VALUE##VHELPER(dict, value, KEY1, VAL4)
//%TEST_VALUE##VHELPER(dict, value, KEY2, VAL2)
//%TEST_VALUE##VHELPER(dict, value, KEY3, VAL3)
//%TEST_VALUE##VHELPER(dict, value, KEY4, VAL4)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL4)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY2, VAL2)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY3, VAL3)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY4, VAL4)
//%
//% [dict setValue:VAL2 forKey:KEY4];
//% [dict set##VNAME$u##:VAL2 forKey:KEY4];
//% XCTAssertEqual(dict.count, 4U);
//%TEST_VALUE##VHELPER(dict, value, KEY1, VAL4)
//%TEST_VALUE##VHELPER(dict, value, KEY2, VAL2)
//%TEST_VALUE##VHELPER(dict, value, KEY3, VAL3)
//%TEST_VALUE##VHELPER(dict, value, KEY4, VAL2)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL4)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY2, VAL2)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY3, VAL3)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY4, VAL2)
//%
//% const KEY_TYPE KisP##kKeys2[] = { KEY2, KEY3 };
//% const VALUE_TYPE kValues2[] = { VAL3, VAL1 };
//% const VALUE_TYPE k##VNAME$u##s2[] = { VAL3, VAL1 };
//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict2 =
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues2
//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys2
//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues2)];
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s2
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys2
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s2)];
//% XCTAssertNotNil(dict2);
//% [dict add##VACCESSOR##EntriesFromDictionary:dict2];
//% XCTAssertEqual(dict.count, 4U);
//%TEST_VALUE##VHELPER(dict, value, KEY1, VAL4)
//%TEST_VALUE##VHELPER(dict, value, KEY2, VAL3)
//%TEST_VALUE##VHELPER(dict, value, KEY3, VAL1)
//%TEST_VALUE##VHELPER(dict, value, KEY4, VAL2)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL4)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY2, VAL3)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY3, VAL1)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY4, VAL2)
//%
//% [dict2 release];
//% [dict release];
@ -466,10 +466,10 @@
//% // Equal, so they must have same hash.
//% XCTAssertEqual([dict1 hash], [dict1prime hash]);
//%
//% // 2 is save keys, different values; not equal.
//% // 2 is same keys, different values; not equal.
//% XCTAssertNotEqualObjects(dict1, dict2);
//%
//% // 3 is different keys, samae values; not equal.
//% // 3 is different keys, same values; not equal.
//% XCTAssertNotEqualObjects(dict1, dict3);
//%
//% // 4 extra pair; not equal
@ -709,9 +709,9 @@
//%PDDM-DEFINE DECLARE_VALUE_STORAGEOBJECT(VALUE_TYPE, NAME)
// Empty
//%PDDM-DEFINE VALUE_NOT_FOUNDOBJECT(DICT, KEY)
//% XCTAssertNil([DICT valueForKey:KEY]);
//% XCTAssertNil([DICT objectForKey:KEY]);
//%PDDM-DEFINE TEST_VALUEOBJECT(DICT, STORAGE, KEY, VALUE)
//% XCTAssertEqualObjects([DICT valueForKey:KEY], VALUE);
//% XCTAssertEqualObjects([DICT objectForKey:KEY], VALUE);
//%PDDM-DEFINE COMPARE_KEYSObjects(KEY1, KEY2)
//%[KEY1 isEqual:KEY2]
@ -768,12 +768,12 @@
//TODO(thomasvl): enum tests
//%PDDM-DEFINE BOOL_TESTS_FOR_POD_VALUE(VALUE_NAME, VALUE_TYPE, VAL1, VAL2)
//%BOOL_TESTS_COMMON(Bool, BOOL, , , YES, NO, VALUE_NAME, VALUE_TYPE, , POD, VAL1, VAL2)
//%BOOL_TESTS_COMMON(Bool, BOOL, , , YES, NO, VALUE_NAME, VALUE_TYPE, , value, POD, VAL1, VAL2)
//%PDDM-DEFINE TESTS_FOR_BOOL_KEY_OBJECT_VALUE(VALUE_NAME, VALUE_TYPE, VAL1, VAL2)
//%BOOL_TESTS_COMMON(Bool, BOOL, , , YES, NO, VALUE_NAME, VALUE_TYPE, Objects, OBJECT, VAL1, VAL2)
//%BOOL_TESTS_COMMON(Bool, BOOL, , , YES, NO, VALUE_NAME, VALUE_TYPE, Objects, object, OBJECT, VAL1, VAL2)
//%PDDM-DEFINE BOOL_TESTS_COMMON(KEY_NAME, KEY_TYPE, KisP, KSUFFIX, KEY1, KEY2, VALUE_NAME, VALUE_TYPE, VSUFFIX, VHELPER, VAL1, VAL2)
//%PDDM-DEFINE BOOL_TESTS_COMMON(KEY_NAME, KEY_TYPE, KisP, KSUFFIX, KEY1, KEY2, VALUE_NAME, VALUE_TYPE, VSUFFIX, VNAME, VHELPER, VAL1, VAL2)
//%#pragma mark - KEY_NAME -> VALUE_NAME
//%
//%@interface GPB##KEY_NAME##VALUE_NAME##DictionaryTests : XCTestCase
@ -786,45 +786,45 @@
//% XCTAssertNotNil(dict);
//% XCTAssertEqual(dict.count, 0U);
//%VALUE_NOT_FOUND##VHELPER(dict, KEY1)
//% [dict enumerateKeysAndValuesUsingBlock:^(KEY_TYPE KisP##aKey, VALUE_TYPE aValue, BOOL *stop) {
//% #pragma unused(aKey, aValue, stop)
//% [dict enumerateKeysAnd##VNAME$u##sUsingBlock:^(KEY_TYPE KisP##aKey, VALUE_TYPE a##VNAME$u##, BOOL *stop) {
//% #pragma unused(aKey, a##VNAME$u##, stop)
//% XCTFail(@"Shouldn't get here!");
//% }];
//% [dict release];
//%}
//%
//%- (void)testOne {
//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict = [GPB##KEY_NAME##VALUE_NAME##Dictionary dictionaryWithValue:VAL1 forKey:KEY1];
//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict = [GPB##KEY_NAME##VALUE_NAME##Dictionary dictionaryWith##VNAME$u##:VAL1 forKey:KEY1];
//% XCTAssertNotNil(dict);
//% XCTAssertEqual(dict.count, 1U);
//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, value)TEST_VALUE##VHELPER(dict, value, KEY1, VAL1)
//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, VNAME)TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL1)
//%VALUE_NOT_FOUND##VHELPER(dict, KEY2)
//% [dict enumerateKeysAndValuesUsingBlock:^(KEY_TYPE KisP##aKey, VALUE_TYPE aValue, BOOL *stop) {
//% [dict enumerateKeysAnd##VNAME$u##sUsingBlock:^(KEY_TYPE KisP##aKey, VALUE_TYPE a##VNAME$u, BOOL *stop) {
//% XCTAssertEqual##KSUFFIX(aKey, KEY1);
//% XCTAssertEqual##VSUFFIX(aValue, VAL1);
//% XCTAssertEqual##VSUFFIX(a##VNAME$u, VAL1);
//% XCTAssertNotEqual(stop, NULL);
//% }];
//%}
//%
//%- (void)testBasics {
//% const KEY_TYPE KisP##kKeys[] = { KEY1, KEY2 };
//% const VALUE_TYPE kValues[] = { VAL1, VAL2 };
//% const VALUE_TYPE k##VNAME$u##s[] = { VAL1, VAL2 };
//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict =
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues
//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys
//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues)];
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s)];
//% XCTAssertNotNil(dict);
//% XCTAssertEqual(dict.count, 2U);
//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, value)TEST_VALUE##VHELPER(dict, value, KEY1, VAL1)
//%TEST_VALUE##VHELPER(dict, value, KEY2, VAL2)
//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, VNAME)TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL1)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY2, VAL2)
//%
//% __block NSUInteger idx = 0;
//% KEY_TYPE KisP##*seenKeys = malloc(2 * sizeof(KEY_TYPE##KisP));
//% VALUE_TYPE *seenValues = malloc(2 * sizeof(VALUE_TYPE));
//% [dict enumerateKeysAndValuesUsingBlock:^(KEY_TYPE KisP##aKey, VALUE_TYPE aValue, BOOL *stop) {
//% VALUE_TYPE *seen##VNAME$u##s = malloc(2 * sizeof(VALUE_TYPE));
//% [dict enumerateKeysAnd##VNAME$u##sUsingBlock:^(KEY_TYPE KisP##aKey, VALUE_TYPE a##VNAME$u##, BOOL *stop) {
//% XCTAssertLessThan(idx, 2U);
//% seenKeys[idx] = aKey;
//% seenValues[idx] = aValue;
//% seen##VNAME$u##s[idx] = a##VNAME$u;
//% XCTAssertNotEqual(stop, NULL);
//% ++idx;
//% }];
@ -833,18 +833,18 @@
//% for (int j = 0; (j < 2) && !foundKey; ++j) {
//% if (COMPARE_KEYS##KSUFFIX(kKeys[i], seenKeys[j])) {
//% foundKey = YES;
//% XCTAssertEqual##VSUFFIX(kValues[i], seenValues[j], @"i = %d, j = %d", i, j);
//% XCTAssertEqual##VSUFFIX(k##VNAME$u##s[i], seen##VNAME$u##s[j], @"i = %d, j = %d", i, j);
//% }
//% }
//% XCTAssertTrue(foundKey, @"i = %d", i);
//% }
//% free(seenKeys);
//% free(seenValues);
//% free(seen##VNAME$u##s);
//%
//% // Stopping the enumeration.
//% idx = 0;
//% [dict enumerateKeysAndValuesUsingBlock:^(KEY_TYPE KisP##aKey, VALUE_TYPE aValue, BOOL *stop) {
//% #pragma unused(aKey, aValue)
//% [dict enumerateKeysAnd##VNAME$u##sUsingBlock:^(KEY_TYPE KisP##aKey, VALUE_TYPE a##VNAME$u##, BOOL *stop) {
//% #pragma unused(aKey, a##VNAME$u)
//% if (idx == 0) *stop = YES;
//% XCTAssertNotEqual(idx, 2U);
//% ++idx;
@ -855,33 +855,33 @@
//%- (void)testEquality {
//% const KEY_TYPE KisP##kKeys1[] = { KEY1, KEY2 };
//% const KEY_TYPE KisP##kKeys2[] = { KEY2, KEY1 };
//% const VALUE_TYPE kValues1[] = { VAL1, VAL2 };
//% const VALUE_TYPE kValues2[] = { VAL2, VAL1 };
//% const VALUE_TYPE kValues3[] = { VAL2 };
//% const VALUE_TYPE k##VNAME$u##s1[] = { VAL1, VAL2 };
//% const VALUE_TYPE k##VNAME$u##s2[] = { VAL2, VAL1 };
//% const VALUE_TYPE k##VNAME$u##s3[] = { VAL2 };
//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict1 =
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues1
//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys1
//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues1)];
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s1
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys1
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s1)];
//% XCTAssertNotNil(dict1);
//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict1prime =
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues1
//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys1
//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues1)];
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s1
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys1
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s1)];
//% XCTAssertNotNil(dict1prime);
//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict2 =
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues2
//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys1
//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues2)];
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s2
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys1
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s2)];
//% XCTAssertNotNil(dict2);
//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict3 =
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues1
//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys2
//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues1)];
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s1
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys2
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s1)];
//% XCTAssertNotNil(dict3);
//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict4 =
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues3
//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys1
//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues3)];
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s3
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys1
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s3)];
//% XCTAssertNotNil(dict4);
//%
//% // 1/1Prime should be different objects, but equal.
@ -890,10 +890,10 @@
//% // Equal, so they must have same hash.
//% XCTAssertEqual([dict1 hash], [dict1prime hash]);
//%
//% // 2 is save keys, different values; not equal.
//% // 2 is same keys, different ##VNAME##s; not equal.
//% XCTAssertNotEqualObjects(dict1, dict2);
//%
//% // 3 is different keys, samae values; not equal.
//% // 3 is different keys, same ##VNAME##s; not equal.
//% XCTAssertNotEqualObjects(dict1, dict3);
//%
//% // 4 Fewer pairs; not equal
@ -908,11 +908,11 @@
//%
//%- (void)testCopy {
//% const KEY_TYPE KisP##kKeys[] = { KEY1, KEY2 };
//% const VALUE_TYPE kValues[] = { VAL1, VAL2 };
//% const VALUE_TYPE k##VNAME$u##s[] = { VAL1, VAL2 };
//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict =
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues
//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys
//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues)];
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s)];
//% XCTAssertNotNil(dict);
//%
//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict2 = [dict copy];
@ -929,11 +929,11 @@
//%
//%- (void)testDictionaryFromDictionary {
//% const KEY_TYPE KisP##kKeys[] = { KEY1, KEY2 };
//% const VALUE_TYPE kValues[] = { VAL1, VAL2 };
//% const VALUE_TYPE k##VNAME$u##s[] = { VAL1, VAL2 };
//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict =
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues
//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys
//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues)];
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s)];
//% XCTAssertNotNil(dict);
//%
//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict2 =
@ -951,43 +951,43 @@
//% XCTAssertNotNil(dict);
//%
//% XCTAssertEqual(dict.count, 0U);
//% [dict setValue:VAL1 forKey:KEY1];
//% [dict set##VNAME$u:VAL1 forKey:KEY1];
//% XCTAssertEqual(dict.count, 1U);
//%
//% const KEY_TYPE KisP##kKeys[] = { KEY2 };
//% const VALUE_TYPE kValues[] = { VAL2 };
//% const VALUE_TYPE k##VNAME$u##s[] = { VAL2 };
//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict2 =
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues
//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys
//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues)];
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s)];
//% XCTAssertNotNil(dict2);
//% [dict addEntriesFromDictionary:dict2];
//% XCTAssertEqual(dict.count, 2U);
//%
//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, value)TEST_VALUE##VHELPER(dict, value, KEY1, VAL1)
//%TEST_VALUE##VHELPER(dict, value, KEY2, VAL2)
//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, VNAME)TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL1)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY2, VAL2)
//% [dict2 release];
//%}
//%
//%- (void)testRemove {
//% const KEY_TYPE KisP##kKeys[] = { KEY1, KEY2};
//% const VALUE_TYPE kValues[] = { VAL1, VAL2 };
//% const VALUE_TYPE k##VNAME$u##s[] = { VAL1, VAL2 };
//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict =
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues
//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys
//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues)];
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s)];
//% XCTAssertNotNil(dict);
//% XCTAssertEqual(dict.count, 2U);
//%
//% [dict removeValueForKey:KEY2];
//% [dict remove##VNAME$u##ForKey:KEY2];
//% XCTAssertEqual(dict.count, 1U);
//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, value)TEST_VALUE##VHELPER(dict, value, KEY1, VAL1)
//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, VNAME)TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL1)
//%VALUE_NOT_FOUND##VHELPER(dict, KEY2)
//%
//% // Remove again does nothing.
//% [dict removeValueForKey:KEY2];
//% [dict remove##VNAME$u##ForKey:KEY2];
//% XCTAssertEqual(dict.count, 1U);
//%TEST_VALUE##VHELPER(dict, value, KEY1, VAL1)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL1)
//%VALUE_NOT_FOUND##VHELPER(dict, KEY2)
//%
//% [dict removeAll];
@ -999,37 +999,37 @@
//%
//%- (void)testInplaceMutation {
//% const KEY_TYPE KisP##kKeys[] = { KEY1, KEY2 };
//% const VALUE_TYPE kValues[] = { VAL1, VAL2 };
//% const VALUE_TYPE k##VNAME$u##s[] = { VAL1, VAL2 };
//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict =
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues
//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys
//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues)];
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s)];
//% XCTAssertNotNil(dict);
//% XCTAssertEqual(dict.count, 2U);
//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, value)TEST_VALUE##VHELPER(dict, value, KEY1, VAL1)
//%TEST_VALUE##VHELPER(dict, value, KEY2, VAL2)
//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, VNAME)TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL1)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY2, VAL2)
//%
//% [dict setValue:VAL2 forKey:KEY1];
//% [dict set##VNAME$u##:VAL2 forKey:KEY1];
//% XCTAssertEqual(dict.count, 2U);
//%TEST_VALUE##VHELPER(dict, value, KEY1, VAL2)
//%TEST_VALUE##VHELPER(dict, value, KEY2, VAL2)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL2)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY2, VAL2)
//%
//% [dict setValue:VAL1 forKey:KEY2];
//% [dict set##VNAME$u##:VAL1 forKey:KEY2];
//% XCTAssertEqual(dict.count, 2U);
//%TEST_VALUE##VHELPER(dict, value, KEY1, VAL2)
//%TEST_VALUE##VHELPER(dict, value, KEY2, VAL1)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL2)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY2, VAL1)
//%
//% const KEY_TYPE KisP##kKeys2[] = { KEY2, KEY1 };
//% const VALUE_TYPE kValues2[] = { VAL2, VAL1 };
//% const VALUE_TYPE k##VNAME$u##s2[] = { VAL2, VAL1 };
//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict2 =
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues2
//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys2
//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues2)];
//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s2
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys2
//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s2)];
//% XCTAssertNotNil(dict2);
//% [dict addEntriesFromDictionary:dict2];
//% XCTAssertEqual(dict.count, 2U);
//%TEST_VALUE##VHELPER(dict, value, KEY1, VAL1)
//%TEST_VALUE##VHELPER(dict, value, KEY2, VAL2)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL1)
//%TEST_VALUE##VHELPER(dict, VNAME, KEY2, VAL2)
//%
//% [dict2 release];
//% [dict release];

View File

@ -676,20 +676,21 @@
TestAllTypes *subMsg = [TestAllTypes message];
subMsg.repeatedInt32Array = [GPBInt32Array arrayWithValue:100];
msg1.mapInt32Message = [GPBInt32ObjectDictionary dictionary];
[msg1.mapInt32Message setValue:subMsg forKey:0];
[msg1.mapInt32Message setObject:subMsg forKey:0];
subMsg = nil;
subMsg = [TestAllTypes message];
subMsg.repeatedInt32Array = [GPBInt32Array arrayWithValue:101];
msg2.mapInt32Message = [GPBInt32ObjectDictionary dictionary];
[msg2.mapInt32Message setValue:subMsg forKey:0];
[msg2.mapInt32Message setObject:subMsg forKey:0];
subMsg = nil;
[msg1 mergeFrom:msg2];
// Checks repeated field is overwritten.
XCTAssertEqual(msg1.mapInt32Message.count, 1U);
subMsg = [msg1.mapInt32Message valueForKey:0];
subMsg = [msg1.mapInt32Message objectForKey:0];
XCTAssertNotNil(subMsg);
XCTAssertEqual(subMsg.repeatedInt32Array.count, 1U);
XCTAssertEqual([subMsg.repeatedInt32Array valueAtIndex:0], 101);

View File

@ -2059,9 +2059,9 @@
// Ensure the messages are unique per map.
[msg1.mapInt32ForeignMessage
enumerateKeysAndValuesUsingBlock:^(int32_t key, id value, BOOL *stop) {
enumerateKeysAndObjectsUsingBlock:^(int32_t key, id value, BOOL *stop) {
#pragma unused(stop)
ForeignMessage *subMsg2 = [msg2.mapInt32ForeignMessage valueForKey:key];
ForeignMessage *subMsg2 = [msg2.mapInt32ForeignMessage objectForKey:key];
XCTAssertNotEqual(value, subMsg2); // Ptr compare, new object.
}];
}
@ -2075,7 +2075,7 @@
// Add an uninitialized message.
TestRequired *subMsg = [[TestRequired alloc] init];
msg.mapField = [GPBInt32ObjectDictionary dictionary];
[msg.mapField setValue:subMsg forKey:0];
[msg.mapField setObject:subMsg forKey:0];
XCTAssertFalse(msg.initialized);
// Initialize uninitialized message

View File

@ -994,16 +994,16 @@ static NSData *DataFromCStr(const char *str) {
val2.optionalInt32 = 129;
[msg.mapStringMessage setValue:val1 forKey:@"228"];
[msg.mapStringMessage setValue:val2 forKey:@"2029"];
[msg.mapInt32Bytes setValue:DataFromCStr("1030 bytes") forKey:230];
[msg.mapInt32Bytes setValue:DataFromCStr("131") forKey:2031];
[msg.mapInt32Bytes setObject:DataFromCStr("1030 bytes") forKey:230];
[msg.mapInt32Bytes setObject:DataFromCStr("131") forKey:2031];
[msg.mapInt32Enum setValue:Message2_Enum_Bar forKey:232];
[msg.mapInt32Enum setValue:Message2_Enum_Baz forKey:2033];
Message2 *val3 = [[Message2 alloc] init];
val3.optionalInt32 = 1034;
Message2 *val4 = [[Message2 alloc] init];
val4.optionalInt32 = 135;
[msg.mapInt32Message setValue:val3 forKey:234];
[msg.mapInt32Message setValue:val4 forKey:2035];
[msg.mapInt32Message setObject:val3 forKey:234];
[msg.mapInt32Message setObject:val4 forKey:2035];
NSData *data = [msg data];
Message2 *msg2 = [[Message2 alloc] initWithData:data error:NULL];

View File

@ -0,0 +1,69 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2013 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#import "GPBTestUtilities.h"
//
// This is just a compile test (here to make sure things never regress).
//
// Objective C++ can run into issues with how the NS_ENUM/CF_ENUM declartion
// works because of the C++ spec being used for that compilation unit. So
// the fact that these imports all work without errors/warning means things
// are still good.
//
// The "well know types" should have cross file enums needing imports.
#import "GPBProtocolBuffers.h"
// Some of the tests explicitly use cross file enums also.
#import "google/protobuf/Unittest.pbobjc.h"
#import "google/protobuf/UnittestImport.pbobjc.h"
// Sanity check the conditions of the test within the Xcode project.
#if !__cplusplus
#error This isn't compiled as Objective C++?
#elif __cplusplus >= 201103L
// If this trips, it means the Xcode default might have change (or someone
// edited the testing project) and it might be time to revisit the GPB_ENUM
// define in GPBBootstrap.h.
#warning Did the Xcode default for C++ spec change?
#endif
// Dummy XCTest.
@interface GPBObjectiveCPlusPlusTests : GPBTestCase
@end
@implementation GPBObjectiveCPlusPlusTests
- (void)testCPlusPlus {
// Nothing, This was a compile test.
XCTAssertTrue(YES);
}
@end

View File

@ -1110,7 +1110,7 @@ const uint32_t kGPBDefaultRepeatCount = 2;
[dataStr release];
NSData *data = [[NSData alloc] initWithUint32_gpbtu:i + 1];
[message.mapInt32Bytes setValue:data forKey:113 + i * 100];
[message.mapInt32Bytes setObject:data forKey:113 + i * 100];
[data release];
[message.mapInt32Enum
@ -1119,7 +1119,7 @@ const uint32_t kGPBDefaultRepeatCount = 2;
ForeignMessage *subMsg = [[ForeignMessage alloc] init];
subMsg.c = i + 1;
[message.mapInt32ForeignMessage setValue:subMsg forKey:115 + i * 100];
[message.mapInt32ForeignMessage setObject:subMsg forKey:115 + i * 100];
[subMsg release];
}
}

View File

@ -167,12 +167,12 @@ const int kUnknownTypeId = 1550055;
XCTAssertEqual([raw.itemArray[2] typeId], kUnknownTypeId);
TestMessageSetExtension1* message1 =
[TestMessageSetExtension1 parseFromData:[raw.itemArray[0] message]
[TestMessageSetExtension1 parseFromData:[((RawMessageSet_Item*)raw.itemArray[0]) message]
error:NULL];
XCTAssertEqual(message1.i, 123);
TestMessageSetExtension2* message2 =
[TestMessageSetExtension2 parseFromData:[raw.itemArray[1] message]
[TestMessageSetExtension2 parseFromData:[((RawMessageSet_Item*)raw.itemArray[1]) message]
error:NULL];
XCTAssertEqualObjects(message2.str, @"foo");

View File

@ -344,6 +344,7 @@ typedef GPB_ENUM(GPBFieldDescriptorProto_FieldNumber) {
GPBFieldDescriptorProto_FieldNumber_DefaultValue = 7,
GPBFieldDescriptorProto_FieldNumber_Options = 8,
GPBFieldDescriptorProto_FieldNumber_OneofIndex = 9,
GPBFieldDescriptorProto_FieldNumber_JsonName = 10,
};
// Describes a field within a message.
@ -389,6 +390,13 @@ typedef GPB_ENUM(GPBFieldDescriptorProto_FieldNumber) {
@property(nonatomic, readwrite) BOOL hasOneofIndex;
@property(nonatomic, readwrite) int32_t oneofIndex;
// JSON name of this field. The value is set by protocol compiler. If the
// user has set a "json_name" option on this field, that option's value
// will be used. Otherwise, it's deduced from the field's name by converting
// it to camelCase.
@property(nonatomic, readwrite) BOOL hasJsonName;
@property(nonatomic, readwrite, copy, null_resettable) NSString *jsonName;
@property(nonatomic, readwrite) BOOL hasOptions;
@property(nonatomic, readwrite, strong, null_resettable) GPBFieldOptions *options;

View File

@ -578,6 +578,7 @@ typedef struct GPBDescriptorProto_ReservedRange__storage_ {
@dynamic hasExtendee, extendee;
@dynamic hasDefaultValue, defaultValue;
@dynamic hasOneofIndex, oneofIndex;
@dynamic hasJsonName, jsonName;
@dynamic hasOptions, options;
typedef struct GPBFieldDescriptorProto__storage_ {
@ -591,6 +592,7 @@ typedef struct GPBFieldDescriptorProto__storage_ {
NSString *typeName;
NSString *defaultValue;
GPBFieldOptions *options;
NSString *jsonName;
} GPBFieldDescriptorProto__storage_;
// This method is threadsafe because it is initially called
@ -679,7 +681,7 @@ typedef struct GPBFieldDescriptorProto__storage_ {
{
.name = "options",
.number = GPBFieldDescriptorProto_FieldNumber_Options,
.hasIndex = 8,
.hasIndex = 9,
.flags = GPBFieldOptional,
.dataType = GPBDataTypeMessage,
.offset = offsetof(GPBFieldDescriptorProto__storage_, options),
@ -698,6 +700,17 @@ typedef struct GPBFieldDescriptorProto__storage_ {
.dataTypeSpecific.className = NULL,
.fieldOptions = NULL,
},
{
.name = "jsonName",
.number = GPBFieldDescriptorProto_FieldNumber_JsonName,
.hasIndex = 8,
.flags = GPBFieldOptional,
.dataType = GPBDataTypeString,
.offset = offsetof(GPBFieldDescriptorProto__storage_, jsonName),
.defaultValue.valueString = nil,
.dataTypeSpecific.className = NULL,
.fieldOptions = NULL,
},
};
static GPBMessageEnumDescription enums[] = {
{ .enumDescriptorFunc = GPBFieldDescriptorProto_Type_EnumDescriptor },

View File

@ -2893,6 +2893,14 @@ bool InitProto2MessageModule(PyObject *m) {
}
Py_INCREF(mutable_mapping);
#if PY_MAJOR_VERSION >= 3
PyObject* bases = PyTuple_New(1);
PyTuple_SET_ITEM(bases, 0, mutable_mapping.get());
ScalarMapContainer_Type =
PyType_FromSpecWithBases(&ScalarMapContainer_Type_spec, bases);
PyModule_AddObject(m, "ScalarMapContainer", ScalarMapContainer_Type);
#else
ScalarMapContainer_Type.tp_base =
reinterpret_cast<PyTypeObject*>(mutable_mapping.get());
@ -2902,6 +2910,7 @@ bool InitProto2MessageModule(PyObject *m) {
PyModule_AddObject(m, "ScalarMapContainer",
reinterpret_cast<PyObject*>(&ScalarMapContainer_Type));
#endif
if (PyType_Ready(&ScalarMapIterator_Type) < 0) {
return false;
@ -2910,6 +2919,12 @@ bool InitProto2MessageModule(PyObject *m) {
PyModule_AddObject(m, "ScalarMapIterator",
reinterpret_cast<PyObject*>(&ScalarMapIterator_Type));
#if PY_MAJOR_VERSION >= 3
MessageMapContainer_Type =
PyType_FromSpecWithBases(&MessageMapContainer_Type_spec, bases);
PyModule_AddObject(m, "MessageMapContainer", MessageMapContainer_Type);
#else
Py_INCREF(mutable_mapping);
MessageMapContainer_Type.tp_base =
reinterpret_cast<PyTypeObject*>(mutable_mapping.get());
@ -2920,6 +2935,7 @@ bool InitProto2MessageModule(PyObject *m) {
PyModule_AddObject(m, "MessageMapContainer",
reinterpret_cast<PyObject*>(&MessageMapContainer_Type));
#endif
if (PyType_Ready(&MessageMapIterator_Type) < 0) {
return false;

View File

@ -84,7 +84,12 @@ PyObject* NewContainer(CMessage* parent,
return NULL;
}
#if PY_MAJOR_VERSION >= 3
PyObject* obj = PyType_GenericAlloc(
reinterpret_cast<PyTypeObject *>(MessageMapContainer_Type), 0);
#else
PyObject* obj = PyType_GenericAlloc(&MessageMapContainer_Type, 0);
#endif
if (obj == NULL) {
return PyErr_Format(PyExc_RuntimeError,
"Could not allocate new container.");
@ -458,44 +463,67 @@ PyObject* IterNext(PyObject* _self) {
} // namespace message_map_iterator
PyTypeObject MessageMapContainer_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
FULL_MODULE_NAME ".MessageMapContainer", // tp_name
sizeof(MessageMapContainer), // tp_basicsize
0, // tp_itemsize
message_map_container::Dealloc, // tp_dealloc
0, // tp_print
0, // tp_getattr
0, // tp_setattr
0, // tp_compare
0, // tp_repr
0, // tp_as_number
0, // tp_as_sequence
&message_map_container::MpMethods, // tp_as_mapping
0, // tp_hash
0, // tp_call
0, // tp_str
0, // tp_getattro
0, // tp_setattro
0, // tp_as_buffer
Py_TPFLAGS_DEFAULT, // tp_flags
"A map container for message", // tp_doc
0, // tp_traverse
0, // tp_clear
0, // tp_richcompare
0, // tp_weaklistoffset
message_map_container::GetIterator, // tp_iter
0, // tp_iternext
message_map_container::Methods, // tp_methods
0, // tp_members
0, // tp_getset
0, // tp_base
0, // tp_dict
0, // tp_descr_get
0, // tp_descr_set
0, // tp_dictoffset
0, // tp_init
};
#if PY_MAJOR_VERSION >= 3
static PyType_Slot MessageMapContainer_Type_slots[] = {
{Py_tp_dealloc, (void *)message_map_container::Dealloc},
{Py_mp_length, (void *)message_map_container::Length},
{Py_mp_subscript, (void *)message_map_container::GetItem},
{Py_mp_ass_subscript, (void *)message_map_container::SetItem},
{Py_tp_methods, (void *)message_map_container::Methods},
{Py_tp_iter, (void *)message_map_container::GetIterator},
{0, 0}
};
PyType_Spec MessageMapContainer_Type_spec = {
FULL_MODULE_NAME ".MessageMapContainer",
sizeof(MessageMapContainer),
0,
Py_TPFLAGS_DEFAULT,
MessageMapContainer_Type_slots
};
PyObject *MessageMapContainer_Type;
#else
PyTypeObject MessageMapContainer_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
FULL_MODULE_NAME ".MessageMapContainer", // tp_name
sizeof(MessageMapContainer), // tp_basicsize
0, // tp_itemsize
message_map_container::Dealloc, // tp_dealloc
0, // tp_print
0, // tp_getattr
0, // tp_setattr
0, // tp_compare
0, // tp_repr
0, // tp_as_number
0, // tp_as_sequence
&message_map_container::MpMethods, // tp_as_mapping
0, // tp_hash
0, // tp_call
0, // tp_str
0, // tp_getattro
0, // tp_setattro
0, // tp_as_buffer
Py_TPFLAGS_DEFAULT, // tp_flags
"A map container for message", // tp_doc
0, // tp_traverse
0, // tp_clear
0, // tp_richcompare
0, // tp_weaklistoffset
message_map_container::GetIterator, // tp_iter
0, // tp_iternext
message_map_container::Methods, // tp_methods
0, // tp_members
0, // tp_getset
0, // tp_base
0, // tp_dict
0, // tp_descr_get
0, // tp_descr_set
0, // tp_dictoffset
0, // tp_init
};
#endif
PyTypeObject MessageMapIterator_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)

View File

@ -89,7 +89,12 @@ struct MessageMapContainer {
uint64 version;
};
extern PyTypeObject MessageMapContainer_Type;
#if PY_MAJOR_VERSION >= 3
extern PyObject *MessageMapContainer_Type;
extern PyType_Spec MessageMapContainer_Type_spec;
#else
extern PyTypeObject MessageMapContainer_Type;
#endif
extern PyTypeObject MessageMapIterator_Type;
namespace message_map_container {

View File

@ -83,7 +83,12 @@ PyObject *NewContainer(
return NULL;
}
#if PY_MAJOR_VERSION >= 3
ScopedPyObjectPtr obj(PyType_GenericAlloc(
reinterpret_cast<PyTypeObject *>(ScalarMapContainer_Type), 0));
#else
ScopedPyObjectPtr obj(PyType_GenericAlloc(&ScalarMapContainer_Type, 0));
#endif
if (obj.get() == NULL) {
return PyErr_Format(PyExc_RuntimeError,
"Could not allocate new container.");
@ -432,44 +437,66 @@ PyObject* IterNext(PyObject* _self) {
} // namespace scalar_map_iterator
PyTypeObject ScalarMapContainer_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
FULL_MODULE_NAME ".ScalarMapContainer", // tp_name
sizeof(ScalarMapContainer), // tp_basicsize
0, // tp_itemsize
scalar_map_container::Dealloc, // tp_dealloc
0, // tp_print
0, // tp_getattr
0, // tp_setattr
0, // tp_compare
0, // tp_repr
0, // tp_as_number
0, // tp_as_sequence
&scalar_map_container::MpMethods, // tp_as_mapping
0, // tp_hash
0, // tp_call
0, // tp_str
0, // tp_getattro
0, // tp_setattro
0, // tp_as_buffer
Py_TPFLAGS_DEFAULT, // tp_flags
"A scalar map container", // tp_doc
0, // tp_traverse
0, // tp_clear
0, // tp_richcompare
0, // tp_weaklistoffset
scalar_map_container::GetIterator, // tp_iter
0, // tp_iternext
scalar_map_container::Methods, // tp_methods
0, // tp_members
0, // tp_getset
0, // tp_base
0, // tp_dict
0, // tp_descr_get
0, // tp_descr_set
0, // tp_dictoffset
0, // tp_init
};
#if PY_MAJOR_VERSION >= 3
static PyType_Slot ScalarMapContainer_Type_slots[] = {
{Py_tp_dealloc, (void *)scalar_map_container::Dealloc},
{Py_mp_length, (void *)scalar_map_container::Length},
{Py_mp_subscript, (void *)scalar_map_container::GetItem},
{Py_mp_ass_subscript, (void *)scalar_map_container::SetItem},
{Py_tp_methods, (void *)scalar_map_container::Methods},
{Py_tp_iter, (void *)scalar_map_container::GetIterator},
{0, 0},
};
PyType_Spec ScalarMapContainer_Type_spec = {
FULL_MODULE_NAME ".ScalarMapContainer",
sizeof(ScalarMapContainer),
0,
Py_TPFLAGS_DEFAULT,
ScalarMapContainer_Type_slots
};
PyObject *ScalarMapContainer_Type;
#else
PyTypeObject ScalarMapContainer_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
FULL_MODULE_NAME ".ScalarMapContainer", // tp_name
sizeof(ScalarMapContainer), // tp_basicsize
0, // tp_itemsize
scalar_map_container::Dealloc, // tp_dealloc
0, // tp_print
0, // tp_getattr
0, // tp_setattr
0, // tp_compare
0, // tp_repr
0, // tp_as_number
0, // tp_as_sequence
&scalar_map_container::MpMethods, // tp_as_mapping
0, // tp_hash
0, // tp_call
0, // tp_str
0, // tp_getattro
0, // tp_setattro
0, // tp_as_buffer
Py_TPFLAGS_DEFAULT, // tp_flags
"A scalar map container", // tp_doc
0, // tp_traverse
0, // tp_clear
0, // tp_richcompare
0, // tp_weaklistoffset
scalar_map_container::GetIterator, // tp_iter
0, // tp_iternext
scalar_map_container::Methods, // tp_methods
0, // tp_members
0, // tp_getset
0, // tp_base
0, // tp_dict
0, // tp_descr_get
0, // tp_descr_set
0, // tp_dictoffset
0, // tp_init
};
#endif
PyTypeObject ScalarMapIterator_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)

View File

@ -83,7 +83,12 @@ struct ScalarMapContainer {
uint64 version;
};
extern PyTypeObject ScalarMapContainer_Type;
#if PY_MAJOR_VERSION >= 3
extern PyObject *ScalarMapContainer_Type;
extern PyType_Spec ScalarMapContainer_Type_spec;
#else
extern PyTypeObject ScalarMapContainer_Type;
#endif
extern PyTypeObject ScalarMapIterator_Type;
namespace scalar_map_container {

View File

@ -2,8 +2,7 @@
envlist =
# cpp implementation on py34 is currently broken due to
# changes introduced by http://bugs.python.org/issue22079.
#py{26,27,33,34}-{cpp,python}
py{26,27,33}-{cpp,python}, py34-{python}
py{26,27,33,34}-{cpp,python}
[testenv]
usedevelop=true

View File

@ -1,7 +1,7 @@
PATH
remote: .
specs:
google-protobuf (3.0.0.alpha.4)
google-protobuf (3.0.0.alpha.4.0)
GEM
remote: https://rubygems.org/
@ -23,3 +23,6 @@ DEPENDENCIES
rake-compiler
rubygems-tasks
test-unit
BUNDLED WITH
1.10.6

View File

@ -35,11 +35,13 @@
// For more information, see:
// https://bugs.ruby-lang.org/issues/11328
VALUE noleak_rb_str_cat(VALUE rb_str, const char *str, long len) {
char *p;
size_t oldlen = RSTRING_LEN(rb_str);
rb_str_modify_expand(rb_str, len);
char *p = RSTRING_PTR(rb_str);
p = RSTRING_PTR(rb_str);
memcpy(p + oldlen, str, len);
rb_str_set_len(rb_str, oldlen + len);
return rb_str;
}
// -----------------------------------------------------------------------------

View File

@ -434,6 +434,8 @@ libprotoc_la_SOURCES = \
google/protobuf/compiler/objectivec/objectivec_primitive_field.h \
google/protobuf/compiler/python/python_generator.cc \
google/protobuf/compiler/ruby/ruby_generator.cc \
google/protobuf/compiler/csharp/csharp_doc_comment.cc \
google/protobuf/compiler/csharp/csharp_doc_comment.h \
google/protobuf/compiler/csharp/csharp_enum.cc \
google/protobuf/compiler/csharp/csharp_enum.h \
google/protobuf/compiler/csharp/csharp_enum_field.cc \

View File

@ -61,6 +61,9 @@ void Arena::Init() {
cleanup_list_ = 0;
if (options_.initial_block != NULL && options_.initial_block_size > 0) {
GOOGLE_CHECK_GE(options_.initial_block_size, sizeof(Block))
<< ": Initial block size too small for header.";
// Add first unowned block to list.
Block* first_block = reinterpret_cast<Block*>(options_.initial_block);
first_block->size = options_.initial_block_size;

View File

@ -598,8 +598,13 @@ void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) {
// bytes in length". Declare a static array of characters rather than use a
// string literal.
if (breakdown_large_file && file_data.size() > 65535) {
// This has to be explicitly marked as a signed char because the generated
// code puts negative values in the array, and sometimes plain char is
// unsigned. That implicit narrowing conversion is not allowed in C++11.
// <http://stackoverflow.com/questions/4434140/narrowing-conversions-in-c0x-is-it-just-me-or-does-this-sound-like-a-breakin>
// has details on why.
printer->Print(
"static const char descriptor[] = {\n");
"static const signed char descriptor[] = {\n");
printer->Indent();
// Only write 25 bytes per line.

View File

@ -0,0 +1,98 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Author: kenton@google.com (Kenton Varda)
// Based on original Protocol Buffers design by
// Sanjay Ghemawat, Jeff Dean, and others.
#include <google/protobuf/compiler/csharp/csharp_doc_comment.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/io/printer.h>
#include <google/protobuf/stubs/strutil.h>
namespace google {
namespace protobuf {
namespace compiler {
namespace csharp {
// Functions to create C# XML documentation comments.
// Currently this only includes documentation comments containing text specified as comments
// in the .proto file; documentation comments generated just from field/message/enum/proto names
// is inlined in the relevant code. If more control is required, that code can be moved here.
void WriteDocCommentBodyImpl(io::Printer* printer, SourceLocation location) {
string comments = location.leading_comments.empty() ?
location.trailing_comments : location.leading_comments;
if (comments.empty()) {
return;
}
// XML escaping... no need for apostrophes etc as the whole text is going to be a child
// node of a summary element, not part of an attribute.
comments = StringReplace(comments, "&", "&amp;", true);
comments = StringReplace(comments, "<", "&lt;", true);
vector<string> lines = Split(comments, "\n");
printer->Print("/// <summary>\n");
for (std::vector<string>::iterator it = lines.begin(); it != lines.end(); ++it) {
printer->Print("/// $line$\n", "line", *it);
}
printer->Print("/// </summary>\n");
}
template <typename DescriptorType>
static void WriteDocCommentBody(
io::Printer* printer, const DescriptorType* descriptor) {
SourceLocation location;
if (descriptor->GetSourceLocation(&location)) {
WriteDocCommentBodyImpl(printer, location);
}
}
void WriteMessageDocComment(io::Printer* printer, const Descriptor* message) {
WriteDocCommentBody(printer, message);
}
void WritePropertyDocComment(io::Printer* printer, const FieldDescriptor* field) {
WriteDocCommentBody(printer, field);
}
void WriteEnumDocComment(io::Printer* printer, const EnumDescriptor* enumDescriptor) {
WriteDocCommentBody(printer, enumDescriptor);
}
void WriteEnumValueDocComment(io::Printer* printer, const EnumValueDescriptor* value) {
WriteDocCommentBody(printer, value);
}
void WriteMethodDocComment(io::Printer* printer, const MethodDescriptor* method) {
WriteDocCommentBody(printer, method);
}
} // namespace csharp
} // namespace compiler
} // namespace protobuf
} // namespace google

View File

@ -0,0 +1,51 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_DOC_COMMENT_H__
#define GOOGLE_PROTOBUF_COMPILER_CSHARP_DOC_COMMENT_H__
#include <google/protobuf/io/printer.h>
#include <google/protobuf/descriptor.h>
namespace google {
namespace protobuf {
namespace compiler {
namespace csharp {
void WriteMessageDocComment(io::Printer* printer, const Descriptor* message);
void WritePropertyDocComment(io::Printer* printer, const FieldDescriptor* field);
void WriteEnumDocComment(io::Printer* printer, const EnumDescriptor* enumDescriptor);
void WriteEnumValueDocComment(io::Printer* printer, const EnumValueDescriptor* value);
void WriteMethodDocComment(io::Printer* printer, const MethodDescriptor* method);
} // namespace csharp
} // namespace compiler
} // namespace protobuf
} // namespace google
#endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_DOC_COMMENT_H__

View File

@ -38,6 +38,7 @@
#include <google/protobuf/io/zero_copy_stream.h>
#include <google/protobuf/stubs/strutil.h>
#include <google/protobuf/compiler/csharp/csharp_doc_comment.h>
#include <google/protobuf/compiler/csharp/csharp_enum.h>
#include <google/protobuf/compiler/csharp/csharp_helpers.h>
@ -57,13 +58,15 @@ EnumGenerator::~EnumGenerator() {
}
void EnumGenerator::Generate(io::Printer* printer) {
WriteEnumDocComment(printer, descriptor_);
WriteGeneratedCodeAttributes(printer);
printer->Print("$access_level$ enum $name$ {\n",
"access_level", class_access_level(),
"name", descriptor_->name());
printer->Indent();
for (int i = 0; i < descriptor_->value_count(); i++) {
printer->Print("$name$ = $number$,\n",
WriteEnumValueDocComment(printer, descriptor_->value(i));
printer->Print("$name$ = $number$,\n",
"name", descriptor_->value(i)->name(),
"number", SimpleItoa(descriptor_->value(i)->number()));
}

View File

@ -36,10 +36,12 @@
#include <google/protobuf/descriptor.pb.h>
#include <google/protobuf/io/printer.h>
#include <google/protobuf/io/zero_copy_stream.h>
#include <google/protobuf/stubs/strutil.h>
#include <google/protobuf/compiler/csharp/csharp_generator.h>
#include <google/protobuf/compiler/csharp/csharp_umbrella_class.h>
#include <google/protobuf/compiler/csharp/csharp_helpers.h>
#include <google/protobuf/compiler/csharp/csharp_names.h>
#include <google/protobuf/compiler/csharp/csharp_umbrella_class.h>
using google::protobuf::internal::scoped_ptr;
@ -48,9 +50,39 @@ namespace protobuf {
namespace compiler {
namespace csharp {
std::string GetOutputFile(const google::protobuf::FileDescriptor* file, const std::string file_extension)
{
return GetUmbrellaClassUnqualifiedName(file) + file_extension;
std::string GetOutputFile(
const google::protobuf::FileDescriptor* file,
const std::string file_extension,
const bool generate_directories,
const std::string base_namespace,
string* error) {
string relative_filename = GetUmbrellaClassUnqualifiedName(file) + file_extension;
if (!generate_directories) {
return relative_filename;
}
string ns = GetFileNamespace(file);
string namespace_suffix = ns;
if (!base_namespace.empty()) {
// Check that the base_namespace is either equal to or a leading part of
// the file namespace. This isn't just a simple prefix; "Foo.B" shouldn't
// be regarded as a prefix of "Foo.Bar". The simplest option is to add "."
// to both.
string extended_ns = ns + ".";
if (extended_ns.find(base_namespace + ".") != 0) {
*error = "Namespace " + ns + " is not a prefix namespace of base namespace " + base_namespace;
return ""; // This will be ignored, because we've set an error.
}
namespace_suffix = ns.substr(base_namespace.length());
if (namespace_suffix.find(".") == 0) {
namespace_suffix = namespace_suffix.substr(1);
}
}
string namespace_dir = StringReplace(namespace_suffix, ".", "/", true);
if (!namespace_dir.empty()) {
namespace_dir += "/";
}
return namespace_dir + relative_filename;
}
void GenerateFile(const google::protobuf::FileDescriptor* file,
@ -75,16 +107,26 @@ bool Generator::Generate(
}
std::string file_extension = ".cs";
std::string base_namespace = "";
bool generate_directories = false;
for (int i = 0; i < options.size(); i++) {
if (options[i].first == "file_extension") {
file_extension = options[i].second;
} else if (options[i].first == "base_namespace") {
base_namespace = options[i].second;
generate_directories = true;
} else {
*error = "Unknown generator option: " + options[i].first;
return false;
}
}
std::string filename = GetOutputFile(file, file_extension);
string filename_error = "";
std::string filename = GetOutputFile(file, file_extension, generate_directories, base_namespace, &filename_error);
if (!filename_error.empty()) {
*error = filename_error;
return false;
}
scoped_ptr<io::ZeroCopyOutputStream> output(
generator_context->Open(filename));
io::Printer printer(output.get(), '$');

View File

@ -101,8 +101,6 @@ std::string StringToBase64(const std::string& input);
std::string FileDescriptorToBase64(const FileDescriptor* descriptor);
uint FixedMakeTag(const FieldDescriptor* descriptor);
FieldGeneratorBase* CreateFieldGenerator(const FieldDescriptor* descriptor, int fieldOrdinal);
// Determines whether the given message is a map entry message, i.e. one implicitly created

View File

@ -38,6 +38,7 @@
#include <google/protobuf/io/zero_copy_stream.h>
#include <google/protobuf/stubs/strutil.h>
#include <google/protobuf/compiler/csharp/csharp_doc_comment.h>
#include <google/protobuf/compiler/csharp/csharp_helpers.h>
#include <google/protobuf/compiler/csharp/csharp_map_field.h>
@ -76,6 +77,7 @@ void MapFieldGenerator::GenerateMembers(io::Printer* printer) {
variables_,
", $tag$);\n"
"private readonly pbc::MapField<$key_type_name$, $value_type_name$> $name$_ = new pbc::MapField<$key_type_name$, $value_type_name$>($true_for_wrappers$);\n");
WritePropertyDocComment(printer, descriptor_);
AddDeprecatedFlag(printer);
printer->Print(
variables_,

View File

@ -42,6 +42,7 @@
#include <google/protobuf/wire_format.h>
#include <google/protobuf/wire_format_lite.h>
#include <google/protobuf/compiler/csharp/csharp_doc_comment.h>
#include <google/protobuf/compiler/csharp/csharp_enum.h>
#include <google/protobuf/compiler/csharp/csharp_field_base.h>
#include <google/protobuf/compiler/csharp/csharp_helpers.h>
@ -101,6 +102,7 @@ void MessageGenerator::Generate(io::Printer* printer) {
vars["class_name"] = class_name();
vars["access_level"] = class_access_level();
WriteMessageDocComment(printer, descriptor_);
printer->Print(
"[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n");
WriteGeneratedCodeAttributes(printer);
@ -152,7 +154,9 @@ void MessageGenerator::Generate(io::Printer* printer) {
// Rats: we lose the debug comment here :(
printer->Print(
"/// <summary>Field number for the \"$field_name$\" field.</summary>\n"
"public const int $field_constant_name$ = $index$;\n",
"field_name", fieldDescriptor->name(),
"field_constant_name", GetFieldConstantName(fieldDescriptor),
"index", SimpleItoa(fieldDescriptor->number()));
scoped_ptr<FieldGeneratorBase> generator(
@ -169,6 +173,7 @@ void MessageGenerator::Generate(io::Printer* printer) {
printer->Print(
vars,
"private object $name$_;\n"
"/// <summary>Enum of possible cases for the \"$original_name$\" oneof.</summary>\n"
"public enum $property_name$OneofCase {\n");
printer->Indent();
printer->Print("None = 0,\n");
@ -180,6 +185,7 @@ void MessageGenerator::Generate(io::Printer* printer) {
}
printer->Outdent();
printer->Print("}\n");
// TODO: Should we put the oneof .proto comments here? It's unclear exactly where they should go.
printer->Print(
vars,
"private $property_name$OneofCase $name$Case_ = $property_name$OneofCase.None;\n"
@ -199,8 +205,11 @@ void MessageGenerator::Generate(io::Printer* printer) {
// Nested messages and enums
if (HasNestedGeneratedTypes()) {
printer->Print("#region Nested types\n"
"[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n");
printer->Print(
vars,
"#region Nested types\n"
"/// <summary>Container for nested types declared in the $class_name$ message type.</summary>\n"
"[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n");
WriteGeneratedCodeAttributes(printer);
printer->Print("public static partial class Types {\n");
printer->Indent();

View File

@ -38,6 +38,7 @@
#include <google/protobuf/io/zero_copy_stream.h>
#include <google/protobuf/stubs/strutil.h>
#include <google/protobuf/compiler/csharp/csharp_doc_comment.h>
#include <google/protobuf/compiler/csharp/csharp_helpers.h>
#include <google/protobuf/compiler/csharp/csharp_message_field.h>
@ -61,6 +62,7 @@ void MessageFieldGenerator::GenerateMembers(io::Printer* printer) {
printer->Print(
variables_,
"private $type_name$ $name$_;\n");
WritePropertyDocComment(printer, descriptor_);
AddDeprecatedFlag(printer);
printer->Print(
variables_,
@ -152,6 +154,7 @@ MessageOneofFieldGenerator::~MessageOneofFieldGenerator() {
}
void MessageOneofFieldGenerator::GenerateMembers(io::Printer* printer) {
WritePropertyDocComment(printer, descriptor_);
AddDeprecatedFlag(printer);
printer->Print(
variables_,

View File

@ -38,6 +38,7 @@
#include <google/protobuf/io/zero_copy_stream.h>
#include <google/protobuf/stubs/strutil.h>
#include <google/protobuf/compiler/csharp/csharp_doc_comment.h>
#include <google/protobuf/compiler/csharp/csharp_helpers.h>
#include <google/protobuf/compiler/csharp/csharp_primitive_field.h>
@ -68,6 +69,7 @@ void PrimitiveFieldGenerator::GenerateMembers(io::Printer* printer) {
printer->Print(
variables_,
"private $type_name$ $name_def_message$;\n");
WritePropertyDocComment(printer, descriptor_);
AddDeprecatedFlag(printer);
printer->Print(
variables_,
@ -170,6 +172,7 @@ PrimitiveOneofFieldGenerator::~PrimitiveOneofFieldGenerator() {
}
void PrimitiveOneofFieldGenerator::GenerateMembers(io::Printer* printer) {
WritePropertyDocComment(printer, descriptor_);
AddDeprecatedFlag(printer);
printer->Print(
variables_,

View File

@ -38,6 +38,7 @@
#include <google/protobuf/io/zero_copy_stream.h>
#include <google/protobuf/wire_format.h>
#include <google/protobuf/compiler/csharp/csharp_doc_comment.h>
#include <google/protobuf/compiler/csharp/csharp_helpers.h>
#include <google/protobuf/compiler/csharp/csharp_repeated_enum_field.h>
@ -62,6 +63,7 @@ void RepeatedEnumFieldGenerator::GenerateMembers(io::Printer* printer) {
" = pb::FieldCodec.ForEnum($tag$, x => (int) x, x => ($type_name$) x);\n");
printer->Print(variables_,
"private readonly pbc::RepeatedField<$type_name$> $name$_ = new pbc::RepeatedField<$type_name$>();\n");
WritePropertyDocComment(printer, descriptor_);
AddDeprecatedFlag(printer);
printer->Print(
variables_,

View File

@ -37,6 +37,7 @@
#include <google/protobuf/io/printer.h>
#include <google/protobuf/io/zero_copy_stream.h>
#include <google/protobuf/compiler/csharp/csharp_doc_comment.h>
#include <google/protobuf/compiler/csharp/csharp_helpers.h>
#include <google/protobuf/compiler/csharp/csharp_repeated_message_field.h>
#include <google/protobuf/compiler/csharp/csharp_message_field.h>
@ -75,6 +76,7 @@ void RepeatedMessageFieldGenerator::GenerateMembers(io::Printer* printer) {
printer->Print(
variables_,
"private readonly pbc::RepeatedField<$type_name$> $name$_ = new pbc::RepeatedField<$type_name$>();\n");
WritePropertyDocComment(printer, descriptor_);
AddDeprecatedFlag(printer);
printer->Print(
variables_,

View File

@ -38,6 +38,7 @@
#include <google/protobuf/io/zero_copy_stream.h>
#include <google/protobuf/wire_format.h>
#include <google/protobuf/compiler/csharp/csharp_doc_comment.h>
#include <google/protobuf/compiler/csharp/csharp_helpers.h>
#include <google/protobuf/compiler/csharp/csharp_repeated_primitive_field.h>
@ -62,6 +63,7 @@ void RepeatedPrimitiveFieldGenerator::GenerateMembers(io::Printer* printer) {
" = pb::FieldCodec.For$capitalized_type_name$($tag$);\n");
printer->Print(variables_,
"private readonly pbc::RepeatedField<$type_name$> $name$_ = new pbc::RepeatedField<$type_name$>();\n");
WritePropertyDocComment(printer, descriptor_);
AddDeprecatedFlag(printer);
printer->Print(
variables_,

View File

@ -135,7 +135,9 @@ void UmbrellaClassGenerator::WriteIntroduction(io::Printer* printer) {
}
printer->Print(
"[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n");
"/// <summary>Holder for reflection information generated from $file_name$</summary>\n"
"[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n",
"file_name", file_->name());
WriteGeneratedCodeAttributes(printer);
printer->Print(
"$access_level$ static partial class $umbrella_class_name$ {\n"
@ -148,12 +150,14 @@ void UmbrellaClassGenerator::WriteIntroduction(io::Printer* printer) {
void UmbrellaClassGenerator::WriteDescriptor(io::Printer* printer) {
printer->Print(
"#region Descriptor\n"
"/// <summary>File descriptor for $file_name$</summary>\n"
"public static pbr::FileDescriptor Descriptor {\n"
" get { return descriptor; }\n"
"}\n"
"private static pbr::FileDescriptor descriptor;\n"
"\n"
"static $umbrella_class_name$() {\n",
"file_name", file_->name(),
"umbrella_class_name", umbrellaClassname_);
printer->Indent();
printer->Print(
@ -166,7 +170,7 @@ void UmbrellaClassGenerator::WriteDescriptor(io::Printer* printer) {
// TODO(jonskeet): Consider a C#-escaping format here instead of just Base64.
std::string base64 = FileDescriptorToBase64(file_);
while (base64.size() > 60) {
printer->Print("\"$base64$\", \n", "base64", base64.substr(0, 60));
printer->Print("\"$base64$\",\n", "base64", base64.substr(0, 60));
base64 = base64.substr(60);
}
printer->Print("\"$base64$\"));\n", "base64", base64);

View File

@ -37,6 +37,7 @@
#include <google/protobuf/io/printer.h>
#include <google/protobuf/io/zero_copy_stream.h>
#include <google/protobuf/compiler/csharp/csharp_doc_comment.h>
#include <google/protobuf/compiler/csharp/csharp_helpers.h>
#include <google/protobuf/compiler/csharp/csharp_wrapper_field.h>
@ -70,6 +71,7 @@ void WrapperFieldGenerator::GenerateMembers(io::Printer* printer) {
variables_,
";\n"
"private $type_name$ $name$_;\n");
WritePropertyDocComment(printer, descriptor_);
AddDeprecatedFlag(printer);
printer->Print(
variables_,
@ -165,6 +167,7 @@ void WrapperOneofFieldGenerator::GenerateMembers(io::Printer* printer) {
"private static readonly pb::FieldCodec<$type_name$> _oneof_$name$_codec = ");
GenerateCodecCode(printer);
printer->Print(";\n");
WritePropertyDocComment(printer, descriptor_);
AddDeprecatedFlag(printer);
printer->Print(
variables_,

View File

@ -72,7 +72,7 @@ int main(int argc, char* argv[]) {
// CSharp
google::protobuf::compiler::csharp::Generator csharp_generator;
cli.RegisterGenerator("--csharp_out", &csharp_generator,
cli.RegisterGenerator("--csharp_out", "--csharp_opt", &csharp_generator,
"Generate C# source file.");
// Objective C

View File

@ -757,8 +757,9 @@ void protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto() {
"path\030\001 \003(\005B\002\020\001\022\020\n\004span\030\002 \003(\005B\002\020\001\022\030\n\020lead"
"ing_comments\030\003 \001(\t\022\031\n\021trailing_comments\030"
"\004 \001(\t\022!\n\031leading_detached_comments\030\006 \003(\t"
"B;\n\023com.google.protobufB\020DescriptorProto"
"sH\001Z\ndescriptor\242\002\003GPB", 4981);
"BX\n\023com.google.protobufB\020DescriptorProto"
"sH\001Z\ndescriptor\242\002\003GPB\252\002\032Google.Protobuf."
"Reflection", 5010);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"google/protobuf/descriptor.proto", &protobuf_RegisterTypes);
FileDescriptorSet::default_instance_ = new FileDescriptorSet();

View File

@ -43,8 +43,7 @@ package google.protobuf;
option go_package = "descriptor";
option java_package = "com.google.protobuf";
option java_outer_classname = "DescriptorProtos";
// Re-enable this once the tools have picked up the csharp_namespace option.
// option csharp_namespace = "Google.ProtocolBuffers.DescriptorProtos";
option csharp_namespace = "Google.Protobuf.Reflection";
option objc_class_prefix = "GPB";
// descriptor.proto must be optimized for speed because reflection-based

View File

@ -272,24 +272,24 @@ MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::ByteSize(
return WireFormatLite::MessageSizeNoVirtual(value);
}
#define BYTE_SIZE(FieldType, DeclaredType) \
#define GOOGLE_PROTOBUF_BYTE_SIZE(FieldType, DeclaredType) \
template <typename Type> \
inline int MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::ByteSize( \
const MapEntryAccessorType& value) { \
return WireFormatLite::DeclaredType##Size(value); \
}
BYTE_SIZE(STRING, String)
BYTE_SIZE(BYTES , Bytes)
BYTE_SIZE(INT64 , Int64)
BYTE_SIZE(UINT64, UInt64)
BYTE_SIZE(INT32 , Int32)
BYTE_SIZE(UINT32, UInt32)
BYTE_SIZE(SINT64, SInt64)
BYTE_SIZE(SINT32, SInt32)
BYTE_SIZE(ENUM , Enum)
GOOGLE_PROTOBUF_BYTE_SIZE(STRING, String)
GOOGLE_PROTOBUF_BYTE_SIZE(BYTES , Bytes)
GOOGLE_PROTOBUF_BYTE_SIZE(INT64 , Int64)
GOOGLE_PROTOBUF_BYTE_SIZE(UINT64, UInt64)
GOOGLE_PROTOBUF_BYTE_SIZE(INT32 , Int32)
GOOGLE_PROTOBUF_BYTE_SIZE(UINT32, UInt32)
GOOGLE_PROTOBUF_BYTE_SIZE(SINT64, SInt64)
GOOGLE_PROTOBUF_BYTE_SIZE(SINT32, SInt32)
GOOGLE_PROTOBUF_BYTE_SIZE(ENUM , Enum)
#undef BYTE_SIZE
#undef GOOGLE_PROTOBUF_BYTE_SIZE
#define FIXED_BYTE_SIZE(FieldType, DeclaredType) \
template <typename Type> \

View File

@ -494,11 +494,19 @@ Message* GenericTypeHandler<Message>::NewFromPrototype(
return prototype->New(arena);
}
template<>
#if defined(_MSC_VER) && (_MSC_VER >= 1900)
// Note: force noinline to workaround MSVC 2015 compiler bug, issue #240
GOOGLE_ATTRIBUTE_NOINLINE
#endif
google::protobuf::Arena* GenericTypeHandler<Message>::GetArena(
Message* value) {
return value->GetArena();
}
template<>
#if defined(_MSC_VER) && (_MSC_VER >= 1900)
// Note: force noinline to workaround MSVC 2015 compiler bug, issue #240
GOOGLE_ATTRIBUTE_NOINLINE
#endif
void* GenericTypeHandler<Message>::GetMaybeArenaPointer(
Message* value) {
return value->GetMaybeArenaPointer();

View File

@ -56,7 +56,7 @@ namespace internal {
// The tagged pointer uses the LSB to disambiguate cases, and uses bit 0 == 0 to
// indicate an arena pointer and bit 0 == 1 to indicate a UFS+Arena-container
// pointer.
class LIBPROTOBUF_EXPORT InternalMetadataWithArena {
class InternalMetadataWithArena {
public:
InternalMetadataWithArena() : ptr_(NULL) {}
explicit InternalMetadataWithArena(Arena* arena)

View File

@ -41,10 +41,10 @@
#define GOOGLE_PROTOBUF_HAVE_HASH_MAP 1
#define GOOGLE_PROTOBUF_HAVE_HASH_SET 1
// Use C++11 unordered_{map|set} if available. Otherwise, libc++ always support
// unordered_{map|set}
#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X) || \
defined(_LIBCPP_VERSION)
// Use C++11 unordered_{map|set} if available.
#if ((_LIBCPP_STD_VER >= 11) || \
(((__cplusplus >= 201103L) || defined(__GXX_EXPERIMENTAL_CXX0X)) && \
(__GLIBCXX__ > 20090421)))
# define GOOGLE_PROTOBUF_HAS_CXX11_HASH
// For XCode >= 4.6: the compiler is clang with libc++.

View File

@ -94,6 +94,13 @@ string TestSourceDir() {
namespace {
string GetTemporaryDirectoryName() {
// Tests run under Bazel "should not" use /tmp. Bazel sets this environment
// variable for tests to use instead.
char *from_environment = getenv("TEST_TMPDIR");
if (from_environment != NULL && from_environment[0] != '\0') {
return string(from_environment) + "/protobuf_tmpdir";
}
// tmpnam() is generally not considered safe but we're only using it for
// testing. We cannot use tmpfile() or mkstemp() since we're creating a
// directory.

View File

@ -113,12 +113,14 @@ build_javanano_oracle7() {
internal_install_python_deps() {
sudo pip install tox
# Only install Python2.6 on Linux.
# Only install Python2.6/3.x on Linux.
if [ $(uname -s) == "Linux" ]; then
sudo apt-get install -y python-software-properties # for apt-add-repository
sudo apt-add-repository -y ppa:fkrull/deadsnakes
sudo apt-get update -qq
sudo apt-get install -y python2.6 python2.6-dev
sudo apt-get install -y python3.3 python3.3-dev
sudo apt-get install -y python3.4 python3.4-dev
fi
}
@ -127,9 +129,9 @@ build_python() {
internal_build_cpp
internal_install_python_deps
cd python
# Only test Python 2.6 on Linux
# Only test Python 2.6/3.x on Linux
if [ $(uname -s) == "Linux" ]; then
envlist=py26-python,py27-python
envlist=py\{26,27,33,34\}-python
else
envlist=py27-python
fi
@ -143,9 +145,9 @@ build_python_cpp() {
export LD_LIBRARY_PATH=../src/.libs # for Linux
export DYLD_LIBRARY_PATH=../src/.libs # for OS X
cd python
# Only test Python 2.6 on Linux
# Only test Python 2.6/3.x on Linux
if [ $(uname -s) == "Linux" ]; then
envlist=py26-cpp,py27-cpp
envlist=py\{26,27,33,34\}-cpp
else
envlist=py27-cpp
fi