diff options
author | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2015-03-22 11:19:43 +0200 |
---|---|---|
committer | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2015-03-22 11:19:43 +0200 |
commit | 62a7e4ff2b3487ec259de90db9215c4ad8838dd6 (patch) | |
tree | f917ba65e32a593e28b95d6928c84e8f6e10fb0c | |
parent | 8c14e736034b82d65b43db529161dd281a37816a (diff) |
Add simple test case for message ids
-rw-r--r-- | tests/options/options.expected | 7 | ||||
-rw-r--r-- | tests/options/options.proto | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/tests/options/options.expected b/tests/options/options.expected index dbd279ba..ad74a525 100644 --- a/tests/options/options.expected +++ b/tests/options/options.expected @@ -7,4 +7,11 @@ Message5_EnumValue1 } pb_packed my_packed_struct; ! skipped_field ! SkippedMessage +#define PB_MSG_103 Message3 +#define PB_MSG_104 Message4 +#define PB_MSG_105 Message5 +#define OPTIONS_MESSAGES \\ +\s+PB_MSG\(103,[0-9]*,Message3\) \\ +\s+PB_MSG\(104,-1,Message4\) \\ +\s+PB_MSG\(105,[0-9]*,Message5\) \\ diff --git a/tests/options/options.proto b/tests/options/options.proto index cdcffeb7..b7050418 100644 --- a/tests/options/options.proto +++ b/tests/options/options.proto @@ -22,12 +22,14 @@ message Message2 // Field level options message Message3 { + option (nanopb_msgopt).msgid = 103; required string fieldsize = 1 [(nanopb).max_size = 40]; } // Forced callback field message Message4 { + option (nanopb_msgopt).msgid = 104; required int32 int32_callback = 1 [(nanopb).type = FT_CALLBACK]; } @@ -47,6 +49,7 @@ message EnumTest // Short enum names inside message message Message5 { + option (nanopb_msgopt).msgid = 105; enum Enum2 { option (nanopb_enumopt).long_names = false; |