summaryrefslogtreecommitdiffstats
path: root/libs/nanopb/tests/regression/issue_172
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-06-20 10:24:05 +0000
committerRomain Forlot <romain.forlot@iot.bzh>2017-06-20 10:24:05 +0000
commit32e25cbca210a359b09768537b6f443fe90a3070 (patch)
tree3309794c15d8a8f8e9c1c08cad072ee1378813ba /libs/nanopb/tests/regression/issue_172
parent76c43dec62b2e21cd6446360c00d4fe6b437533f (diff)
Separation Generator to a dedicated repo
Change-Id: Id94831651c3266861435272a6e36c7884bef2c45 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'libs/nanopb/tests/regression/issue_172')
-rw-r--r--libs/nanopb/tests/regression/issue_172/SConscript16
-rw-r--r--libs/nanopb/tests/regression/issue_172/msg_size.c9
-rw-r--r--libs/nanopb/tests/regression/issue_172/submessage/submessage.options1
-rw-r--r--libs/nanopb/tests/regression/issue_172/submessage/submessage.proto4
-rw-r--r--libs/nanopb/tests/regression/issue_172/test.proto6
5 files changed, 36 insertions, 0 deletions
diff --git a/libs/nanopb/tests/regression/issue_172/SConscript b/libs/nanopb/tests/regression/issue_172/SConscript
new file mode 100644
index 00000000..49c919e8
--- /dev/null
+++ b/libs/nanopb/tests/regression/issue_172/SConscript
@@ -0,0 +1,16 @@
+# Verify that _size define is generated for messages that have
+# includes from another directory.
+
+Import('env')
+
+incpath = env.Clone()
+incpath.Append(PROTOCPATH="#regression/issue_172/submessage")
+incpath.Append(CPPPATH="$BUILD/regression/issue_172/submessage")
+incpath.NanopbProto('test')
+incpath.NanopbProto(['submessage/submessage', 'submessage/submessage.options'])
+
+p = incpath.Program(["msg_size.c",
+ "test.pb.c",
+ "submessage/submessage.pb.c"])
+
+
diff --git a/libs/nanopb/tests/regression/issue_172/msg_size.c b/libs/nanopb/tests/regression/issue_172/msg_size.c
new file mode 100644
index 00000000..be45acb4
--- /dev/null
+++ b/libs/nanopb/tests/regression/issue_172/msg_size.c
@@ -0,0 +1,9 @@
+#include "test.pb.h"
+
+PB_STATIC_ASSERT(testmessage_size >= 1+1+1+1+16, TESTMESSAGE_SIZE_IS_WRONG)
+
+int main()
+{
+ return 0;
+}
+
diff --git a/libs/nanopb/tests/regression/issue_172/submessage/submessage.options b/libs/nanopb/tests/regression/issue_172/submessage/submessage.options
new file mode 100644
index 00000000..12fb1984
--- /dev/null
+++ b/libs/nanopb/tests/regression/issue_172/submessage/submessage.options
@@ -0,0 +1 @@
+submessage.data max_size: 16
diff --git a/libs/nanopb/tests/regression/issue_172/submessage/submessage.proto b/libs/nanopb/tests/regression/issue_172/submessage/submessage.proto
new file mode 100644
index 00000000..ce6804af
--- /dev/null
+++ b/libs/nanopb/tests/regression/issue_172/submessage/submessage.proto
@@ -0,0 +1,4 @@
+syntax = "proto2";
+message submessage {
+ required bytes data = 1;
+}
diff --git a/libs/nanopb/tests/regression/issue_172/test.proto b/libs/nanopb/tests/regression/issue_172/test.proto
new file mode 100644
index 00000000..fbd97be5
--- /dev/null
+++ b/libs/nanopb/tests/regression/issue_172/test.proto
@@ -0,0 +1,6 @@
+syntax = "proto2";
+import "submessage.proto";
+
+message testmessage {
+ optional submessage sub = 1;
+}