From 283258dca59c470e8e209431e206a344839e0cf5 Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Thu, 22 Dec 2016 17:37:14 +0200 Subject: Allow overriding proto3 mode (#228) --- tests/options/SConscript | 5 ++++- tests/options/proto3_options.expected | 4 ++++ tests/options/proto3_options.proto | 11 +++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 tests/options/proto3_options.expected create mode 100644 tests/options/proto3_options.proto (limited to 'tests') diff --git a/tests/options/SConscript b/tests/options/SConscript index 89a00fa5..215e3bd0 100644 --- a/tests/options/SConscript +++ b/tests/options/SConscript @@ -4,6 +4,9 @@ Import("env") env.NanopbProto("options") env.Object('options.pb.c') - env.Match(['options.pb.h', 'options.expected']) +env.NanopbProto("proto3_options") +env.Object('proto3_options.pb.c') +env.Match(['proto3_options.pb.h', 'proto3_options.expected']) + diff --git a/tests/options/proto3_options.expected b/tests/options/proto3_options.expected new file mode 100644 index 00000000..cc2f29c0 --- /dev/null +++ b/tests/options/proto3_options.expected @@ -0,0 +1,4 @@ +! bool has_proto3_default +bool has_proto3_off +! bool has_proto3_on + diff --git a/tests/options/proto3_options.proto b/tests/options/proto3_options.proto new file mode 100644 index 00000000..1017f046 --- /dev/null +++ b/tests/options/proto3_options.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; + +import "nanopb.proto"; + +message Message1 +{ + int32 proto3_default = 1; + int32 proto3_off = 2 [(nanopb).proto3 = false]; + int32 proto3_on = 3 [(nanopb).proto3 = true]; +} + -- cgit 1.2.3-korg