1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-02 14:33:18 +02:00

tests: Mock the mode_t variant of open

open has a second form with a mode_t argument. When mocking without this
argument a caller trying to O_CREAT would have their mode_t argument
discarded and a random stack variable would be used instead.

BUG=b:187647884
BRANCH=None
TEST=meson test

Change-Id: I8c134e6d36a248d0f51985e389085a9e585fb83d
Signed-off-by: Evan Benn <evanbenn@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/69263
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Evan Benn
2022-11-04 16:58:53 +11:00
committed by Anastasia Klimchuk
parent 35243fdd7d
commit 67a393b88a
4 changed files with 35 additions and 17 deletions

View File

@ -16,6 +16,8 @@
#ifndef TESTS_H
#define TESTS_H
#include <fcntl.h>
/* helpers.c */
void address_to_bits_test_success(void **state);
void bitcount_test_success(void **state);