#include <amxc/amxc_macros.h>
Go to the source code of this file.
◆ test_amxb_ubus_list_setup()
int test_amxb_ubus_list_setup |
( |
UNUSED void ** |
state | ) |
|
Definition at line 89 of file test_amxb_ubus_list.c.
92 printf(
"Ubus socket = %s\n", ubus_sock);
94 amxc_string_init(&txt, 0);
96 amxc_string_reset(&txt);
97 amxc_string_setf(&txt,
"amxrt -u ubus: -B ../mod-amxb-test-ubus.so -A ../test_data/test_nemo.odl &");
98 system(amxc_string_get(&txt, 0));
106 amxc_string_clean(&txt);
108 assert_int_equal(amxb_be_load(
"../mod-amxb-test-ubus.so"), 0);
109 assert_int_equal(amxb_connect(&
bus_ctx, ubus_sock), 0);
static const char * test_amxb_ubus_get_socket(void)
static amxb_bus_ctx_t * bus_ctx
◆ test_amxb_ubus_list_teardown()
int test_amxb_ubus_list_teardown |
( |
UNUSED void ** |
state | ) |
|
Definition at line 116 of file test_amxb_ubus_list.c.
120 system(
"killall amxrt");
121 system(
"killall lua5.1");
123 amxb_be_remove_all();
124 unlink(
"test_config.odl");
◆ test_ubus_can_list_amx_object()
void test_ubus_can_list_amx_object |
( |
UNUSED void ** |
state | ) |
|
Definition at line 134 of file test_amxb_ubus_list.c.
135 int all_flags = AMXB_FLAG_FUNCTIONS | AMXB_FLAG_PARAMETERS | AMXB_FLAG_OBJECTS | AMXB_FLAG_INSTANCES;
136 assert_int_equal(amxb_list(
bus_ctx,
"NeMo.Intf.", all_flags,
test_list_cb, NULL), AMXB_STATUS_OK);
137 assert_int_equal(amxb_list(
bus_ctx,
"NeMo.Intf", all_flags,
test_list_cb, NULL), AMXB_STATUS_OK);
138 assert_int_equal(amxb_list(
bus_ctx,
"NeMo.Intf.", all_flags | AMXB_FLAG_FIRST_LVL,
test_list_cb, NULL), AMXB_STATUS_OK);
static void test_list_cb(UNUSED const amxb_bus_ctx_t *bus_ctx, UNUSED const amxc_var_t *const data, UNUSED void *priv)