Unit tests for yac_param (interpolation method config param interface)
More...
Go to the source code of this file.
|
| static int | oneof_factory (const char *name, void **obj, struct yac_param **param, int *is_default) |
| |
| static int | oneof_failing_factory (const char *name, void **obj, struct yac_param **param, int *is_default) |
| |
| static struct yac_param * | get_sub_by_name (struct yac_param *param, char const *name) |
| |
| static struct yac_param * | get_sub_by_index (struct yac_param *param, size_t idx) |
| |
| static int | default_factory (void **element_ptr, struct yac_param **param_ptr) |
| |
| static int | failing_default_factory (void **element_ptr, struct yac_param **param_ptr) |
| |
| static int | list_existing_element_get_param (void *element, struct yac_param **param_ptr) |
| |
| static struct yac_param * | dummy_sub_build_param (struct dummy_sub *dummy_sub) |
| | [icparam_example_defaults]
|
| |
| static int | dummy_sub_factory (const char *name, void **obj, struct yac_param **param, int *is_default) |
| |
| static struct yac_param * | dummy_config_get_param (struct dummy_config *cfg) |
| |
Unit tests for yac_param (interpolation method config param interface)
- Test
- Tests for yac_param.
Definition in file test_param.c.
◆ anonymous enum
◆ default_factory()
| static int default_factory |
( |
void ** | element_ptr, |
|
|
struct yac_param ** | param_ptr ) |
|
static |
◆ dummy_config_get_param()
◆ dummy_sub_build_param()
| static struct yac_param * dummy_sub_build_param |
( |
struct dummy_sub * | dummy_sub | ) |
|
|
static |
[icparam_example_defaults]
Builds the parameter struct for a given dummy_sub struct, which is the "sub" parameter in dummy_config.
- Parameters
-
| [in] | dummy_sub | The dummy_sub struct for which to build the config param struct |
- Returns
- Pointer to the config param struct for the given dummy_sub, or NULL it dummy_sub is NULL.
Definition at line 2599 of file test_param.c.
◆ dummy_sub_factory()
| static int dummy_sub_factory |
( |
const char * | name, |
|
|
void ** | obj, |
|
|
struct yac_param ** | param, |
|
|
int * | is_default ) |
|
static |
Factory for the dummy_config "sub" parameter, which is a oneof with two variants:
- DUMMY_OPTION_A: has a distance parameter "scale"
- DUMMY_OPTION_B: has a string parameter "name" The factory populates the dummy_sub struct based on the option type and returns the corresponding config param struct for the active sub variant. The factory also sets is_default to true if the default sub variant (DUMMY_OPTION_A) is active.
- Parameters
-
| [in] | name | The name of the sub variant (e.g. "option_a" or "option_b"); NULL for default |
| [in,out] | obj | Pointer to the dummy_sub pointer in dummy_config; factory allocates and sets *obj to point to the dummy_sub struct for the active variant |
| [out] | param | Pointer to the config param struct for the active sub variant, which the factory allocates and populates with the appropriate sub-parameters (e.g. "scale" for option_a, "name" for option_b) |
| [out] | is_default | Set to true if the active sub variant is the default (DUMMY_OPTION_A), false otherwise |
- Returns
- 0 on success, non-zero on failure (e.g. unknown sub variant name)
Definition at line 2678 of file test_param.c.
◆ failing_default_factory()
| static int failing_default_factory |
( |
void ** | element_ptr, |
|
|
struct yac_param ** | param_ptr ) |
|
static |
◆ get_sub_by_index()
◆ get_sub_by_name()
◆ list_existing_element_get_param()
| static int list_existing_element_get_param |
( |
void * | element, |
|
|
struct yac_param ** | param_ptr ) |
|
static |
◆ oneof_factory()
| static int oneof_factory |
( |
const char * | name, |
|
|
void ** | obj, |
|
|
struct yac_param ** | param, |
|
|
int * | is_default ) |
|
static |
◆ oneof_failing_factory()
| static int oneof_failing_factory |
( |
const char * | name, |
|
|
void ** | obj, |
|
|
struct yac_param ** | param, |
|
|
int * | is_default ) |
|
static |
◆ DUMMY_COUNT_DEFAULT
| int const DUMMY_COUNT_DEFAULT = 3 |
[icparam_example_lookup]
[icparam_example_defaults]
Definition at line 2583 of file test_param.c.
◆ DUMMY_DISTANCE_DEFAULT
| double const DUMMY_DISTANCE_DEFAULT = 1.0 * M_PI / 180.0 |
◆ DUMMY_NAME_DEFAULT
| char const* const DUMMY_NAME_DEFAULT = "default_name" |
◆ dummy_option_types
Initial value:= {
}
#define DEF_NAME_TYPE_PAIR(NAME, TYPE)
[icparam_example_struct]
[icparam_example_lookup]
Definition at line 2569 of file test_param.c.
◆ DUMMY_SCALE_DEFAULT
| double const DUMMY_SCALE_DEFAULT = 0.5 |
◆ DUMMY_SUB_DEFAULT
| int const DUMMY_SUB_DEFAULT = (int)DUMMY_OPTION_A |
|
static |
◆ list_param_default_value
| int list_param_default_value = 0 |
|
static |
◆ list_param_has_default
| int list_param_has_default = 1 |
|
static |
◆ list_param_init_value
| int list_param_init_value = 4 |
|
static |
◆ list_param_is_defined
| int list_param_is_defined = 1 |
|
static |
◆ list_param_max
◆ list_param_min
◆ list_param_name
| char const* list_param_name = "int_sub" |
|
static |
◆ oneof_bool_default
| int oneof_bool_default = 0 |
|
static |
◆ oneof_bool_has_default
| int oneof_bool_has_default = 1 |
|
static |
◆ oneof_bool_is_defined
| int oneof_bool_is_defined = 1 |
|
static |
◆ oneof_bool_param_name
| char const* oneof_bool_param_name = "bool_sub" |
|
static |
◆ oneof_bool_val
◆ oneof_default_param_name
| char const* oneof_default_param_name = "int_sub" |
|
static |
◆ oneof_has_default
| int oneof_has_default = 1 |
|
static |
◆ oneof_int_default
| int oneof_int_default = 42 |
|
static |
◆ oneof_int_max
◆ oneof_int_min
◆ oneof_int_param_name
| char const* oneof_int_param_name = "int_sub" |
|
static |
◆ oneof_int_val
◆ oneof_is_defined
◆ tol