| 1 |
/* |
| 2 |
* This file is part of the flashrom project. |
| 3 |
* |
| 4 |
* Copyright 2020 Google LLC |
| 5 |
* |
| 6 |
* This program is free software; you can redistribute it and/or modify |
| 7 |
* it under the terms of the GNU General Public License as published by |
| 8 |
* the Free Software Foundation; version 2 of the License. |
| 9 |
* |
| 10 |
* This program is distributed in the hope that it will be useful, |
| 11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
* GNU General Public License for more details. |
| 14 |
*/ |
| 15 |
|
| 16 |
#ifndef _TESTS_TEST_H |
| 17 |
#define _TESTS_TEST_H |
| 18 |
|
| 19 |
/* |
| 20 |
* Standard test header that should be included in all tests. For now it just encapsulates the |
| 21 |
* include dependencies for Cmocka. Test-specific APIs that are so generic we would want them |
| 22 |
* available everywhere could also be added here. |
| 23 |
*/ |
| 24 |
|
| 25 |
#include <stdarg.h> |
| 26 |
#include <stddef.h> |
| 27 |
#include <setjmp.h> |
| 28 |
#include <cmocka.h> |
| 29 |
|
| 30 |
#define NON_ZERO (0xf000baaa) |
| 31 |
|
| 32 |
#define MOCK_FD (0x10ec) |
| 33 |
|
| 34 |
#define SKIP_TEST(name) \ |
| 35 |
void name (void **state) { skip(); } |
| 36 |
|
| 37 |
/* |
| 38 |
* Having this as function allows to set a breakpoint on the address, |
| 39 |
* as it has a named symbol associated with the address number. |
| 40 |
*/ |
| 41 |
void *not_null(void); |
| 42 |
|
| 43 |
#define LOG_ME printf("%s is called\n", __func__) |
| 44 |
|
| 45 |
#endif /* _TESTS_TEST_H */ |