_test
#define EDD_DEVICE_ATTR(_name,_mode,_show,_test) \
.test = _test, \
#define check(_retval, _expected, str, _test) \
KUNIT_FAIL(_test, "Sanity check failed: " str \
#define IIO_TEST_FORMAT_EXPECT_EQ(_test, _buf, _ret, _val) do { \
KUNIT_EXPECT_EQ(_test, strlen(_buf), _ret); \
KUNIT_EXPECT_STREQ(_test, (_buf), (_val)); \
static const u32 _test[] = {
for (pat = 0; pat < ARRAY_SIZE(_test); pat++) {
wr32(reg, (_test[pat] & write));
if (val != (_test[pat] & write & mask)) {
reg, val, (_test[pat] & write & mask));
#define drm_kunit_helper_alloc_drm_device_with_driver(_test, _dev, _type, _member, _drv) \
((_type *)__drm_kunit_helper_alloc_drm_device_with_driver(_test, _dev, \
#define drm_kunit_helper_alloc_drm_device(_test, _dev, _type, _member, _feat) \
((_type *)__drm_kunit_helper_alloc_drm_device(_test, _dev, \
struct kunit *_test = (test); \
_test->params_array.params = _params_ptr; \
_test->params_array.num_params = (param_count); \
_test->params_array.elem_size = sizeof(*_params_ptr); \
_test->params_array.get_description = (get_desc); \
_test(test, __FILE__, __LINE__, fn, &expect_val, test_buffer, "%" scan_fmt, 1, &result);\
_test(struct kunit *test, const char *file, const int line, check_fn fn, const void *check_data,
_test(test, __FILE__, __LINE__, fn, check_data, string, fmt, 8, \
_test(test, __FILE__, __LINE__, fn, &expect, str, scan_fmt, n_args, &result[0], &result[1]);\
#define mtype_test IPSET_TOKEN(MTYPE, _test)
#define mtype_test IPSET_TOKEN(MTYPE, _test)
int x##_test(void) \
EXPORT_SYMBOL(x##_test)
int x##_test(void) \
EXPORT_SYMBOL(x##_test)
int _test(struct __sk_buff *skb)
static int test_start_subtest(const struct _test *t, struct sockmap_options *o)
struct _test test[] = {
static int check_whitelist(struct _test *t, struct sockmap_options *opt)
static int check_blacklist(struct _test *t, struct sockmap_options *opt)
struct _test t = test[i];
#define _CHECK(_test) _CHECK_##_test
#define _PREPARE(_test) _PREPARE_##_test