#include <stdlib.h>
#include <stdarg.h>
#include <stddef.h>
#include <string.h>
#include <unistd.h>
#include <setjmp.h>
#include <cmocka.h>
#include <amxc/amxc_variant.h>
#include <amxc/amxc_htable.h>
#include <amxc/amxc_lqueue.h>
#include <amxp/amxp_signal.h>
#include <amxp/amxp_slot.h>
#include <amxd/amxd_dm.h>
#include <amxb/amxb_be.h>
#include <amxb/amxb.h>
#include <amxb/amxb_register.h>
#include "test_amxb_ba_register.h"
#include <amxc/amxc_macros.h>
Go to the source code of this file.
|
int | __wrap_dlclose (void *handle) |
|
static void * | dummy_connect (const char *host, const char *port, const char *path, UNUSED amxp_signal_mngr_t *sigmngr) |
|
static int | dummy_disconnect (void *ctx) |
|
static int | dummy_get_fd (void *ctx) |
|
static void | dummy_free (void *ctx) |
|
static int | dummy_read (void *const ctx) |
|
static int | dummy_register (void *const ctx, amxd_dm_t *const dm) |
|
static int | dummy_describe (UNUSED void *const bus_ctx, UNUSED const char *object, UNUSED const char *search_path, UNUSED uint32_t flags, UNUSED uint32_t access, amxc_var_t *retval, UNUSED int timeout) |
|
int | __wrap_dlclose (UNUSED void *handle) |
|
void | test_amxb_register (UNUSED void **state) |
|
void | test_amxb_who_has (UNUSED void **state) |
|
◆ __wrap_dlclose() [1/2]
int __wrap_dlclose |
( |
UNUSED void * |
handle | ) |
|
◆ __wrap_dlclose() [2/2]
int __wrap_dlclose |
( |
void * |
handle | ) |
|
◆ dummy_connect()
static void* dummy_connect |
( |
const char * |
host, |
|
|
const char * |
port, |
|
|
const char * |
path, |
|
|
UNUSED amxp_signal_mngr_t * |
sigmngr |
|
) |
| |
|
static |
Definition at line 89 of file test_amxb_ba_register.c.
static char verify_port[64]
static char verify_host[64]
static char verify_path[64]
◆ dummy_describe()
static int dummy_describe |
( |
UNUSED void *const |
bus_ctx, |
|
|
UNUSED const char * |
object, |
|
|
UNUSED const char * |
search_path, |
|
|
UNUSED uint32_t |
flags, |
|
|
UNUSED uint32_t |
access, |
|
|
amxc_var_t * |
retval, |
|
|
UNUSED int |
timeout |
|
) |
| |
|
static |
◆ dummy_disconnect()
static int dummy_disconnect |
( |
void * |
ctx | ) |
|
|
static |
◆ dummy_free()
static void dummy_free |
( |
void * |
ctx | ) |
|
|
static |
◆ dummy_get_fd()
static int dummy_get_fd |
( |
void * |
ctx | ) |
|
|
static |
◆ dummy_read()
static int dummy_read |
( |
void *const |
ctx | ) |
|
|
static |
◆ dummy_register()
static int dummy_register |
( |
void *const |
ctx, |
|
|
amxd_dm_t *const |
dm |
|
) |
| |
|
static |
◆ test_amxb_register()
void test_amxb_register |
( |
UNUSED void ** |
state | ) |
|
Definition at line 159 of file test_amxb_ba_register.c.
162 assert_int_equal(amxd_dm_init(&
mydm), 0);
167 assert_int_equal(
amxb_connect(&ctx,
"xbus://test:80/var/run/xbus.sock"), 0);
172 assert_int_equal(
amxb_connect(&ctx,
"xbus://test:80/var/run/xbus.sock"), 0);
178 assert_int_equal(
amxb_connect(&ctx,
"zbus://test:80/var/run/zbus.sock"), 0);
184 assert_int_equal(
amxb_connect(&ctx,
"xbus://test:80/var/run/xbus.sock"), 0);
194 amxd_dm_clean(&
mydm);
int amxb_be_unregister(amxb_be_funcs_t *const funcs)
Unregisters a backend interface.
int amxb_be_register(amxb_be_funcs_t *const funcs)
Registers backend interface.
int amxb_connect(amxb_bus_ctx_t **ctx, const char *uri)
Create a bus connection.
void amxb_free(amxb_bus_ctx_t **ctx)
Frees allocated memory.
int amxb_disconnect(amxb_bus_ctx_t *ctx)
Disconnects a bus connection.
#define AMXB_ERROR_NOT_SUPPORTED_OP
Function/operation not supported.
int amxb_register(amxb_bus_ctx_t *const ctx, amxd_dm_t *const dm)
Registers a data model to a certain bus context (connection).
static amxb_be_funcs_t dummy_be1
static amxb_be_funcs_t dummy_be3
◆ test_amxb_who_has()
void test_amxb_who_has |
( |
UNUSED void ** |
state | ) |
|
Definition at line 197 of file test_amxb_ba_register.c.
200 assert_int_equal(amxd_dm_init(&
mydm), 0);
204 assert_int_equal(
amxb_connect(&ctx,
"xbus://test:80/var/run/xbus.sock"), 0);
212 amxd_dm_clean(&
mydm);
amxb_bus_ctx_t * amxb_be_who_has(const char *object_path)
Searches a bus context that can provide a certain object.
◆ dummy_be1
Initial value:= {
.name = "xbus",
}
struct _amxb_be_funcs amxb_be_funcs_t
static int dummy_register(void *const ctx, amxd_dm_t *const dm)
static void * dummy_connect(const char *host, const char *port, const char *path, UNUSED amxp_signal_mngr_t *sigmngr)
static int dummy_get_fd(void *ctx)
static int dummy_disconnect(void *ctx)
static int dummy_describe(UNUSED void *const bus_ctx, UNUSED const char *object, UNUSED const char *search_path, UNUSED uint32_t flags, UNUSED uint32_t access, amxc_var_t *retval, UNUSED int timeout)
static void dummy_free(void *ctx)
static int dummy_read(void *const ctx)
Definition at line 137 of file test_amxb_ba_register.c.
◆ dummy_be3
◆ dummy_ctx
◆ mydm
◆ return_val
◆ verify_host
◆ verify_path
◆ verify_port