97 assert_int_equal(
GET_INT32(part, NULL), 100);
102 assert_string_equal(
GET_CHAR(part, NULL),
"yes");
103 assert_string_equal(
GETP_CHAR(part, NULL),
"yes");
107 assert_int_equal(
GETP_INT32(part, NULL), 100);
108 assert_int_equal(
GET_UINT32(part, NULL), 100);
109 assert_int_equal(
GET_INT32(part, NULL), 100);
114 assert_string_equal(
GET_CHAR(part, NULL),
"yes");
115 assert_string_equal(
GETP_CHAR(part, NULL),
"yes");
133 assert_non_null(key);
134 printf(
"%s = ", key);
140 assert_int_equal(count, 4);
147 assert_non_null(key);
148 printf(
"%s = ", key);
154 assert_int_equal(count, 4);
178 assert_int_equal(count, 4);
191 assert_int_equal(count, 4);
209 assert_int_equal(count, 0);
213 assert_non_null(key);
214 printf(
"%s = ", key);
220 assert_int_equal(count, 0);
Ambiorix variant API header file.
#define cstring_t
Convenience macro.
#define AMXC_VAR_ID_CSTRING
C-string variant id (aka char *), null terminated string.
#define AMXC_VAR_ID_LIST
Ambiorix Linked List variant id.
#define AMXC_VAR_ID_HTABLE
Ambiorix Hash Table variant id.
#define GET_INT32(a, n)
Convenience macro for getting a int32_t out of a composite variant by key.
#define GETP_INT32(a, p)
Convenience macro for getting a int32 out of a composite variant by path.
#define GETP_BOOL(a, p)
Convenience macro for getting a bool out of a composite variant by path.
int amxc_var_dump(const amxc_var_t *const var, int fd)
Dumps the content of the variant in a human readable manner.
#define GET_CHAR(a, n)
Convenience macro for getting a char* out of a composite variant by key.
#define GET_BOOL(a, n)
Convenience macro for getting a bool out of a composite variant by key.
#define GETP_CHAR(a, p)
Convenience macro for getting a string out of a composite variant by path.
#define GETP_UINT32(a, p)
Convenience macro for getting a uint32 out of a composite variant by path.
#define GETP_ARG(a, p)
Convenience macro for getting variant out of a composite variant by path.
#define GET_UINT32(a, n)
Convenience macro for getting a uint32_t out of a composite variant by key.
#define amxc_var_add_key(type, var, key, data)
Convenience macro for adding a variant to composite variant type.
#define amxc_var_add(type, var, data)
Convenience macro for adding a variant to composite variant type.
int amxc_var_set_type(amxc_var_t *const var, const uint32_t type)
Change the variant data type.
#define amxc_var_for_each_reverse(var, var_list)
When the variant is a htable or list variant, iterates over the variants in reverse order.
const char * amxc_var_key(const amxc_var_t *const var)
Gets the key, with which the variant is stored in a htable variant.
int amxc_var_init(amxc_var_t *const var)
Initializes a variant.
void amxc_var_clean(amxc_var_t *const var)
Clean-up and reset variant.
amxc_var_t * amxc_var_get_parent(const amxc_var_t *const var)
Gets the containing variant.
#define amxc_var_for_each(var, var_list)
When the variant is a htable or list variant, iterates over the variants in the htable or list.
The hash table structure.
The linked list structure.
The variant struct definition.
void test_amxc_var_for_each_htable(UNUSED void **state)
void test_amxc_var_for_each_list(UNUSED void **state)
void test_amxc_var_get_macros(UNUSED void **state)
void test_amxc_var_for_each_non_composite(UNUSED void **state)