56 #include <sys/resource.h>
90 assert_ptr_not_equal(key_part, NULL);
92 assert_ptr_equal(key_part->
lit.
llist, NULL);
93 assert_string_equal(key_part->
data.s,
"the");
95 assert_ptr_equal(key_part, NULL);
98 assert_ptr_not_equal(key_part_const, NULL);
100 assert_ptr_not_equal(key_part_const->
lit.
llist, NULL);
101 assert_string_equal(key_part_const->
data.s,
"in");
104 assert_ptr_equal(key_part, NULL);
108 assert_ptr_equal(key_part, NULL);
133 assert_ptr_not_equal(key_part_copy, NULL);
137 assert_ptr_equal(key_part->
lit.
llist, NULL);
140 assert_ptr_not_equal(key_part_copy, NULL);
141 assert_ptr_not_equal(key_part_copy, key_part);
153 assert_ptr_not_equal(key_part_const, NULL);
155 assert_string_equal(key_part_const->
data.s,
"some text");
194 assert_int_equal(key_part->
data.ui64, 123);
234 assert_ptr_not_equal(key_part, NULL);
236 assert_string_equal(key_part->
data.s,
"some text");
240 assert_ptr_not_equal(key_part_const, NULL);
242 assert_string_equal(key_part_const->
data.s,
"some text");
252 assert_int_equal(key_part->
data.ui64, 123);
Ambiorix variant API header file.
#define cstring_t
Convenience macro.
size_t amxc_llist_size(const amxc_llist_t *const llist)
Calculates the size of the linked list.
#define AMXC_VAR_FLAG_DEFAULT
The default flag, do not copy, use variant as is.
#define AMXC_VAR_FLAG_COPY
Copy the variant, creates a new variant, leaves the source variant untouched.
#define AMXC_VAR_FLAG_UPDATE
Replaces the value of the variant, leaves the source variant untouched.
#define AMXC_VAR_ID_CSTRING
C-string variant id (aka char *), null terminated string.
#define AMXC_VAR_ID_UINT64
Unsigned 64 bit integer variant id.
#define AMXC_VAR_ID_BOOL
Boolean variant id.
#define AMXC_VAR_ID_LIST
Ambiorix Linked List variant id.
uint32_t amxc_var_type_of(const amxc_var_t *const var)
Gets the variant type id of a variant.
int amxc_var_set_type(amxc_var_t *const var, const uint32_t type)
Change the variant data type.
amxc_var_t * amxc_var_get_key(const amxc_var_t *const var, const char *const key, const int flags)
Get a reference to a part of composed variant using a key.
int amxc_var_set_index(amxc_var_t *const var, const int64_t index, amxc_var_t *data, const int flags)
Set a part of composed variant using an index.
int amxc_var_new(amxc_var_t **var)
Allocates a variant and initializes it to the null variant type.
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.
void amxc_var_delete(amxc_var_t **var)
Frees the previously allocated variant.
int amxc_var_set_key(amxc_var_t *const var, const char *const key, amxc_var_t *data, const int flags)
Sets a part of composed variant using a key.
amxc_var_t * amxc_var_get_index(const amxc_var_t *const var, const int64_t index, const int flags)
Get a reference to a part of composed variant using an index.
#define amxc_var_set(type, var, data)
Convenience macro for setting a value in a variant.
int amxc_var_convert(amxc_var_t *const dest, const amxc_var_t *src, const uint32_t type_id)
Converts one variant (source) to another variant(destination) using the specified variant type id.
struct _amxc_llist * llist
The variant struct definition.
void test_variant_llist_get_index(UNUSED void **state)
void test_variant_llist_set_index(UNUSED void **state)
void test_variant_llist_set_key(UNUSED void **state)