From 32e25cbca210a359b09768537b6f443fe90a3070 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Tue, 20 Jun 2017 10:24:05 +0000 Subject: Separation Generator to a dedicated repo Change-Id: Id94831651c3266861435272a6e36c7884bef2c45 Signed-off-by: Romain Forlot --- .../nanopb/tests/regression/issue_242/SConscript | 13 ------ .../nanopb/tests/regression/issue_242/zero_value.c | 51 ---------------------- .../tests/regression/issue_242/zero_value.proto | 15 ------- 3 files changed, 79 deletions(-) delete mode 100644 CAN-binder/libs/nanopb/tests/regression/issue_242/SConscript delete mode 100644 CAN-binder/libs/nanopb/tests/regression/issue_242/zero_value.c delete mode 100644 CAN-binder/libs/nanopb/tests/regression/issue_242/zero_value.proto (limited to 'CAN-binder/libs/nanopb/tests/regression/issue_242') diff --git a/CAN-binder/libs/nanopb/tests/regression/issue_242/SConscript b/CAN-binder/libs/nanopb/tests/regression/issue_242/SConscript deleted file mode 100644 index 000063e..0000000 --- a/CAN-binder/libs/nanopb/tests/regression/issue_242/SConscript +++ /dev/null @@ -1,13 +0,0 @@ -# Regression test for Issue 242: pb_encode does not encode tag for -# extension fields that is all zeros -Import('env') - -env.NanopbProto('zero_value') - -p = env.Program(["zero_value.c", - "zero_value.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_242/zero_value.c b/CAN-binder/libs/nanopb/tests/regression/issue_242/zero_value.c deleted file mode 100644 index b3d96b7..0000000 --- a/CAN-binder/libs/nanopb/tests/regression/issue_242/zero_value.c +++ /dev/null @@ -1,51 +0,0 @@ -#include -#include -#include -#include -#include "zero_value.pb.h" - -int main() -{ - int status = 0; - - COMMENT("Test extension fields with zero values"); - { - uint8_t buffer[256] = {0}; - pb_ostream_t ostream; - int32_t value = 0; - Extendable source = {0}; - - pb_extension_t source_ext = {0}; - source_ext.type = &opt_int32; - source_ext.dest = &value; - source.extensions = &source_ext; - - ostream = pb_ostream_from_buffer(buffer, sizeof(buffer)); - TEST(pb_encode(&ostream, Extendable_fields, &source)); - - TEST(ostream.bytes_written == 2); - TEST(memcmp(buffer, "\x58\x00", 2) == 0); - } - - /* Note: There never was a bug here, but this check is included - * in the regression test because the logic is closely related. - */ - COMMENT("Test pointer fields with zero values"); - { - uint8_t buffer[256] = {0}; - pb_ostream_t ostream; - int32_t value = 0; - PointerMessage source = {0}; - - source.opt_int32 = &value; - - ostream = pb_ostream_from_buffer(buffer, sizeof(buffer)); - TEST(pb_encode(&ostream, PointerMessage_fields, &source)); - - TEST(ostream.bytes_written == 2); - TEST(memcmp(buffer, "\x58\x00", 2) == 0); - } - - return status; -} - diff --git a/CAN-binder/libs/nanopb/tests/regression/issue_242/zero_value.proto b/CAN-binder/libs/nanopb/tests/regression/issue_242/zero_value.proto deleted file mode 100644 index 020a39a..0000000 --- a/CAN-binder/libs/nanopb/tests/regression/issue_242/zero_value.proto +++ /dev/null @@ -1,15 +0,0 @@ -syntax = "proto2"; -import "nanopb.proto"; - -message Extendable { - extensions 10 to 100; -} - -extend Extendable { - optional int32 opt_int32 = 11; -} - -message PointerMessage { - optional int32 opt_int32 = 11 [(nanopb).type = FT_POINTER]; -} - -- cgit 1.2.3-korg