Commit 8b1ce3a6 authored by Marko Kiiskila's avatar Marko Kiiskila Committed by mkiiskila
Browse files

boot_serial; re-enable mynewt boot_serial unittests.

Signed-off-by: default avatarMarko Kiiskila <marko@runtime.io>
parent c427af2e
Loading
Loading
Loading
Loading
+1 −1
Changes for boot/boot_serial/src/boot_serial.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@
#endif
static char in_buf[BOOT_SERIAL_INPUT_MAX + 1];
static char dec_buf[BOOT_SERIAL_INPUT_MAX + 1];
static const struct boot_uart_funcs *boot_uf;
const struct boot_uart_funcs *boot_uf;
static uint32_t curr_off;
static uint32_t img_size;
static struct nmgr_hdr *bs_hdr;
+1
Changes for boot/boot_serial/src/boot_serial_priv.h: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -63,6 +63,7 @@ struct nmgr_hdr {
#define IMGMGR_NMGR_ID_UPLOAD           1

void boot_serial_input(char *buf, int len);
extern const struct boot_uart_funcs *boot_uf;

#ifdef __cplusplus
}
+11
Changes for boot/boot_serial/test/src/boot_test.c: 11 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
#include "hal/hal_flash.h"
#include "flash_map_backend/flash_map_backend.h"

#include "boot_serial/boot_serial.h"
#include "boot_serial_priv.h"

TEST_CASE_DECL(boot_serial_setup)
@@ -39,6 +40,15 @@ TEST_CASE_DECL(boot_serial_empty_img_msg)
TEST_CASE_DECL(boot_serial_img_msg)
TEST_CASE_DECL(boot_serial_upload_bigger_image)

static void
test_uart_write(const char *str, int len)
{
}

static const struct boot_uart_funcs test_uart = {
    .write = test_uart_write
};

void
tx_msg(void *src, int len)
{
@@ -57,6 +67,7 @@ TEST_SUITE(boot_serial_suite)
int
boot_serial_test(void)
{
    boot_uf = &test_uart;
    boot_serial_suite();
    return tu_any_failed;
}
−2
Changes for boot/boot_serial/test/src/testcases/boot_serial_empty_msg.c: 0 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -23,8 +23,6 @@ TEST_CASE(boot_serial_empty_msg)
    char buf[4];
    struct nmgr_hdr hdr;

    boot_serial_input(buf, 0);

    tx_msg(buf, 0);

    strcpy(buf, "--");