#include <stdlib.h>
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <fcntl.h>
#include <unistd.h>
#include <signal.h>
#include <cmocka.h>
#include <amxc/amxc.h>
#include <amxp/amxp_signal.h>
#include <amxp/amxp_slot.h>
#include <amxd/amxd_dm.h>
#include <amxd/amxd_object.h>
#include "test_amxd_dm.h"
#include <amxc/amxc_macros.h>
Go to the source code of this file.
◆ test_amxd_dm_add_root_object()
void test_amxd_dm_add_root_object |
( |
UNUSED void ** |
state | ) |
|
Definition at line 118 of file test_amxd_dm.c.
124 assert_ptr_not_equal(
object, NULL);
amxd_status_t amxd_dm_add_root_object(amxd_dm_t *const dm, amxd_object_t *const object)
Adds an object to the root of the data model.
amxd_status_t amxd_dm_init(amxd_dm_t *dm)
Initializes a data model structure.
void amxd_dm_clean(amxd_dm_t *dm)
Cleans a data model structure.
amxd_status_t amxd_object_new(amxd_object_t **object, const amxd_object_type_t type, const char *name)
Data model object constructor function.
void amxd_object_delete(amxd_object_t **object)
Invokes the destroy handler(s) of the object.
◆ test_amxd_dm_error_string()
void test_amxd_dm_error_string |
( |
UNUSED void ** |
state | ) |
|
Definition at line 182 of file test_amxd_dm.c.
const char * amxd_status_string(const amxd_status_t status)
@ amxd_status_invalid_action
◆ test_amxd_dm_get_root()
void test_amxd_dm_get_root |
( |
UNUSED void ** |
state | ) |
|
Definition at line 109 of file test_amxd_dm.c.
amxd_object_t * amxd_dm_get_root(amxd_dm_t *const dm)
Fetches the root object of the data model.
◆ test_amxd_dm_init_clean()
void test_amxd_dm_init_clean |
( |
UNUSED void ** |
state | ) |
|
◆ test_amxd_dm_new_delete()
void test_amxd_dm_new_delete |
( |
UNUSED void ** |
state | ) |
|
Definition at line 96 of file test_amxd_dm.c.
102 assert_ptr_equal(
dm, NULL);
amxd_status_t amxd_dm_new(amxd_dm_t **dm)
Instantiate a new data model.
void amxd_dm_delete(amxd_dm_t **dm)
Deletes a data model structure.
◆ test_amxd_dm_remove_root_object()
void test_amxd_dm_remove_root_object |
( |
UNUSED void ** |
state | ) |
|
Definition at line 140 of file test_amxd_dm.c.
146 assert_ptr_not_equal(
object, NULL);
amxd_status_t amxd_dm_remove_root_object(amxd_dm_t *const dm, const char *name)
Removes an object from the root of the data model.
◆ test_amxd_dm_root_object_signals()
void test_amxd_dm_root_object_signals |
( |
UNUSED void ** |
state | ) |
|
Definition at line 162 of file test_amxd_dm.c.
174 assert_int_equal(amxp_signal_read(), 0);
amxp_signal_mngr_t sigmngr
static const char * expected_signal
static void test_amxd_root_signals(const char *const sig_name, const amxc_var_t *const data, UNUSED void *const priv)
◆ test_amxd_root_signals()
static void test_amxd_root_signals |
( |
const char *const |
sig_name, |
|
|
const amxc_var_t *const |
data, |
|
|
UNUSED void *const |
priv |
|
) |
| |
|
static |
Definition at line 78 of file test_amxd_dm.c.
81 amxc_var_t* object_path = NULL;
83 object_path = amxc_var_get_key(data,
"object", AMXC_VAR_FLAG_DEFAULT);
84 assert_string_equal(amxc_var_constcast(cstring_t, object_path),
"test_object");
◆ dm
◆ expected_signal
const char* expected_signal = NULL |
|
static |