summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/chip.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/chip.c b/tests/chip.c
index 579643c78..1d9cdc9cf 100644
--- a/tests/chip.c
+++ b/tests/chip.c
@@ -148,6 +148,7 @@ static void teardown(struct flashrom_layout **layout)
extern write_func_t *g_test_write_injector;
extern read_func_t *g_test_read_injector;
+extern erasefunc_t *g_test_erase_injector;
static const struct flashchip chip_8MiB = {
.vendor = "aklm",
@@ -160,7 +161,7 @@ static const struct flashchip chip_8MiB = {
{{
/* All blocks within total size of the chip. */
.eraseblocks = { {2 * MiB, 4} },
- .block_erase = block_erase_chip,
+ .block_erase = TEST_ERASE_INJECTOR,
}},
};
@@ -208,6 +209,7 @@ void erase_chip_test_success(void **state)
g_test_write_injector = write_chip;
g_test_read_injector = read_chip;
+ g_test_erase_injector = block_erase_chip;
struct flashrom_flashctx flashctx = { 0 };
struct flashrom_layout *layout;
struct flashchip mock_chip = chip_8MiB;
@@ -268,6 +270,7 @@ void read_chip_test_success(void **state)
g_test_write_injector = write_chip;
g_test_read_injector = read_chip;
+ g_test_erase_injector = block_erase_chip;
struct flashrom_flashctx flashctx = { 0 };
struct flashrom_layout *layout;
struct flashchip mock_chip = chip_8MiB;
@@ -341,6 +344,7 @@ void write_chip_test_success(void **state)
g_test_write_injector = write_chip;
g_test_read_injector = read_chip;
+ g_test_erase_injector = block_erase_chip;
struct flashrom_flashctx flashctx = { 0 };
struct flashrom_layout *layout;
struct flashchip mock_chip = chip_8MiB;
@@ -440,6 +444,7 @@ void verify_chip_test_success(void **state)
g_test_write_injector = write_chip;
g_test_read_injector = read_chip;
+ g_test_erase_injector = block_erase_chip;
struct flashrom_flashctx flashctx = { 0 };
struct flashrom_layout *layout;
struct flashchip mock_chip = chip_8MiB;