Repository: incubator-mynewt-core Updated Branches: refs/heads/develop 58a6b25db -> bf8cfee45
boot_serial; fix failing unit tests. Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/bf8cfee4 Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/bf8cfee4 Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/bf8cfee4 Branch: refs/heads/develop Commit: bf8cfee45f815f8242231d1a72fefc4014d31cfd Parents: 58a6b25 Author: Marko Kiiskila <ma...@runtime.io> Authored: Mon Oct 3 15:31:18 2016 -0700 Committer: Marko Kiiskila <ma...@runtime.io> Committed: Mon Oct 3 15:31:18 2016 -0700 ---------------------------------------------------------------------- boot/boot_serial/test/src/boot_test.c | 31 +----------------------------- 1 file changed, 1 insertion(+), 30 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/bf8cfee4/boot/boot_serial/test/src/boot_test.c ---------------------------------------------------------------------- diff --git a/boot/boot_serial/test/src/boot_test.c b/boot/boot_serial/test/src/boot_test.c index b81d38d..669e84b 100644 --- a/boot/boot_serial/test/src/boot_test.c +++ b/boot/boot_serial/test/src/boot_test.c @@ -36,36 +36,7 @@ void tx_msg(void *src, int len) { - char *msg; - char *enc; - int off; - uint16_t crc; - - crc = htons(crc16_ccitt(CRC16_INITIAL_CRC, src, len)); - - /* - * Lazy, malloc a buffer, fill it and send it. - */ - msg = malloc(len + 2 * sizeof(uint16_t)); - assert(msg); - - *(uint16_t *)msg = ntohs(len + sizeof(uint16_t)); - off = sizeof(uint16_t); - memcpy(&msg[off], src, len); - off += len; - memcpy(&msg[off], &crc, sizeof(crc)); - off += sizeof(uint16_t); - - enc = malloc(BASE64_ENCODE_SIZE(off) + 1); - assert(enc); - - off = base64_encode(msg, off, enc, 1); - assert(off > 0); - - boot_serial_input(enc, off + 1); - - free(enc); - free(msg); + boot_serial_input(src, len); } TEST_CASE(boot_serial_setup)