aboutsummaryrefslogtreecommitdiffstats
path: root/tests/options.proto
blob: 6ba7c0703a633f4e10ede535c416f1caf5860278 (plain)
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
/* Test nanopb option parsing.
 * options.expected lists the patterns that are searched for in the output.
 */

import "nanopb.proto";

// File level options
option (nanopb_fileopt).max_size = 20;

message Message1
{
    required string filesize = 1;
}

// Message level options
message Message2
{
    option (nanopb_msgopt).max_size = 30;
    required string msgsize = 1;
}

// Field level options
message Message3
{
    required string fieldsize = 1 [(nanopb).max_size = 40];
}

// Forced callback field
message Message4
{
    required int32 int32_callback = 1 [(nanopb).type = FT_CALLBACK];
}