aboutsummaryrefslogtreecommitdiffstats
path: root/tests/mem_release/mem_release.proto
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2014-12-26 18:24:23 +0200
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2014-12-26 23:27:29 +0200
commit1515cfb5c24f64fd046c5b5f3cdfdcb153c72df7 (patch)
treea00c74d4f6ae4c8e3311697ee36f5b87b757ca1e /tests/mem_release/mem_release.proto
parent418f7d88b3f58603fe03d0060b8aaba905ca56c8 (diff)
Add testcase for releasing memory in submessages/extensions
Diffstat (limited to 'tests/mem_release/mem_release.proto')
-rw-r--r--tests/mem_release/mem_release.proto24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/mem_release/mem_release.proto b/tests/mem_release/mem_release.proto
new file mode 100644
index 00000000..0db393ae
--- /dev/null
+++ b/tests/mem_release/mem_release.proto
@@ -0,0 +1,24 @@
+syntax = "proto2";
+import "nanopb.proto";
+
+message SubMessage
+{
+ optional string dynamic_str = 1 [(nanopb).type = FT_POINTER];
+ repeated string dynamic_str_arr = 2 [(nanopb).type = FT_POINTER];
+ repeated SubMessage dynamic_submsg = 3 [(nanopb).type = FT_POINTER];
+}
+
+message TestMessage
+{
+ required SubMessage static_req_submsg = 1 [(nanopb).type = FT_STATIC];
+ optional SubMessage dynamic_submsg = 2 [(nanopb).type = FT_POINTER];
+ optional SubMessage static_opt_submsg = 3 [(nanopb).type = FT_STATIC];
+ extensions 100 to 200;
+}
+
+extend TestMessage
+{
+ optional SubMessage dynamic_ext = 100 [(nanopb).type = FT_POINTER];
+ optional SubMessage static_ext = 101 [(nanopb).type = FT_STATIC];
+}
+