parent
6b5fb807c0
commit
6ed738305b
71 changed files with 1016 additions and 815 deletions
@ -1,3 +1,4 @@ |
|||||||
Recommended.Proto3.JsonInput.BytesFieldBase64Url.JsonOutput |
Recommended.Proto3.JsonInput.BytesFieldBase64Url.JsonOutput |
||||||
Recommended.Proto3.JsonInput.BytesFieldBase64Url.ProtobufOutput |
Recommended.Proto3.JsonInput.BytesFieldBase64Url.ProtobufOutput |
||||||
Required.Proto2.JsonInput.StoresDefaultPrimitive.Validator |
Required.Proto2.JsonInput.StoresDefaultPrimitive.Validator |
||||||
|
Recommended.Proto2.JsonInput.FieldNameExtension.Validator |
||||||
|
@ -0,0 +1,306 @@ |
|||||||
|
// <auto-generated> |
||||||
|
// Generated by the protocol buffer compiler. DO NOT EDIT! |
||||||
|
// source: unittest_selfreferential_options.proto |
||||||
|
// </auto-generated> |
||||||
|
#pragma warning disable 1591, 0612, 3021 |
||||||
|
#region Designer generated code |
||||||
|
|
||||||
|
using pb = global::Google.Protobuf; |
||||||
|
using pbc = global::Google.Protobuf.Collections; |
||||||
|
using pbr = global::Google.Protobuf.Reflection; |
||||||
|
using scg = global::System.Collections.Generic; |
||||||
|
namespace UnitTest.Issues.TestProtos.SelfreferentialOptions { |
||||||
|
|
||||||
|
/// <summary>Holder for reflection information generated from unittest_selfreferential_options.proto</summary> |
||||||
|
public static partial class UnittestSelfreferentialOptionsReflection { |
||||||
|
|
||||||
|
#region Descriptor |
||||||
|
/// <summary>File descriptor for unittest_selfreferential_options.proto</summary> |
||||||
|
public static pbr::FileDescriptor Descriptor { |
||||||
|
get { return descriptor; } |
||||||
|
} |
||||||
|
private static pbr::FileDescriptor descriptor; |
||||||
|
|
||||||
|
static UnittestSelfreferentialOptionsReflection() { |
||||||
|
byte[] descriptorData = global::System.Convert.FromBase64String( |
||||||
|
string.Concat( |
||||||
|
"CiZ1bml0dGVzdF9zZWxmcmVmZXJlbnRpYWxfb3B0aW9ucy5wcm90bxIpcHJv", |
||||||
|
"dG9idWZfdW5pdHRlc3Rfc2VsZnJlZmVyZW50aWFsX29wdGlvbnMaIGdvb2ds", |
||||||
|
"ZS9wcm90b2J1Zi9kZXNjcmlwdG9yLnByb3RvIkwKCkZvb09wdGlvbnMSHgoH", |
||||||
|
"aW50X29wdBgBIAEoBUINyj4KCAHAPgLKPgIIAxITCgNmb28YAiABKAVCBso+", |
||||||
|
"AxDSCSoJCOgHEICAgIACOjkKC2Jhcl9vcHRpb25zEh0uZ29vZ2xlLnByb3Rv", |
||||||
|
"YnVmLkZpZWxkT3B0aW9ucxjoByABKAVCBMA+0gk6agoLZm9vX29wdGlvbnMS", |
||||||
|
"HS5nb29nbGUucHJvdG9idWYuRmllbGRPcHRpb25zGOkHIAEoCzI1LnByb3Rv", |
||||||
|
"YnVmX3VuaXR0ZXN0X3NlbGZyZWZlcmVudGlhbF9vcHRpb25zLkZvb09wdGlv", |
||||||
|
"bnM6SwoLZm9vX2ludF9vcHQSNS5wcm90b2J1Zl91bml0dGVzdF9zZWxmcmVm", |
||||||
|
"ZXJlbnRpYWxfb3B0aW9ucy5Gb29PcHRpb25zGOgHIAEoBTqCAQoLZm9vX2Zv", |
||||||
|
"b19vcHQSNS5wcm90b2J1Zl91bml0dGVzdF9zZWxmcmVmZXJlbnRpYWxfb3B0", |
||||||
|
"aW9ucy5Gb29PcHRpb25zGOkHIAEoCzI1LnByb3RvYnVmX3VuaXR0ZXN0X3Nl", |
||||||
|
"bGZyZWZlcmVudGlhbF9vcHRpb25zLkZvb09wdGlvbnNCNKoCMVVuaXRUZXN0", |
||||||
|
"Lklzc3Vlcy5UZXN0UHJvdG9zLlNlbGZyZWZlcmVudGlhbE9wdGlvbnM=")); |
||||||
|
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, |
||||||
|
new pbr::FileDescriptor[] { global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor, }, |
||||||
|
new pbr::GeneratedClrTypeInfo(null, new pb::Extension[] { UnittestSelfreferentialOptionsExtensions.BarOptions, UnittestSelfreferentialOptionsExtensions.FooOptions, UnittestSelfreferentialOptionsExtensions.FooIntOpt, UnittestSelfreferentialOptionsExtensions.FooFooOpt }, new pbr::GeneratedClrTypeInfo[] { |
||||||
|
new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.SelfreferentialOptions.FooOptions), global::UnitTest.Issues.TestProtos.SelfreferentialOptions.FooOptions.Parser, new[]{ "IntOpt", "Foo" }, null, null, null, null) |
||||||
|
})); |
||||||
|
} |
||||||
|
#endregion |
||||||
|
|
||||||
|
} |
||||||
|
/// <summary>Holder for extension identifiers generated from the top level of unittest_selfreferential_options.proto</summary> |
||||||
|
public static partial class UnittestSelfreferentialOptionsExtensions { |
||||||
|
/// <summary> |
||||||
|
/// Custom field option used on the definition of that field option. |
||||||
|
/// </summary> |
||||||
|
public static readonly pb::Extension<global::Google.Protobuf.Reflection.FieldOptions, int> BarOptions = |
||||||
|
new pb::Extension<global::Google.Protobuf.Reflection.FieldOptions, int>(1000, pb::FieldCodec.ForInt32(8000, 0)); |
||||||
|
public static readonly pb::Extension<global::Google.Protobuf.Reflection.FieldOptions, global::UnitTest.Issues.TestProtos.SelfreferentialOptions.FooOptions> FooOptions = |
||||||
|
new pb::Extension<global::Google.Protobuf.Reflection.FieldOptions, global::UnitTest.Issues.TestProtos.SelfreferentialOptions.FooOptions>(1001, pb::FieldCodec.ForMessage(8010, global::UnitTest.Issues.TestProtos.SelfreferentialOptions.FooOptions.Parser)); |
||||||
|
public static readonly pb::Extension<global::UnitTest.Issues.TestProtos.SelfreferentialOptions.FooOptions, int> FooIntOpt = |
||||||
|
new pb::Extension<global::UnitTest.Issues.TestProtos.SelfreferentialOptions.FooOptions, int>(1000, pb::FieldCodec.ForInt32(8000, 0)); |
||||||
|
public static readonly pb::Extension<global::UnitTest.Issues.TestProtos.SelfreferentialOptions.FooOptions, global::UnitTest.Issues.TestProtos.SelfreferentialOptions.FooOptions> FooFooOpt = |
||||||
|
new pb::Extension<global::UnitTest.Issues.TestProtos.SelfreferentialOptions.FooOptions, global::UnitTest.Issues.TestProtos.SelfreferentialOptions.FooOptions>(1001, pb::FieldCodec.ForMessage(8010, global::UnitTest.Issues.TestProtos.SelfreferentialOptions.FooOptions.Parser)); |
||||||
|
} |
||||||
|
|
||||||
|
#region Messages |
||||||
|
public sealed partial class FooOptions : pb::IExtendableMessage<FooOptions>, pb::IBufferMessage { |
||||||
|
private static readonly pb::MessageParser<FooOptions> _parser = new pb::MessageParser<FooOptions>(() => new FooOptions()); |
||||||
|
private pb::UnknownFieldSet _unknownFields; |
||||||
|
private pb::ExtensionSet<FooOptions> _extensions; |
||||||
|
private pb::ExtensionSet<FooOptions> _Extensions { get { return _extensions; } } |
||||||
|
private int _hasBits0; |
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
||||||
|
public static pb::MessageParser<FooOptions> Parser { get { return _parser; } } |
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
||||||
|
public static pbr::MessageDescriptor Descriptor { |
||||||
|
get { return global::UnitTest.Issues.TestProtos.SelfreferentialOptions.UnittestSelfreferentialOptionsReflection.Descriptor.MessageTypes[0]; } |
||||||
|
} |
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
||||||
|
pbr::MessageDescriptor pb::IMessage.Descriptor { |
||||||
|
get { return Descriptor; } |
||||||
|
} |
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
||||||
|
public FooOptions() { |
||||||
|
OnConstruction(); |
||||||
|
} |
||||||
|
|
||||||
|
partial void OnConstruction(); |
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
||||||
|
public FooOptions(FooOptions other) : this() { |
||||||
|
_hasBits0 = other._hasBits0; |
||||||
|
intOpt_ = other.intOpt_; |
||||||
|
foo_ = other.foo_; |
||||||
|
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); |
||||||
|
_extensions = pb::ExtensionSet.Clone(other._extensions); |
||||||
|
} |
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
||||||
|
public FooOptions Clone() { |
||||||
|
return new FooOptions(this); |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>Field number for the "int_opt" field.</summary> |
||||||
|
public const int IntOptFieldNumber = 1; |
||||||
|
private readonly static int IntOptDefaultValue = 0; |
||||||
|
|
||||||
|
private int intOpt_; |
||||||
|
/// <summary> |
||||||
|
/// Custom field option used in definition of the extension message. |
||||||
|
/// </summary> |
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
||||||
|
public int IntOpt { |
||||||
|
get { if ((_hasBits0 & 1) != 0) { return intOpt_; } else { return IntOptDefaultValue; } } |
||||||
|
set { |
||||||
|
_hasBits0 |= 1; |
||||||
|
intOpt_ = value; |
||||||
|
} |
||||||
|
} |
||||||
|
/// <summary>Gets whether the "int_opt" field is set</summary> |
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
||||||
|
public bool HasIntOpt { |
||||||
|
get { return (_hasBits0 & 1) != 0; } |
||||||
|
} |
||||||
|
/// <summary>Clears the value of the "int_opt" field</summary> |
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
||||||
|
public void ClearIntOpt() { |
||||||
|
_hasBits0 &= ~1; |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>Field number for the "foo" field.</summary> |
||||||
|
public const int FooFieldNumber = 2; |
||||||
|
private readonly static int FooDefaultValue = 0; |
||||||
|
|
||||||
|
private int foo_; |
||||||
|
/// <summary> |
||||||
|
/// Custom field option used in definition of the custom option's message. |
||||||
|
/// </summary> |
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
||||||
|
public int Foo { |
||||||
|
get { if ((_hasBits0 & 2) != 0) { return foo_; } else { return FooDefaultValue; } } |
||||||
|
set { |
||||||
|
_hasBits0 |= 2; |
||||||
|
foo_ = value; |
||||||
|
} |
||||||
|
} |
||||||
|
/// <summary>Gets whether the "foo" field is set</summary> |
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
||||||
|
public bool HasFoo { |
||||||
|
get { return (_hasBits0 & 2) != 0; } |
||||||
|
} |
||||||
|
/// <summary>Clears the value of the "foo" field</summary> |
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
||||||
|
public void ClearFoo() { |
||||||
|
_hasBits0 &= ~2; |
||||||
|
} |
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
||||||
|
public override bool Equals(object other) { |
||||||
|
return Equals(other as FooOptions); |
||||||
|
} |
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
||||||
|
public bool Equals(FooOptions other) { |
||||||
|
if (ReferenceEquals(other, null)) { |
||||||
|
return false; |
||||||
|
} |
||||||
|
if (ReferenceEquals(other, this)) { |
||||||
|
return true; |
||||||
|
} |
||||||
|
if (IntOpt != other.IntOpt) return false; |
||||||
|
if (Foo != other.Foo) return false; |
||||||
|
if (!Equals(_extensions, other._extensions)) { |
||||||
|
return false; |
||||||
|
} |
||||||
|
return Equals(_unknownFields, other._unknownFields); |
||||||
|
} |
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
||||||
|
public override int GetHashCode() { |
||||||
|
int hash = 1; |
||||||
|
if (HasIntOpt) hash ^= IntOpt.GetHashCode(); |
||||||
|
if (HasFoo) hash ^= Foo.GetHashCode(); |
||||||
|
if (_extensions != null) { |
||||||
|
hash ^= _extensions.GetHashCode(); |
||||||
|
} |
||||||
|
if (_unknownFields != null) { |
||||||
|
hash ^= _unknownFields.GetHashCode(); |
||||||
|
} |
||||||
|
return hash; |
||||||
|
} |
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
||||||
|
public override string ToString() { |
||||||
|
return pb::JsonFormatter.ToDiagnosticString(this); |
||||||
|
} |
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
||||||
|
public void WriteTo(pb::CodedOutputStream output) { |
||||||
|
if (HasIntOpt) { |
||||||
|
output.WriteRawTag(8); |
||||||
|
output.WriteInt32(IntOpt); |
||||||
|
} |
||||||
|
if (HasFoo) { |
||||||
|
output.WriteRawTag(16); |
||||||
|
output.WriteInt32(Foo); |
||||||
|
} |
||||||
|
if (_extensions != null) { |
||||||
|
_extensions.WriteTo(output); |
||||||
|
} |
||||||
|
if (_unknownFields != null) { |
||||||
|
_unknownFields.WriteTo(output); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
||||||
|
public int CalculateSize() { |
||||||
|
int size = 0; |
||||||
|
if (HasIntOpt) { |
||||||
|
size += 1 + pb::CodedOutputStream.ComputeInt32Size(IntOpt); |
||||||
|
} |
||||||
|
if (HasFoo) { |
||||||
|
size += 1 + pb::CodedOutputStream.ComputeInt32Size(Foo); |
||||||
|
} |
||||||
|
if (_extensions != null) { |
||||||
|
size += _extensions.CalculateSize(); |
||||||
|
} |
||||||
|
if (_unknownFields != null) { |
||||||
|
size += _unknownFields.CalculateSize(); |
||||||
|
} |
||||||
|
return size; |
||||||
|
} |
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
||||||
|
public void MergeFrom(FooOptions other) { |
||||||
|
if (other == null) { |
||||||
|
return; |
||||||
|
} |
||||||
|
if (other.HasIntOpt) { |
||||||
|
IntOpt = other.IntOpt; |
||||||
|
} |
||||||
|
if (other.HasFoo) { |
||||||
|
Foo = other.Foo; |
||||||
|
} |
||||||
|
pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions); |
||||||
|
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); |
||||||
|
} |
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
||||||
|
public void MergeFrom(pb::CodedInputStream input) { |
||||||
|
input.ReadRawMessage(this); |
||||||
|
} |
||||||
|
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] |
||||||
|
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { |
||||||
|
uint tag; |
||||||
|
while ((tag = input.ReadTag()) != 0) { |
||||||
|
switch(tag) { |
||||||
|
default: |
||||||
|
if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) { |
||||||
|
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); |
||||||
|
} |
||||||
|
break; |
||||||
|
case 8: { |
||||||
|
IntOpt = input.ReadInt32(); |
||||||
|
break; |
||||||
|
} |
||||||
|
case 16: { |
||||||
|
Foo = input.ReadInt32(); |
||||||
|
break; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public TValue GetExtension<TValue>(pb::Extension<FooOptions, TValue> extension) { |
||||||
|
return pb::ExtensionSet.Get(ref _extensions, extension); |
||||||
|
} |
||||||
|
public pbc::RepeatedField<TValue> GetExtension<TValue>(pb::RepeatedExtension<FooOptions, TValue> extension) { |
||||||
|
return pb::ExtensionSet.Get(ref _extensions, extension); |
||||||
|
} |
||||||
|
public pbc::RepeatedField<TValue> GetOrInitializeExtension<TValue>(pb::RepeatedExtension<FooOptions, TValue> extension) { |
||||||
|
return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension); |
||||||
|
} |
||||||
|
public void SetExtension<TValue>(pb::Extension<FooOptions, TValue> extension, TValue value) { |
||||||
|
pb::ExtensionSet.Set(ref _extensions, extension, value); |
||||||
|
} |
||||||
|
public bool HasExtension<TValue>(pb::Extension<FooOptions, TValue> extension) { |
||||||
|
return pb::ExtensionSet.Has(ref _extensions, extension); |
||||||
|
} |
||||||
|
public void ClearExtension<TValue>(pb::Extension<FooOptions, TValue> extension) { |
||||||
|
pb::ExtensionSet.Clear(ref _extensions, extension); |
||||||
|
} |
||||||
|
public void ClearExtension<TValue>(pb::RepeatedExtension<FooOptions, TValue> extension) { |
||||||
|
pb::ExtensionSet.Clear(ref _extensions, extension); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
#endregion |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
#endregion Designer generated code |
Binary file not shown.
@ -1,9 +0,0 @@ |
|||||||
config_setting( |
|
||||||
name = "jdk9", |
|
||||||
values = { |
|
||||||
"java_toolchain": "@bazel_tools//tools/jdk:toolchain_jdk9", |
|
||||||
}, |
|
||||||
visibility = [ |
|
||||||
"//java:__subpackages__", |
|
||||||
], |
|
||||||
) |
|
@ -1,206 +0,0 @@ |
|||||||
// 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. |
|
||||||
// |
|
||||||
// This proto file contains copies of TestAllTypes and friends, but with arena |
|
||||||
// support disabled in code generation. It allows us to test the performance |
|
||||||
// impact against baseline (non-arena) google.protobuf. |
|
||||||
|
|
||||||
syntax = "proto2"; |
|
||||||
|
|
||||||
// Some generic_services option(s) added automatically. |
|
||||||
// See: http://go/proto2-generic-services-default |
|
||||||
option cc_generic_services = true; // auto-added |
|
||||||
option java_generic_services = true; // auto-added |
|
||||||
option py_generic_services = true; // auto-added |
|
||||||
option cc_enable_arenas = false; |
|
||||||
option objc_class_prefix = "NOARN"; |
|
||||||
|
|
||||||
import "google/protobuf/unittest_import.proto"; |
|
||||||
import "google/protobuf/unittest_arena.proto"; |
|
||||||
|
|
||||||
// We don't put this in a package within proto2 because we need to make sure |
|
||||||
// that the generated code doesn't depend on being in the proto2 namespace. |
|
||||||
// In test_util.h we do "using namespace unittest = protobuf_unittest". |
|
||||||
package protobuf_unittest_no_arena; |
|
||||||
|
|
||||||
// Protos optimized for SPEED use a strict superset of the generated code |
|
||||||
// of equivalent ones optimized for CODE_SIZE, so we should optimize all our |
|
||||||
// tests for speed unless explicitly testing code size optimization. |
|
||||||
option optimize_for = SPEED; |
|
||||||
|
|
||||||
option java_outer_classname = "UnittestProto"; |
|
||||||
|
|
||||||
// This proto includes every type of field in both singular and repeated |
|
||||||
// forms. |
|
||||||
message TestAllTypes { |
|
||||||
message NestedMessage { |
|
||||||
// The field name "b" fails to compile in proto1 because it conflicts with |
|
||||||
// a local variable named "b" in one of the generated methods. Doh. |
|
||||||
// This file needs to compile in proto1 to test backwards-compatibility. |
|
||||||
optional int32 bb = 1; |
|
||||||
} |
|
||||||
|
|
||||||
enum NestedEnum { |
|
||||||
FOO = 1; |
|
||||||
BAR = 2; |
|
||||||
BAZ = 3; |
|
||||||
NEG = -1; // Intentionally negative. |
|
||||||
} |
|
||||||
|
|
||||||
// Singular |
|
||||||
optional int32 optional_int32 = 1; |
|
||||||
optional int64 optional_int64 = 2; |
|
||||||
optional uint32 optional_uint32 = 3; |
|
||||||
optional uint64 optional_uint64 = 4; |
|
||||||
optional sint32 optional_sint32 = 5; |
|
||||||
optional sint64 optional_sint64 = 6; |
|
||||||
optional fixed32 optional_fixed32 = 7; |
|
||||||
optional fixed64 optional_fixed64 = 8; |
|
||||||
optional sfixed32 optional_sfixed32 = 9; |
|
||||||
optional sfixed64 optional_sfixed64 = 10; |
|
||||||
optional float optional_float = 11; |
|
||||||
optional double optional_double = 12; |
|
||||||
optional bool optional_bool = 13; |
|
||||||
optional string optional_string = 14; |
|
||||||
optional bytes optional_bytes = 15; |
|
||||||
|
|
||||||
optional group OptionalGroup = 16 { |
|
||||||
optional int32 a = 17; |
|
||||||
} |
|
||||||
|
|
||||||
optional NestedMessage optional_nested_message = 18; |
|
||||||
optional ForeignMessage optional_foreign_message = 19; |
|
||||||
optional protobuf_unittest_import.ImportMessage optional_import_message = 20; |
|
||||||
|
|
||||||
optional NestedEnum optional_nested_enum = 21; |
|
||||||
optional ForeignEnum optional_foreign_enum = 22; |
|
||||||
optional protobuf_unittest_import.ImportEnum optional_import_enum = 23; |
|
||||||
|
|
||||||
optional string optional_string_piece = 24 [ctype=STRING_PIECE]; |
|
||||||
optional string optional_cord = 25 [ctype=CORD]; |
|
||||||
|
|
||||||
// Defined in unittest_import_public.proto |
|
||||||
optional protobuf_unittest_import.PublicImportMessage |
|
||||||
optional_public_import_message = 26; |
|
||||||
|
|
||||||
optional NestedMessage optional_message = 27 [lazy=true]; |
|
||||||
|
|
||||||
// Repeated |
|
||||||
repeated int32 repeated_int32 = 31; |
|
||||||
repeated int64 repeated_int64 = 32; |
|
||||||
repeated uint32 repeated_uint32 = 33; |
|
||||||
repeated uint64 repeated_uint64 = 34; |
|
||||||
repeated sint32 repeated_sint32 = 35; |
|
||||||
repeated sint64 repeated_sint64 = 36; |
|
||||||
repeated fixed32 repeated_fixed32 = 37; |
|
||||||
repeated fixed64 repeated_fixed64 = 38; |
|
||||||
repeated sfixed32 repeated_sfixed32 = 39; |
|
||||||
repeated sfixed64 repeated_sfixed64 = 40; |
|
||||||
repeated float repeated_float = 41; |
|
||||||
repeated double repeated_double = 42; |
|
||||||
repeated bool repeated_bool = 43; |
|
||||||
repeated string repeated_string = 44; |
|
||||||
repeated bytes repeated_bytes = 45; |
|
||||||
|
|
||||||
repeated group RepeatedGroup = 46 { |
|
||||||
optional int32 a = 47; |
|
||||||
} |
|
||||||
|
|
||||||
repeated NestedMessage repeated_nested_message = 48; |
|
||||||
repeated ForeignMessage repeated_foreign_message = 49; |
|
||||||
repeated protobuf_unittest_import.ImportMessage repeated_import_message = 50; |
|
||||||
|
|
||||||
repeated NestedEnum repeated_nested_enum = 51; |
|
||||||
repeated ForeignEnum repeated_foreign_enum = 52; |
|
||||||
repeated protobuf_unittest_import.ImportEnum repeated_import_enum = 53; |
|
||||||
|
|
||||||
repeated string repeated_string_piece = 54 [ctype=STRING_PIECE]; |
|
||||||
repeated string repeated_cord = 55 [ctype=CORD]; |
|
||||||
|
|
||||||
repeated NestedMessage repeated_lazy_message = 57 [lazy=true]; |
|
||||||
|
|
||||||
// Singular with defaults |
|
||||||
optional int32 default_int32 = 61 [default = 41 ]; |
|
||||||
optional int64 default_int64 = 62 [default = 42 ]; |
|
||||||
optional uint32 default_uint32 = 63 [default = 43 ]; |
|
||||||
optional uint64 default_uint64 = 64 [default = 44 ]; |
|
||||||
optional sint32 default_sint32 = 65 [default = -45 ]; |
|
||||||
optional sint64 default_sint64 = 66 [default = 46 ]; |
|
||||||
optional fixed32 default_fixed32 = 67 [default = 47 ]; |
|
||||||
optional fixed64 default_fixed64 = 68 [default = 48 ]; |
|
||||||
optional sfixed32 default_sfixed32 = 69 [default = 49 ]; |
|
||||||
optional sfixed64 default_sfixed64 = 70 [default = -50 ]; |
|
||||||
optional float default_float = 71 [default = 51.5 ]; |
|
||||||
optional double default_double = 72 [default = 52e3 ]; |
|
||||||
optional bool default_bool = 73 [default = true ]; |
|
||||||
optional string default_string = 74 [default = "hello"]; |
|
||||||
optional bytes default_bytes = 75 [default = "world"]; |
|
||||||
|
|
||||||
optional NestedEnum default_nested_enum = 81 [default = BAR ]; |
|
||||||
optional ForeignEnum default_foreign_enum = 82 [default = FOREIGN_BAR]; |
|
||||||
optional protobuf_unittest_import.ImportEnum |
|
||||||
default_import_enum = 83 [default = IMPORT_BAR]; |
|
||||||
|
|
||||||
optional string default_string_piece = 84 [ctype=STRING_PIECE,default="abc"]; |
|
||||||
optional string default_cord = 85 [ctype=CORD,default="123"]; |
|
||||||
|
|
||||||
// For oneof test |
|
||||||
oneof oneof_field { |
|
||||||
uint32 oneof_uint32 = 111; |
|
||||||
NestedMessage oneof_nested_message = 112; |
|
||||||
string oneof_string = 113; |
|
||||||
bytes oneof_bytes = 114; |
|
||||||
NestedMessage lazy_oneof_nested_message = 115 [lazy=true]; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
// Define these after TestAllTypes to make sure the compiler can handle |
|
||||||
// that. |
|
||||||
message ForeignMessage { |
|
||||||
optional int32 c = 1; |
|
||||||
} |
|
||||||
|
|
||||||
enum ForeignEnum { |
|
||||||
FOREIGN_FOO = 4; |
|
||||||
FOREIGN_BAR = 5; |
|
||||||
FOREIGN_BAZ = 6; |
|
||||||
} |
|
||||||
|
|
||||||
message TestNoArenaMessage { |
|
||||||
optional proto2_arena_unittest.ArenaMessage arena_message = 1; |
|
||||||
}; |
|
||||||
|
|
||||||
message OneString { |
|
||||||
optional string data = 1; |
|
||||||
} |
|
@ -1,39 +0,0 @@ |
|||||||
// 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. |
|
||||||
|
|
||||||
syntax = "proto2"; |
|
||||||
|
|
||||||
package proto2_arena_unittest; |
|
||||||
|
|
||||||
option cc_enable_arenas = false; |
|
||||||
|
|
||||||
message ImportNoArenaNestedMessage { |
|
||||||
optional int32 d = 1; |
|
||||||
} |
|
Loading…
Reference in new issue