summaryrefslogtreecommitdiffstats
path: root/tests/chip.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/chip.c')
-rw-r--r--tests/chip.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/chip.c b/tests/chip.c
index 6f0317264..284b7e400 100644
--- a/tests/chip.c
+++ b/tests/chip.c
@@ -146,12 +146,14 @@ static void teardown(struct flashrom_layout **layout)
io_mock_register(NULL);
}
+extern write_func_t *g_test_write_injector;
+
static const struct flashchip chip_8MiB = {
.vendor = "aklm",
.total_size = MOCK_CHIP_SIZE / KiB,
.tested = TEST_OK_PREW,
.read = read_chip,
- .write = write_chip,
+ .write = TEST_WRITE_INJECTOR,
.unlock = unlock_chip,
.block_erasers =
{{
@@ -167,7 +169,7 @@ static const struct flashchip chip_W25Q128_V = {
.total_size = 16 * 1024,
.tested = TEST_OK_PREW,
.read = spi_chip_read,
- .write = spi_chip_write_256,
+ .write = SPI_CHIP_WRITE256,
.unlock = spi_disable_blockprotect,
.page_size = 256,
.block_erasers =
@@ -203,6 +205,7 @@ void erase_chip_test_success(void **state)
.fallback_open_state = &data,
};
+ g_test_write_injector = write_chip;
struct flashrom_flashctx flashctx = { 0 };
struct flashrom_layout *layout;
struct flashchip mock_chip = chip_8MiB;
@@ -261,6 +264,7 @@ void read_chip_test_success(void **state)
.fallback_open_state = &data,
};
+ g_test_write_injector = write_chip;
struct flashrom_flashctx flashctx = { 0 };
struct flashrom_layout *layout;
struct flashchip mock_chip = chip_8MiB;
@@ -332,6 +336,7 @@ void write_chip_test_success(void **state)
.fallback_open_state = &data,
};
+ g_test_write_injector = write_chip;
struct flashrom_flashctx flashctx = { 0 };
struct flashrom_layout *layout;
struct flashchip mock_chip = chip_8MiB;
@@ -429,6 +434,7 @@ void verify_chip_test_success(void **state)
.fallback_open_state = &data,
};
+ g_test_write_injector = write_chip;
struct flashrom_flashctx flashctx = { 0 };
struct flashrom_layout *layout;
struct flashchip mock_chip = chip_8MiB;