diff options
author | 2017-05-02 18:29:37 +0200 | |
---|---|---|
committer | 2017-05-02 18:29:37 +0200 | |
commit | b9e1b4435a406a8a27c078ea05dee1240e51704a (patch) | |
tree | 3bd5e75d001d0c1d57710c47375af5c8ba84c26c /CAN-binder/libs/nanopb/tests/regression/issue_229/multiple_oneof.c | |
parent | 0242c26c2f5dc96387bca7efb118364c800f4ee7 (diff) |
Added external libraries from openXC CMake files.
Now libraries are cleanly included and built.
Change-Id: Iaa85639578b55b2da8357bc438426403e2cca8de
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'CAN-binder/libs/nanopb/tests/regression/issue_229/multiple_oneof.c')
-rw-r--r-- | CAN-binder/libs/nanopb/tests/regression/issue_229/multiple_oneof.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/CAN-binder/libs/nanopb/tests/regression/issue_229/multiple_oneof.c b/CAN-binder/libs/nanopb/tests/regression/issue_229/multiple_oneof.c deleted file mode 100644 index 902248d0..00000000 --- a/CAN-binder/libs/nanopb/tests/regression/issue_229/multiple_oneof.c +++ /dev/null @@ -1,35 +0,0 @@ -#include "multiple_oneof.pb.h" -#include <unittests.h> -#include <pb_encode.h> -#include <pb_decode.h> - -int main() -{ - int status = 0; - uint8_t buf[128]; - size_t msglen; - - { - pb_ostream_t stream = pb_ostream_from_buffer(buf, sizeof(buf)); - MainMessage msg = MainMessage_init_zero; - msg.which_oneof1 = MainMessage_oneof1_uint32_tag; - msg.oneof1.oneof1_uint32 = 1234; - msg.which_oneof2 = MainMessage_oneof2_uint32_tag; - msg.oneof2.oneof2_uint32 = 5678; - TEST(pb_encode(&stream, MainMessage_fields, &msg)); - msglen = stream.bytes_written; - } - - { - pb_istream_t stream = pb_istream_from_buffer(buf, msglen); - MainMessage msg = MainMessage_init_zero; - TEST(pb_decode(&stream, MainMessage_fields, &msg)); - TEST(msg.which_oneof1 == MainMessage_oneof1_uint32_tag); - TEST(msg.oneof1.oneof1_uint32 == 1234); - TEST(msg.which_oneof2 == MainMessage_oneof2_uint32_tag); - TEST(msg.oneof2.oneof2_uint32 == 5678); - } - - return status; -} - |