Anastasia Klimchuk has uploaded this change for review.

View Change

[WIP] tests: Add workaround to allow tests mock fileno on OpenBSD

Segfault in `_cmocka_run_group_tests` before any test in run

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

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/30/73830/1
diff --git a/tests/tests.c b/tests/tests.c
index d296a98..23c6abf 100644
--- a/tests/tests.c
+++ b/tests/tests.c
@@ -389,11 +389,11 @@
{
int ret = 0;

-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
/*
* Pretending to be a multithreaded environment so that `fileno`
* is called as a function (and not as a macro).
- * fileno macro in FreeBSD is expanded into inline access of
+ * fileno macro in FreeBSD and OpenBSD is expanded into inline access of
* private field of file descriptor, which is impossible to mock.
* Calling fileno as a function allows the test to mock it.
*/

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

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