FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
test_vector_funcs.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: Apache-2.0
2
* Copyright(c) 2021 Cisco Systems, Inc.
3
*/
4
5
#ifndef included_test_test_h
6
#define included_test_test_h
7
8
#include <
vppinfra/cpu.h
>
9
10
typedef
clib_error_t
*(
test_fn_t
) (
clib_error_t
*);
11
12
typedef
struct
test_registration_
13
{
14
char
*
name
;
15
u8
multiarch
: 1;
16
test_fn_t
*
fn
;
17
struct
test_registration_
*
next
;
18
}
test_registration_t
;
19
20
extern
test_registration_t
*
test_registrations
[
CLIB_MARCH_TYPE_N_VARIANTS
];
21
22
#define __clib_test_fn static __clib_noinline __clib_section (".test_wrapper")
23
24
#define REGISTER_TEST(x) \
25
test_registration_t CLIB_MARCH_SFX (__test_##x); \
26
static void __clib_constructor CLIB_MARCH_SFX (__test_registration_##x) ( \
27
void) \
28
{ \
29
test_registration_t *r = &CLIB_MARCH_SFX (__test_##x); \
30
r->next = test_registrations[CLIB_MARCH_SFX (CLIB_MARCH_VARIANT_TYPE)]; \
31
test_registrations[CLIB_MARCH_SFX (CLIB_MARCH_VARIANT_TYPE)] = r; \
32
} \
33
test_registration_t CLIB_MARCH_SFX (__test_##x)
34
35
#endif
test_registration_t
struct test_registration_ test_registration_t
test_fn_t
clib_error_t *() test_fn_t(clib_error_t *)
Definition:
test_vector_funcs.h:10
test_registration_::name
char * name
Definition:
test_vector_funcs.h:14
test_registration_::fn
test_fn_t * fn
Definition:
test_vector_funcs.h:16
cpu.h
CLIB_MARCH_TYPE_N_VARIANTS
@ CLIB_MARCH_TYPE_N_VARIANTS
Definition:
cpu.h:45
test_registration_::next
struct test_registration_ * next
Definition:
test_vector_funcs.h:17
test_registration_
Definition:
test_vector_funcs.h:12
test_registrations
test_registration_t * test_registrations[CLIB_MARCH_TYPE_N_VARIANTS]
u8
unsigned char u8
Definition:
types.h:56
clib_error_t
Definition:
clib_error.h:21
test_registration_::multiarch
u8 multiarch
Definition:
test_vector_funcs.h:15
src
vppinfra
test_vector_funcs.h
Generated on Sat Jan 8 2022 10:05:49 for FD.io VPP by
1.8.17