mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
1853b399b0
This will add the testnet config copyNpaste to test_utils.c, so that the test stups can set these. Alternatively, to reduce code duplication, we can move the testnet_config and mainnet_config from options.c to options.h.
29 lines
672 B
C
29 lines
672 B
C
#ifndef LIGHTNING_WALLET_TEST_TEST_UTILS_H
|
|
#define LIGHTNING_WALLET_TEST_TEST_UTILS_H
|
|
|
|
#include "lightningd/lightningd.h"
|
|
|
|
/* Definitions "inspired" by libsecp256k1 */
|
|
#define TEST_FAILURE(msg) do { \
|
|
fprintf(stderr, "%s:%d: %s\n", __FILE__, __LINE__, msg); \
|
|
return false; \
|
|
} while(0)
|
|
|
|
#ifdef HAVE_BUILTIN_EXPECT
|
|
#define EXPECT(x,c) __builtin_expect((x),(c))
|
|
#else
|
|
#define EXPECT(x,c) (x)
|
|
#endif
|
|
|
|
#define CHECK_MSG(cond,msg) do { \
|
|
if (EXPECT(!(cond), 0)) { \
|
|
TEST_FAILURE(msg); \
|
|
} \
|
|
} while(0)
|
|
|
|
#define CHECK(cond) CHECK_MSG(cond,"test condition failed");
|
|
|
|
const struct config test_config;
|
|
|
|
#endif /* LIGHTNING_WALLET_TEST_TEST_UTILS_H */
|