Update unit tests: inverted selection

after correcting update_trigger double write
pull/573/head
Daniele Lacamera 2025-06-30 13:33:36 +02:00
parent d14045aee6
commit 9e8ed9029e
2 changed files with 7 additions and 6 deletions

View File

@ -27,6 +27,7 @@
#define MOCK_ADDRESS_SWAP 0xCE000000
const char ENCRYPT_KEY[] = "0123456789abcdef0123456789abcdef0123456789abcdef";
#include <stdio.h>
#include "image.h"
#include "encrypt.h"
#include "libwolfboot.c"
#include <fcntl.h>
@ -274,10 +275,10 @@ START_TEST (test_nvm_update_with_encryption)
/* Triggering update to set flags */
wolfBoot_update_trigger();
/* Current selected should now be 0 */
/* Current selected should now be 1 */
ret = nvm_select_fresh_sector(PART_UPDATE);
ck_assert_msg(ret == 0, "Failed to select updating fresh sector\n");
ck_assert_msg(erased_nvm_bank1 != 0, "Did not erase the non-selected bank");
ck_assert_msg(ret == 1, "Failed to select updating fresh sector\n");
ck_assert_msg(erased_nvm_bank0 != 0, "Did not erase the non-selected bank");
magic = get_partition_magic(PART_UPDATE);
ck_assert_msg(*magic == *boot_word,

View File

@ -269,10 +269,10 @@ START_TEST (test_nvm_select_fresh_sector)
/* Triggering update to set flags */
wolfBoot_update_trigger();
/* Current selected should now be 0 */
/* Current selected should now be 1 */
ret = nvm_select_fresh_sector(PART_UPDATE);
ck_assert_msg(ret == 0, "Failed to select updating fresh sector\n");
ck_assert_msg(erased_nvm_bank1 > 0, "Did not erase the non-selected bank");
ck_assert_msg(ret == 1, "Failed to select updating fresh sector\n");
ck_assert_msg(erased_nvm_bank0 > 0, "Did not erase the non-selected bank");
magic = get_partition_magic(PART_UPDATE);
ck_assert_msg(*magic == *boot_word,