mirror of
https://review.coreboot.org/flashrom.git
synced 2025-07-02 14:33:18 +02:00
tests: Unit tests for erase function selection algo
The test checks that algorithm for erase functions selection works and there are no regressions. Specifically, test contains an array of test cases. Each case initialises a given initial state of the memory for the mock chip, and layout regions on the chip, and then performs erase and write operations. At the end of operation, test asserts the following: - the state of mock chip memory is as expected, i.e. properly erased or written - erase blocks are invoked in expected order and expected number of them - chip operation (erase or write) returned 0. Change-Id: I8f3fdefb76e71f6f8dc295d9dead5f38642aace7 Signed-off-by: Anastasia Klimchuk <aklm@flashrom.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/67535 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Peter Marheine <pmarheine@chromium.org>
This commit is contained in:
@ -17,6 +17,7 @@
|
||||
#define TESTS_H
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <include/test.h>
|
||||
|
||||
/* helpers.c */
|
||||
void address_to_bits_test_success(void **state);
|
||||
@ -104,4 +105,9 @@ void selfcheck_flashchips_table(void **state);
|
||||
void selfcheck_eraseblocks(void **state);
|
||||
void selfcheck_board_matches_table(void **state);
|
||||
|
||||
/* erase_func_algo.c */
|
||||
struct CMUnitTest *get_erase_func_algo_tests(size_t *num_tests);
|
||||
void erase_function_algo_test_success(void **state);
|
||||
void write_function_algo_test_success(void **state);
|
||||
|
||||
#endif /* TESTS_H */
|
||||
|
Reference in New Issue
Block a user