diff options
author | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2015-01-04 19:39:37 +0200 |
---|---|---|
committer | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2015-01-04 19:39:37 +0200 |
commit | 7713d43bc3d448358a04393c4e44dd12a768bdea (patch) | |
tree | 140573b1d78947739e5f46721d681a580a4d3030 /tests/oneof/oneof.proto | |
parent | a0f0440394ac3b38105dfad09366f95011c5d8d3 (diff) |
Implement support for oneofs (C unions).
Basic test included, should probably add an oneof to the AllTypes test also.
Update issue 131
Status: Started
Diffstat (limited to 'tests/oneof/oneof.proto')
-rw-r--r-- | tests/oneof/oneof.proto | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/oneof/oneof.proto b/tests/oneof/oneof.proto new file mode 100644 index 00000000..a89ef131 --- /dev/null +++ b/tests/oneof/oneof.proto @@ -0,0 +1,18 @@ +import 'nanopb.proto'; + +message SubMessage +{ + repeated int32 array = 1 [(nanopb).max_count = 8]; +} + +message OneOfMessage +{ + required int32 prefix = 1; + oneof values + { + int32 first = 5; + string second = 6 [(nanopb).max_size = 8]; + SubMessage third = 7; + } + required int32 suffix = 99; +} |