Anastasia Klimchuk has uploaded this change for review.

View Change

tests: Use MOCK_FD instead of NON_ZERO for file operations

NON_ZERO can be a negative number, so MOCK_FD is safer option to
use as a mock file descriptor. Also it is more readable.

Change-Id: I097dd59f69c3fb532ac136796fcf5cae8839af7b
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
---
M tests/tests.c
1 file changed, 15 insertions(+), 2 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/10/67310/1
diff --git a/tests/tests.c b/tests/tests.c
index 2994c02..f6b4df1 100644
--- a/tests/tests.c
+++ b/tests/tests.c
@@ -24,7 +24,7 @@

void *not_null(void)
{
- return (void *)NON_ZERO;
+ return (void *)MOCK_FD;
}

/* Workaround for https://github.com/clibs/cmocka/issues/17 */
@@ -253,7 +253,7 @@
int __wrap_fileno(FILE *fp)
{
LOG_ME;
- return NON_ZERO;
+ return MOCK_FD;
}

int __wrap_fsync(int fd)

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

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I097dd59f69c3fb532ac136796fcf5cae8839af7b
Gerrit-Change-Number: 67310
Gerrit-PatchSet: 1
Gerrit-Owner: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-MessageType: newchange