mirror of
https://review.coreboot.org/flashrom.git
synced 2025-07-02 14:33:18 +02:00
tests: Add unit test for initialisation with NULL programmer param
Programmer param can be NULL and this is a valid case which can be covered by unit test. `run_lifecycle` needs an adjustment to handle NULL as programmer param, which is also included in the patch. Change-Id: I409f1c9ac832943e54107f7cf8652d1f46ac67df Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/67642 Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Felix Singer <felixsinger@posteo.net> Reviewed-by: Thomas Heijligen <src@posteo.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:

committed by
Edward O'Callaghan

parent
5d05a2811e
commit
5363f35fa0
@ -39,7 +39,8 @@ static void run_lifecycle(void **state, const struct io_mock *io, const struct p
|
||||
io_mock_register(io);
|
||||
|
||||
struct flashrom_programmer *flashprog;
|
||||
char *param_dup = strdup(param);
|
||||
|
||||
char *param_dup = param ? strdup(param) : NULL;
|
||||
|
||||
printf("Testing flashrom_programmer_init for programmer=%s ...\n", prog->name);
|
||||
assert_int_equal(0, flashrom_programmer_init(&flashprog, prog->name, param_dup));
|
||||
|
Reference in New Issue
Block a user