Commit 30151a33 authored by Christopher Collins's avatar Christopher Collins Committed by ccollins476ad
Browse files

Mynewt: Fix boot_serial unit tests

These unit tests were failing with build errors such as this:

    boot/boot_serial/test/src/testcases/boot_serial_img_msg.c:64:26: error: use of undeclared identifier 'FLASH_AREA_IMAGE_PRIMARY'
        rc = flash_area_open(FLASH_AREA_IMAGE_PRIMARY, &fap);
                             ^
The `FLASH_AREA_IMAGE_{PRIMARY,SECONDARY} definitions were not visible
because `MCUBOOT_MYNEWT` was not getting defined in the boot_serial
unit test package.

This commit defines `MCUBOOT_MYNEWT` in the boot_serial unit test
package, and adds the necessary include to pull in the PRIMARY /
SECONDARY definitions.

Signed-off-by: default avatarChristopher Collins <ccollins@apache.org>
parent 01dfbb62
Loading
Loading
Loading
Loading
+3
Changes for boot/boot_serial/test/pkg.yml: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -30,3 +30,6 @@ pkg.deps:

pkg.deps.SELFTEST:
    - "@apache-mynewt-core/sys/console/stub"

pkg.cflags:
    - '-DMCUBOOT_MYNEWT'
+2 −1
Changes for boot/boot_serial/test/src/boot_test.h: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -33,11 +33,12 @@
#include "testutil/testutil.h"
#include "hal/hal_flash.h"
#include "flash_map_backend/flash_map_backend.h"
#include "bootutil/bootutil.h"

#include "boot_serial_priv.h"

#ifdef __cplusplus
#extern "C" {
extern "C" {
#endif

void tx_msg(void *src, int len);