Attention is currently required from: Nico Huber, Angel Pons, Anastasia Klimchuk.

Anastasia Klimchuk uploaded patch set #5 to this change.

View Change

tests: Add NON_ZERO macro and not_null function instead of MOCK_HANDLE

This patch adds NON_ZERO macro and not_null function into io_mock.h,
so that they can be used anywhere in tests. Common usage for not_null
is to indicate a valid pointer, where it doesn't matter what the
pointer is, only matters it is not null. Common usage of NON_ZERO is
to indicate a valid file descriptor, where it only matters the
descriptor is non-zero integer.

New features replace all usages of previous MOCK_HANDLE.

This patch corrects return value from __wrap_ioctl to be successful
by default. It used to be MOCK_HANDLE, but should be 0. Included in
this patch because this is also a replacement of MOCK_HANDLE.

BUG=b:181803212
TEST=builds and ninja test

Change-Id: I5ad6ee4aa9091447c6c9108c92bf7f6e755fca48
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
---
M tests/init_shutdown.c
A tests/io_mock.c
M tests/io_mock.h
M tests/meson.build
M tests/tests.c
5 files changed, 41 insertions(+), 13 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/69/57269/5

To view, visit change 57269. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I5ad6ee4aa9091447c6c9108c92bf7f6e755fca48
Gerrit-Change-Number: 57269
Gerrit-PatchSet: 5
Gerrit-Owner: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter@mailbox.org>
Gerrit-Attention: Nico Huber <nico.h@gmx.de>
Gerrit-Attention: Angel Pons <th3fanbus@gmail.com>
Gerrit-Attention: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-MessageType: newpatchset