Add testcase for releasing memory in submessages/extensions

This commit is contained in:
Petteri Aimonen
2014-12-26 18:24:23 +02:00
parent 418f7d88b3
commit 1515cfb5c2
3 changed files with 149 additions and 0 deletions

View File

@@ -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];
}