diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-06-20 10:24:05 +0000 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-06-20 10:24:05 +0000 |
commit | 32e25cbca210a359b09768537b6f443fe90a3070 (patch) | |
tree | 3309794c15d8a8f8e9c1c08cad072ee1378813ba /CAN-binder/libs/nanopb/tests/regression/issue_256 | |
parent | 76c43dec62b2e21cd6446360c00d4fe6b437533f (diff) |
Separation Generator to a dedicated repo
Change-Id: Id94831651c3266861435272a6e36c7884bef2c45
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'CAN-binder/libs/nanopb/tests/regression/issue_256')
3 files changed, 0 insertions, 65 deletions
diff --git a/CAN-binder/libs/nanopb/tests/regression/issue_256/SConscript b/CAN-binder/libs/nanopb/tests/regression/issue_256/SConscript deleted file mode 100644 index b2c3e864..00000000 --- a/CAN-binder/libs/nanopb/tests/regression/issue_256/SConscript +++ /dev/null @@ -1,16 +0,0 @@ -# Regression test for Issue 256: Proto3 mode skips submessages even when -# later array fields have non-zero value - -Import('env') - -env.NanopbProto('submsg_array') - -p = env.Program(['submsg_array.c', - 'submsg_array.pb.c', - "$COMMON/pb_decode.o", - "$COMMON/pb_encode.o", - "$COMMON/pb_common.o"]) - -env.RunTest(p) - - diff --git a/CAN-binder/libs/nanopb/tests/regression/issue_256/submsg_array.c b/CAN-binder/libs/nanopb/tests/regression/issue_256/submsg_array.c deleted file mode 100644 index c63bd30a..00000000 --- a/CAN-binder/libs/nanopb/tests/regression/issue_256/submsg_array.c +++ /dev/null @@ -1,38 +0,0 @@ -#include <unittests.h> -#include <pb_encode.h> -#include <pb_decode.h> -#include "submsg_array.pb.h" - -int main() -{ - int status = 0; - - COMMENT("Test encoding for submessage with array"); - { - uint8_t buffer[TestMessage_size] = {0}; - pb_ostream_t ostream = pb_ostream_from_buffer(buffer, TestMessage_size); - TestMessage msg = TestMessage_init_zero; - - msg.submsg.rep_uint32_count = 3; - msg.submsg.rep_uint32[0] = 0; - msg.submsg.rep_uint32[1] = 1; - msg.submsg.rep_uint32[2] = 2; - - TEST(pb_encode(&ostream, TestMessage_fields, &msg)); - TEST(ostream.bytes_written > 0); - - { - pb_istream_t istream = pb_istream_from_buffer(buffer, ostream.bytes_written); - TestMessage msg2 = TestMessage_init_zero; - - TEST(pb_decode(&istream, TestMessage_fields, &msg2)); - TEST(msg2.submsg.rep_uint32_count == 3); - TEST(msg2.submsg.rep_uint32[0] == 0); - TEST(msg2.submsg.rep_uint32[1] == 1); - TEST(msg2.submsg.rep_uint32[2] == 2); - } - } - - return status; -} - diff --git a/CAN-binder/libs/nanopb/tests/regression/issue_256/submsg_array.proto b/CAN-binder/libs/nanopb/tests/regression/issue_256/submsg_array.proto deleted file mode 100644 index 4964a05f..00000000 --- a/CAN-binder/libs/nanopb/tests/regression/issue_256/submsg_array.proto +++ /dev/null @@ -1,11 +0,0 @@ -syntax = "proto3"; -import "nanopb.proto"; - -message SubMessage { - repeated uint32 rep_uint32 = 1 [(nanopb).max_count = 3]; -} - -message TestMessage { - SubMessage submsg = 1; -} - |