diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-05-02 18:29:37 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-05-02 18:29:37 +0200 |
commit | b9e1b4435a406a8a27c078ea05dee1240e51704a (patch) | |
tree | 3bd5e75d001d0c1d57710c47375af5c8ba84c26c /CAN-binder/libs/nanopb/tests/regression/issue_166 | |
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_166')
3 files changed, 0 insertions, 74 deletions
diff --git a/CAN-binder/libs/nanopb/tests/regression/issue_166/SConscript b/CAN-binder/libs/nanopb/tests/regression/issue_166/SConscript deleted file mode 100644 index c50b9193..00000000 --- a/CAN-binder/libs/nanopb/tests/regression/issue_166/SConscript +++ /dev/null @@ -1,13 +0,0 @@ -# Verify that the maximum encoded size is calculated properly -# for enums. - -Import('env') - -env.NanopbProto('enums') - -p = env.Program(["enum_encoded_size.c", - "enums.pb.c", - "$COMMON/pb_encode.o", - "$COMMON/pb_common.o"]) -env.RunTest(p) - diff --git a/CAN-binder/libs/nanopb/tests/regression/issue_166/enum_encoded_size.c b/CAN-binder/libs/nanopb/tests/regression/issue_166/enum_encoded_size.c deleted file mode 100644 index 84e1c7de..00000000 --- a/CAN-binder/libs/nanopb/tests/regression/issue_166/enum_encoded_size.c +++ /dev/null @@ -1,43 +0,0 @@ -#include <stdio.h> -#include <string.h> -#include <pb_encode.h> -#include "unittests.h" -#include "enums.pb.h" - -int main() -{ - int status = 0; - - uint8_t buf[256]; - SignedMsg msg1; - UnsignedMsg msg2; - pb_ostream_t s; - - { - COMMENT("Test negative value of signed enum"); - /* Negative value should take up the maximum size */ - msg1.value = SignedEnum_SE_MIN; - s = pb_ostream_from_buffer(buf, sizeof(buf)); - TEST(pb_encode(&s, SignedMsg_fields, &msg1)); - TEST(s.bytes_written == SignedMsg_size); - - COMMENT("Test positive value of signed enum"); - /* Positive value should be smaller */ - msg1.value = SignedEnum_SE_MAX; - s = pb_ostream_from_buffer(buf, sizeof(buf)); - TEST(pb_encode(&s, SignedMsg_fields, &msg1)); - TEST(s.bytes_written < SignedMsg_size); - } - - { - COMMENT("Test positive value of unsigned enum"); - /* This should take up the maximum size */ - msg2.value = UnsignedEnum_UE_MAX; - s = pb_ostream_from_buffer(buf, sizeof(buf)); - TEST(pb_encode(&s, UnsignedMsg_fields, &msg2)); - TEST(s.bytes_written == UnsignedMsg_size); - } - - return status; -} - diff --git a/CAN-binder/libs/nanopb/tests/regression/issue_166/enums.proto b/CAN-binder/libs/nanopb/tests/regression/issue_166/enums.proto deleted file mode 100644 index 36948044..00000000 --- a/CAN-binder/libs/nanopb/tests/regression/issue_166/enums.proto +++ /dev/null @@ -1,18 +0,0 @@ -syntax = "proto2"; - -enum SignedEnum { - SE_MIN = -1; - SE_MAX = 255; -} - -enum UnsignedEnum { - UE_MAX = 65536; -} - -message SignedMsg { - required SignedEnum value = 1; -} - -message UnsignedMsg { - required UnsignedEnum value = 1; -} |