DCCL v4
test.proto
1 syntax = "proto2";
2 
3 import "dccl/option_extensions.proto";
4 
5 package dccl.test;
6 
7 message TestMsg
8 {
9  option (dccl.msg) = {
10  id: 1
11  max_bytes: 32
12  codec_version: 4
13  };
14 
15  repeated int32 a = 1 [
16  (dccl.field) = { min: -100 max: 100 max_repeat: 5 }
17  ]; // default min repeat (0)
18  repeated int32 b = 2 [
19  (dccl.field) = { min: -100 max: 100 min_repeat: 2 max_repeat: 3 }
20  ]; // min repeat and max repeat different
21  repeated int32 c = 3 [
22  (dccl.field) = { min: -100 max: 100 min_repeat: 3 max_repeat: 3 }
23  ]; // min repeat and max repeat the same
24 }
25 
26 message InvalidTestMsgMissingMaxRepeat
27 {
28  option (dccl.msg) = {
29  id: 2
30  max_bytes: 32
31  codec_version: 4
32  };
33 
34  repeated int32 a = 1 [(dccl.field) = { min: -100 max: 100 }];
35 }
36 
37 message InvalidTestMsgMaxRepeatLessThanOne
38 {
39  option (dccl.msg) = {
40  id: 2
41  max_bytes: 32
42  codec_version: 4
43  };
44 
45  repeated int32 a = 1 [(dccl.field) = { min: -100 max: 100 max_repeat: 0 }];
46 }
47 
48 message InvalidTestMsgMaxRepeatLessThanMinRepeat
49 {
50  option (dccl.msg) = {
51  id: 2
52  max_bytes: 32
53  codec_version: 4
54  };
55 
56  repeated int32 a = 1
57  [(dccl.field) = { min: -100 max: 100 min_repeat: 5 max_repeat: 3 }];
58 }