aboutsummaryrefslogtreecommitdiff
path: root/protos/extest/unittest_issues.proto
blob: ce5b7972e8b9981e06535c1d207c73b2644083da (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
// These proto descriptors have at one time been reported as an issue or defect.
// They are kept here to replicate the issue, and continue to verify the fix.
import "google/protobuf/csharp_options.proto";

// Issue: Non-"Google.Protobuffers" namespace will ensure that protobuffer library types are qualified
option (google.protobuf.csharp_file_options).namespace = "UnitTest.Issues.TestProtos";
option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestExtrasIssuesProtoFile";

package unittest_issues;
option optimize_for = SPEED;

// The following is a representative set of features
/*
enum EnumOptions {
    ONE = 0;
    TWO = 1;
    THREE = 2;
}

message TestBasicChild
{
    repeated EnumOptions options = 3;
    optional bytes binary = 4;
}

message TestBasicNoFields {
}

message TestBasicRescursive {
    optional TestBasicRescursive child = 1;
}

message TestBasicMessage {

    optional int64 number = 6;
    repeated int32 numbers = 2;
    optional string text = 3;
    repeated string textlines = 700;
    optional bool valid = 5;
    
    optional TestBasicChild child = 1;
    repeated group Children = 401 
    {
        repeated EnumOptions options = 3;
        optional bytes binary = 4;
    }

    extensions 100 to 199;
}

message  TestBasicExtension {
  required int32 number = 1;
}
  
extend TestBasicMessage {
  optional EnumOptions extension_enum = 101;
  optional string extension_text = 102;
  repeated int32 extension_number = 103 [packed = true];
  optional TestBasicExtension extension_message = 199;
}

// Issue for non-qualified type reference in new services generation
option (google.protobuf.csharp_file_options).service_generator_type = IRPCDISPATCH;

service TestGenericService {
  rpc Foo(TestBasicNoFields) returns (TestBasicMessage);
  rpc Bar(TestBasicNoFields) returns (TestBasicMessage);
}
*/
// Issue 13: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=13
 
message A {
    optional int32 _A = 1;
}

message B {
    optional int32 B_ = 1;
}

message AB {
    optional int32 a_b = 1;
}

// Similar issue with numeric names
message NumberField {
    optional int32 _01 = 1;
}

// Issue 21: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=21
// Decorate fields with [deprecated=true] as [System.Obsolete]

message DeprecatedChild {
}

enum DeprecatedEnum {
    one = 1;
}

message DeprecatedFieldsMessage {
    optional int32 PrimitiveValue = 1 [deprecated = true];
    repeated int32 PrimitiveArray = 2 [deprecated = true];

    optional DeprecatedChild MessageValue = 3 [deprecated = true];
    repeated DeprecatedChild MessageArray = 4 [deprecated = true];

    optional DeprecatedEnum EnumValue = 5 [deprecated = true];
    repeated DeprecatedEnum EnumArray = 6 [deprecated = true];
}