aboutsummaryrefslogtreecommitdiffstats
path: root/tests/io_mock.h
diff options
context:
space:
mode:
authorAnastasia Klimchuk <aklm@chromium.org>2021-10-14 12:21:02 +1100
committerNico Huber <nico.h@gmx.de>2021-10-18 12:22:12 +0000
commitd23613cf6668b677264e5e02d4f4ac02873d307b (patch)
tree8ba56983251ca5e7bcfbde5aa4ff0b87f84f6fbc /tests/io_mock.h
parentf42d2f72cccdbcd454a79424fdb998842f7754d6 (diff)
downloadflashrom-d23613cf6668b677264e5e02d4f4ac02873d307b.tar.gz
flashrom-d23613cf6668b677264e5e02d4f4ac02873d307b.tar.bz2
flashrom-d23613cf6668b677264e5e02d4f4ac02873d307b.zip
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> Reviewed-on: https://review.coreboot.org/c/flashrom/+/57269 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
Diffstat (limited to 'tests/io_mock.h')
0 files changed, 0 insertions, 0 deletions