From 28b0136ea4dcd045f0422d16a25b7d82b0d2aaee Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Mon, 29 Oct 2012 18:20:15 +0200 Subject: Improve .proto options parsing. Options can now be defined on command line, file, message or in field scope. Update issue 12 Status: Started --- tests/options.proto | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/options.proto (limited to 'tests/options.proto') diff --git a/tests/options.proto b/tests/options.proto new file mode 100644 index 00000000..73edf2ba --- /dev/null +++ b/tests/options.proto @@ -0,0 +1,28 @@ +/* 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]; +} + + -- cgit