libamxb  4.8.2
Bus Agnostic C API
test_amxb_backend_mngr.c File Reference
#include <stdlib.h>
#include <dlfcn.h>
#include <stdarg.h>
#include <stddef.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 "test_amxb_backend_mngr.h"
#include <amxc/amxc_macros.h>

Go to the source code of this file.

Macros

#define ARRAY_SIZE(arr)   (sizeof(arr) / sizeof((arr)[0]))
 

Functions

void * __real_dlopen (const char *filename, int flag)
 
int __real_dlclose (void *handle)
 
void * __wrap_dlopen (const char *filename, int flag)
 
int __wrap_dlclose (void *handle)
 
void * __wrap_dlsym (void *handle, const char *symbol)
 
static amxb_be_info_tfake_get_version_info ()
 
static void * fake_connect (UNUSED const char *host, UNUSED const char *port, UNUSED const char *path, UNUSED amxp_signal_mngr_t *sigmngr)
 
static int fake_disconnect (void *ctx)
 
void * __wrap_dlopen (UNUSED const char *filename, UNUSED int flag)
 
int __wrap_dlclose (UNUSED void *handle)
 
void * __wrap_dlsym (UNUSED void *handle, const char *symbol)
 
void test_amxb_be_register (UNUSED void **state)
 
void test_amxb_be_unregister (UNUSED void **state)
 
void test_amxb_be_find (UNUSED void **state)
 
void test_amxb_be_load (UNUSED void **state)
 
void test_amxb_be_load_same_multiple_times (UNUSED void **state)
 
void test_amxb_be_load_multiple (UNUSED void **state)
 
void test_amxb_be_remove (UNUSED void **state)
 
void test_amxb_be_remove_all (UNUSED void **state)
 
void test_amxb_be_load_version_checking (UNUSED void **state)
 
void test_amxb_be_get_version (UNUSED void **state)
 
void test_amxb_set_config (UNUSED void **state)
 
void test_amxb_be_get_info (UNUSED void **state)
 

Variables

static void * fake_handle = NULL
 
static char * fake_ctx = "fake"
 
static int return_val = 0
 
static uint32_t min_version_id = 0
 
static uint32_t max_version_id = 0
 
static bool has_info = true
 
static bool register_be = true
 
static amxb_version_t sup_min_version []
 
static amxb_version_t sup_max_version []
 
static amxb_version_t be_version
 
static amxb_be_info_t be_info
 
static amxb_be_funcs_t dummy_be1
 
static amxb_be_funcs_t dummy_be2
 
static amxb_be_funcs_t dummy_be3
 
static amxb_be_funcs_t dummy_be4
 
static amxb_be_funcs_t dummy_be5
 
static amxb_be_funcs_t dummy_be6
 

Macro Definition Documentation

◆ ARRAY_SIZE

#define ARRAY_SIZE (   arr)    (sizeof(arr) / sizeof((arr)[0]))

Definition at line 78 of file test_amxb_backend_mngr.c.

Function Documentation

◆ __real_dlclose()

int __real_dlclose ( void *  handle)

◆ __real_dlopen()

void* __real_dlopen ( const char *  filename,
int  flag 
)

◆ __wrap_dlclose() [1/2]

int __wrap_dlclose ( UNUSED void *  handle)

Definition at line 246 of file test_amxb_backend_mngr.c.

246  {
247  return return_val;
248 }
static int return_val

◆ __wrap_dlclose() [2/2]

int __wrap_dlclose ( void *  handle)

◆ __wrap_dlopen() [1/2]

void* __wrap_dlopen ( const char *  filename,
int  flag 
)

◆ __wrap_dlopen() [2/2]

void* __wrap_dlopen ( UNUSED const char *  filename,
UNUSED int  flag 
)

Definition at line 229 of file test_amxb_backend_mngr.c.

229  {
230  if(fake_handle != NULL) {
231  if(register_be) {
232  if(dummy_be1.handle == NULL) {
233  assert_int_equal(amxb_be_register(&dummy_be1), 0);
234  assert_ptr_equal(dummy_be1.handle, NULL);
235  } else if(dummy_be3.handle == NULL) {
236  assert_int_equal(amxb_be_register(&dummy_be3), 0);
237  assert_ptr_equal(dummy_be3.handle, NULL);
238  } else {
239  return NULL;
240  }
241  }
242  }
243  return fake_handle;
244 }
int amxb_be_register(amxb_be_funcs_t *const funcs)
Registers backend interface.
static bool register_be
static amxb_be_funcs_t dummy_be1
static void * fake_handle
static amxb_be_funcs_t dummy_be3

◆ __wrap_dlsym() [1/2]

void* __wrap_dlsym ( UNUSED void *  handle,
const char *  symbol 
)

Definition at line 250 of file test_amxb_backend_mngr.c.

250  {
251  assert_string_equal(symbol, "amxb_be_info");
252  if(has_info) {
253  return fake_get_version_info;
254  } else {
255  return NULL;
256  }
257 }
static amxb_be_info_t * fake_get_version_info()
static bool has_info

◆ __wrap_dlsym() [2/2]

void* __wrap_dlsym ( void *  handle,
const char *  symbol 
)

◆ fake_connect()

static void* fake_connect ( UNUSED const char *  host,
UNUSED const char *  port,
UNUSED const char *  path,
UNUSED amxp_signal_mngr_t *  sigmngr 
)
static

Definition at line 180 of file test_amxb_backend_mngr.c.

183  {
184  return fake_ctx;
185 }
static char * fake_ctx

◆ fake_disconnect()

static int fake_disconnect ( void *  ctx)
static

Definition at line 187 of file test_amxb_backend_mngr.c.

187  {
188  assert_ptr_equal(ctx, fake_ctx);
189  return 0;
190 }

◆ fake_get_version_info()

static amxb_be_info_t* fake_get_version_info ( )
static

Definition at line 165 of file test_amxb_backend_mngr.c.

165  {
166  if(min_version_id == UINT32_MAX) {
167  be_info.min_supported = NULL;
168  } else {
170  }
171  if(max_version_id == UINT32_MAX) {
172  be_info.max_supported = NULL;
173  } else {
175  }
176 
177  return &be_info;
178 }
const amxb_version_t * min_supported
Definition: amxb_types.h:105
const amxb_version_t * max_supported
Definition: amxb_types.h:106
static amxb_version_t sup_min_version[]
static uint32_t min_version_id
static uint32_t max_version_id
static amxb_be_info_t be_info
static amxb_version_t sup_max_version[]

◆ test_amxb_be_find()

void test_amxb_be_find ( UNUSED void **  state)

Definition at line 290 of file test_amxb_backend_mngr.c.

290  {
291  const amxb_be_funcs_t* funcs = NULL;
292 
293  assert_int_equal(amxb_be_register(&dummy_be1), 0);
294  assert_int_equal(amxb_be_register(&dummy_be3), 0);
295 
296  funcs = amxb_be_find(NULL);
297  assert_ptr_equal(funcs, NULL);
298 
299  funcs = amxb_be_find("test");
300  assert_ptr_equal(funcs, NULL);
301 
302  funcs = amxb_be_find("");
303  assert_ptr_equal(funcs, NULL);
304 
305  funcs = amxb_be_find("xbus");
306  assert_ptr_not_equal(funcs, NULL);
307  assert_ptr_equal(funcs, &dummy_be1);
308 
309  funcs = amxb_be_find("ybus");
310  assert_ptr_not_equal(funcs, NULL);
311  assert_ptr_equal(funcs, &dummy_be3);
312 
313  assert_int_equal(amxb_be_unregister(&dummy_be1), 0);
314  assert_int_equal(amxb_be_unregister(&dummy_be3), 0);
315  assert_ptr_equal(dummy_be3.handle, NULL);
316  assert_ptr_equal(dummy_be1.handle, NULL);
317 }
int amxb_be_unregister(amxb_be_funcs_t *const funcs)
Unregisters a backend interface.
amxb_be_funcs_t * amxb_be_find(const char *name)
Gets a backend function table using its name.
The back-end interface structure.

◆ test_amxb_be_get_info()

void test_amxb_be_get_info ( UNUSED void **  state)

Definition at line 554 of file test_amxb_backend_mngr.c.

554  {
555  fake_handle = __real_dlopen(NULL, RTLD_NOW);
556  const amxb_be_info_t* info = NULL;
557 
558  assert_int_equal(amxb_be_register(&dummy_be1), 0);
559 
560  info = amxb_be_get_info("xbus");
561  assert_non_null(info);
562  info = amxb_be_get_info("test");
563  assert_null(info);
564  info = amxb_be_get_info("");
565  assert_null(info);
566  info = amxb_be_get_info(NULL);
567  assert_null(info);
568 
570 
571  info = amxb_be_get_info("xbus");
572  assert_null(info);
573 
574  return_val = 0;
575  assert_int_not_equal(amxb_be_unregister(&dummy_be1), 0);
576 }
const amxb_be_info_t * amxb_be_get_info(const char *name)
Gets a backend information.
void amxb_be_remove_all(void)
Removes and unloads all backends.
void * __real_dlopen(const char *filename, int flag)

◆ test_amxb_be_get_version()

void test_amxb_be_get_version ( UNUSED void **  state)

Definition at line 529 of file test_amxb_backend_mngr.c.

529  {
531  amxb_version_t* libv2 = NULL;
532  assert_ptr_not_equal(libv, NULL);
533  assert_int_not_equal(libv->major, 99999);
534  libv->major = 99999;
535  assert_int_equal(libv->major, 99999);
536  libv2 = (amxb_version_t*) amxb_get_version();
537  assert_ptr_equal(libv, libv2);
538  assert_int_not_equal(libv->major, 99999);
539  assert_int_not_equal(libv2->major, 99999);
540 }
const amxb_version_t * amxb_get_version(void)
Gets the version of the library.
int32_t major
Definition: amxb_types.h:99

◆ test_amxb_be_load()

void test_amxb_be_load ( UNUSED void **  state)

Definition at line 319 of file test_amxb_backend_mngr.c.

319  {
320  const amxb_be_funcs_t* funcs = NULL;
321  fake_handle = __real_dlopen(NULL, RTLD_NOW);
322 
323  min_version_id = 0;
324  max_version_id = 1;
325  assert_int_not_equal(amxb_be_load(NULL), 0);
326  assert_int_not_equal(amxb_be_load(""), 0);
327  assert_int_equal(amxb_be_load("/path/to/some/sofile.so"), 0);
328  assert_ptr_equal(dummy_be1.handle, fake_handle);
329  assert_int_equal(amxb_be_unregister(&dummy_be1), 0);
330  assert_ptr_equal(dummy_be1.handle, NULL);
331 
332  funcs = amxb_be_find("xbus");
333  assert_ptr_equal(funcs, NULL);
334 
335  register_be = false;
336  assert_int_equal(amxb_be_load("/path/to/some/sofile.so"), 0);
337  assert_int_equal(amxb_be_unregister(&dummy_be1), 0);
338  assert_ptr_equal(dummy_be1.handle, NULL);
339  register_be = true;
340 
341  fake_handle = NULL;
342  assert_int_not_equal(amxb_be_load("/path/to/some/sofile.so"), 0);
343 }
int amxb_be_load(const char *path_name)
Loads a shared object that implements a bus specific backend interface.

◆ test_amxb_be_load_multiple()

void test_amxb_be_load_multiple ( UNUSED void **  state)

Definition at line 362 of file test_amxb_backend_mngr.c.

362  {
363  amxc_var_t shared_objects;
364  fake_handle = __real_dlopen(NULL, RTLD_NOW);
365 
366  amxc_var_init(&shared_objects);
367 
368  min_version_id = 0;
369  max_version_id = 1;
370 
371  assert_int_not_equal(amxb_be_load_multiple(NULL), 0);
372  assert_int_not_equal(amxb_be_load_multiple(&shared_objects), 0);
373 
374  amxc_var_set_type(&shared_objects, AMXC_VAR_ID_CSTRING);
375  assert_int_not_equal(amxb_be_load_multiple(&shared_objects), 0);
376  amxc_var_set_type(&shared_objects, AMXC_VAR_ID_LIST);
377  assert_int_not_equal(amxb_be_load_multiple(&shared_objects), 0);
378 
379  amxc_var_set(cstring_t, &shared_objects, "/path/to/some/sofile.so");
380  assert_int_equal(amxb_be_load_multiple(&shared_objects), 0);
381  assert_ptr_equal(dummy_be1.handle, fake_handle);
382  assert_int_equal(amxb_be_unregister(&dummy_be1), 0);
383 
384  amxc_var_set_type(&shared_objects, AMXC_VAR_ID_LIST);
385  amxc_var_add(cstring_t, &shared_objects, "/path/to/some/sofile1.so");
386  amxc_var_add(cstring_t, &shared_objects, "/path/to/some/sofile2.so");
387  assert_int_equal(amxb_be_load_multiple(&shared_objects), 0);
388  assert_ptr_equal(dummy_be1.handle, fake_handle);
389  assert_ptr_equal(dummy_be3.handle, fake_handle);
390  assert_int_equal(amxb_be_unregister(&dummy_be1), 0);
391  assert_int_equal(amxb_be_unregister(&dummy_be3), 0);
392 
393  amxc_var_add(cstring_t, &shared_objects, "/path/to/some/sofile1.so");
394  amxc_var_add(cstring_t, &shared_objects, "/path/to/some/sofile2.so");
395  amxc_var_add(cstring_t, &shared_objects, "/path/to/some/sofile3.so");
396  assert_int_not_equal(amxb_be_load_multiple(&shared_objects), 0);
397  assert_ptr_equal(dummy_be1.handle, fake_handle);
398  assert_ptr_equal(dummy_be3.handle, fake_handle);
399  assert_int_equal(amxb_be_unregister(&dummy_be1), 0);
400  assert_int_equal(amxb_be_unregister(&dummy_be3), 0);
401 
402  amxc_var_set_type(&shared_objects, AMXC_VAR_ID_CSTRING);
403  amxc_var_set(cstring_t, &shared_objects, "/path/to/some/sofile1.so:/path/to/some/sofile2.so");
404  assert_int_equal(amxb_be_load_multiple(&shared_objects), 0);
405  assert_ptr_equal(dummy_be1.handle, fake_handle);
406  assert_ptr_equal(dummy_be3.handle, fake_handle);
407  assert_int_equal(amxb_be_unregister(&dummy_be1), 0);
408  assert_int_equal(amxb_be_unregister(&dummy_be3), 0);
409 
410  amxc_var_set_type(&shared_objects, AMXC_VAR_ID_CSTRING);
411  amxc_var_set(cstring_t, &shared_objects, "/path/to/some/sofile1.so:/path/to/some/sofile2.so:/path/to/some/sofile3.so");
412  assert_int_not_equal(amxb_be_load_multiple(&shared_objects), 0);
413  assert_ptr_equal(dummy_be1.handle, fake_handle);
414  assert_ptr_equal(dummy_be3.handle, fake_handle);
415  assert_int_equal(amxb_be_unregister(&dummy_be1), 0);
416  assert_int_equal(amxb_be_unregister(&dummy_be3), 0);
417 
418  amxc_var_clean(&shared_objects);
419 }
int amxb_be_load_multiple(amxc_var_t *const bes)
Loads multiple shared objects that each implement a bus specific backend interface.

◆ test_amxb_be_load_same_multiple_times()

void test_amxb_be_load_same_multiple_times ( UNUSED void **  state)

Definition at line 345 of file test_amxb_backend_mngr.c.

345  {
346  fake_handle = __real_dlopen(NULL, RTLD_NOW);
347 
348  register_be = false;
349  min_version_id = 0;
350  max_version_id = 1;
351  assert_int_equal(amxb_be_load("/path/to/some/sofile.so"), 0);
352  assert_ptr_equal(dummy_be1.handle, fake_handle);
353  assert_int_equal(amxb_be_load("/path/to/some/sofile.so"), 0);
354  assert_ptr_equal(dummy_be1.handle, fake_handle);
355  assert_int_equal(amxb_be_load("/path/to/some/sofile.so"), 0);
356  assert_ptr_equal(dummy_be1.handle, fake_handle);
357  assert_int_equal(amxb_be_unregister(&dummy_be1), 0);
358  assert_ptr_equal(dummy_be1.handle, NULL);
359  register_be = true;
360 }

◆ test_amxb_be_load_version_checking()

void test_amxb_be_load_version_checking ( UNUSED void **  state)

Definition at line 484 of file test_amxb_backend_mngr.c.

484  {
485  fake_handle = __real_dlopen(NULL, RTLD_NOW);
486 
487  min_version_id = 0;
488  max_version_id = 0;
489  for(uint32_t i = 0; i < ARRAY_SIZE(sup_min_version); i++) {
490  min_version_id = i;
491  if(i < 4) {
492  assert_int_equal(amxb_be_load("/path/to/some/sofile.so"), 0);
493  assert_ptr_equal(dummy_be1.handle, fake_handle);
494  assert_int_equal(amxb_be_unregister(&dummy_be1), 0);
495  } else {
496  assert_int_not_equal(amxb_be_load("/path/to/some/sofile.so"), 0);
497  assert_int_equal(amxb_be_unregister(&dummy_be1), 0);
498  }
499  }
500 
501  min_version_id = 0;
502  max_version_id = 1;
503  for(uint32_t i = 0; i < ARRAY_SIZE(sup_min_version); i++) {
504  min_version_id = i;
505  if(i < 4) {
506  assert_int_equal(amxb_be_load("/path/to/some/sofile.so"), 0);
507  assert_ptr_equal(dummy_be1.handle, fake_handle);
508  assert_int_equal(amxb_be_unregister(&dummy_be1), 0);
509  } else {
510  assert_int_not_equal(amxb_be_load("/path/to/some/sofile.so"), 0);
511  assert_int_equal(amxb_be_unregister(&dummy_be1), 0);
512  }
513  }
514 
515  min_version_id = UINT32_MAX;
516  assert_int_not_equal(amxb_be_load("/path/to/some/sofile.so"), 0);
517  assert_int_equal(amxb_be_unregister(&dummy_be1), 0);
518  min_version_id = 0;
519  max_version_id = UINT32_MAX;
520  assert_int_not_equal(amxb_be_load("/path/to/some/sofile.so"), 0);
521  assert_int_equal(amxb_be_unregister(&dummy_be1), 0);
522  max_version_id = 0;
523  has_info = false;
524  assert_int_not_equal(amxb_be_load("/path/to/some/sofile.so"), 0);
525  assert_int_equal(amxb_be_unregister(&dummy_be1), 0);
526  has_info = true;
527 }
#define ARRAY_SIZE(arr)

◆ test_amxb_be_register()

void test_amxb_be_register ( UNUSED void **  state)

Definition at line 259 of file test_amxb_backend_mngr.c.

259  {
260  assert_int_not_equal(amxb_be_register(NULL), 0);
261  assert_int_equal(amxb_be_register(&dummy_be1), 0);
262  assert_int_not_equal(amxb_be_register(&dummy_be1), 0);
263  assert_int_not_equal(amxb_be_register(&dummy_be2), 0);
264  assert_int_equal(amxb_be_register(&dummy_be3), 0);
265  assert_int_not_equal(amxb_be_register(&dummy_be4), 0);
266  assert_int_not_equal(amxb_be_register(&dummy_be5), 0);
267 
268  assert_int_equal(amxb_be_unregister(&dummy_be1), 0);
269  assert_int_equal(amxb_be_unregister(&dummy_be3), 0);
270  assert_ptr_equal(dummy_be3.handle, NULL);
271  assert_ptr_equal(dummy_be1.handle, NULL);
272 }
static amxb_be_funcs_t dummy_be5
static amxb_be_funcs_t dummy_be4
static amxb_be_funcs_t dummy_be2

◆ test_amxb_be_remove()

void test_amxb_be_remove ( UNUSED void **  state)

Definition at line 421 of file test_amxb_backend_mngr.c.

421  {
422  amxb_bus_ctx_t* c1 = NULL;
423 
424  fake_handle = __real_dlopen(NULL, RTLD_NOW);
425 
426  min_version_id = 0;
427  max_version_id = 1;
428 
429  assert_int_equal(amxb_be_register(&dummy_be1), 0);
431 
432  assert_int_not_equal(amxb_be_remove(NULL), 0);
433  assert_int_not_equal(amxb_be_remove(""), 0);
434 
435  assert_int_equal(amxb_connect(&c1, "xbus:///var/run/test.sock"), 0);
436 
437  assert_int_equal(amxb_be_remove("xbus"), 0);
438  assert_int_not_equal(amxb_be_unregister(&dummy_be1), 0);
439  assert_int_not_equal(amxb_be_remove("xbus"), 0);
440 
441  assert_int_equal(amxb_be_register(&dummy_be1), 0);
442  dummy_be1.handle = NULL;
443  assert_int_not_equal(amxb_be_remove("xbus"), 0);
444  assert_int_equal(amxb_be_unregister(&dummy_be1), 0);
445 
446  assert_int_equal(amxb_be_register(&dummy_be1), 0);
448  return_val = -1;
449  assert_int_not_equal(amxb_be_remove("xbus"), 0);
450  return_val = 0;
451  assert_int_not_equal(amxb_be_unregister(&dummy_be1), 0);
452 }
int amxb_be_remove(const char *backend_name)
Removes and unloads a backend with a given name.
int amxb_connect(amxb_bus_ctx_t **ctx, const char *uri)
Create a bus connection.

◆ test_amxb_be_remove_all()

void test_amxb_be_remove_all ( UNUSED void **  state)

Definition at line 454 of file test_amxb_backend_mngr.c.

454  {
455  fake_handle = __real_dlopen(NULL, RTLD_NOW);
456  amxb_bus_ctx_t* c1 = NULL;
457  amxb_bus_ctx_t* c2 = NULL;
458 
459  assert_int_equal(amxb_be_register(&dummy_be1), 0);
460  assert_int_equal(amxb_be_register(&dummy_be3), 0);
463 
464  assert_int_equal(amxb_connect(&c1, "xbus:///var/run/test.sock"), 0);
465  assert_int_equal(amxb_connect(&c2, "xbus:///var/run/test.sock"), 0);
466 
467  amxb_free(&c1);
468 
470  assert_int_not_equal(amxb_be_unregister(&dummy_be1), 0);
471  dummy_be1.handle = NULL;
472  assert_int_not_equal(amxb_be_unregister(&dummy_be3), 0);
473  dummy_be3.handle = NULL;
474 
475  assert_int_equal(amxb_be_register(&dummy_be1), 0);
477  return_val = -1;
479  return_val = 0;
480  assert_int_not_equal(amxb_be_unregister(&dummy_be1), 0);
481  dummy_be1.handle = NULL;
482 }
void amxb_free(amxb_bus_ctx_t **ctx)
Frees allocated memory.

◆ test_amxb_be_unregister()

void test_amxb_be_unregister ( UNUSED void **  state)

Definition at line 274 of file test_amxb_backend_mngr.c.

274  {
275  assert_int_equal(amxb_be_register(&dummy_be1), 0);
276  assert_int_equal(amxb_be_register(&dummy_be3), 0);
277 
278  assert_int_not_equal(amxb_be_unregister(NULL), 0);
279  assert_int_not_equal(amxb_be_unregister(&dummy_be2), 0);
280  assert_int_not_equal(amxb_be_unregister(&dummy_be4), 0);
281  assert_int_not_equal(amxb_be_unregister(&dummy_be5), 0);
282  assert_int_not_equal(amxb_be_unregister(&dummy_be6), 0);
283 
284  assert_int_equal(amxb_be_unregister(&dummy_be1), 0);
285  assert_int_equal(amxb_be_unregister(&dummy_be3), 0);
286  assert_ptr_equal(dummy_be3.handle, NULL);
287  assert_ptr_equal(dummy_be1.handle, NULL);
288 }
static amxb_be_funcs_t dummy_be6

◆ test_amxb_set_config()

void test_amxb_set_config ( UNUSED void **  state)

Definition at line 542 of file test_amxb_backend_mngr.c.

542  {
543  amxc_var_t config;
544 
545  amxc_var_init(&config);
546  amxc_var_set_type(&config, AMXC_VAR_ID_HTABLE);
547 
548  amxc_var_add_key(amxc_htable_t, &config, "dummy", NULL);
549  assert_int_equal(amxb_set_config(&config), 0);
550 
551  amxc_var_clean(&config);
552 }
config
Definition: test.odl:56
int amxb_set_config(amxc_var_t *const configuration)
Passes configuration options to the backends.

Variable Documentation

◆ be_info

amxb_be_info_t be_info
static
Initial value:
= {
.be_version = &be_version,
.name = "dummy",
.description = "Dummy description",
}
static amxb_version_t be_version

Definition at line 159 of file test_amxb_backend_mngr.c.

◆ be_version

amxb_version_t be_version
static
Initial value:
= {
.major = 0,
.minor = 0,
.build = 7
}

Definition at line 153 of file test_amxb_backend_mngr.c.

◆ dummy_be1

amxb_be_funcs_t dummy_be1
static
Initial value:
= {
.connect = fake_connect,
.disconnect = fake_disconnect,
.size = sizeof(amxb_be_funcs_t),
.name = "xbus",
}
struct _amxb_be_funcs amxb_be_funcs_t
Definition: amxb_types.h:79
static int fake_disconnect(void *ctx)
static void * fake_connect(UNUSED const char *host, UNUSED const char *port, UNUSED const char *path, UNUSED amxp_signal_mngr_t *sigmngr)

Definition at line 192 of file test_amxb_backend_mngr.c.

◆ dummy_be2

amxb_be_funcs_t dummy_be2
static
Initial value:
= {
.connect = NULL,
.size = sizeof(amxb_be_funcs_t),
.name = "xbus",
}

Definition at line 199 of file test_amxb_backend_mngr.c.

◆ dummy_be3

amxb_be_funcs_t dummy_be3
static
Initial value:
= {
.connect = NULL,
.size = sizeof(amxb_be_funcs_t),
.name = "ybus",
}

Definition at line 205 of file test_amxb_backend_mngr.c.

◆ dummy_be4

amxb_be_funcs_t dummy_be4
static
Initial value:
= {
.connect = NULL,
.size = sizeof(amxb_be_funcs_t),
.name = "",
}

Definition at line 211 of file test_amxb_backend_mngr.c.

◆ dummy_be5

amxb_be_funcs_t dummy_be5
static
Initial value:
= {
.connect = NULL,
.size = sizeof(amxb_be_funcs_t),
.name = NULL,
}

Definition at line 217 of file test_amxb_backend_mngr.c.

◆ dummy_be6

amxb_be_funcs_t dummy_be6
static
Initial value:
= {
.connect = NULL,
.size = sizeof(amxb_be_funcs_t),
.name = "test",
}

Definition at line 223 of file test_amxb_backend_mngr.c.

◆ fake_ctx

char* fake_ctx = "fake"
static

Definition at line 88 of file test_amxb_backend_mngr.c.

◆ fake_handle

void* fake_handle = NULL
static

Definition at line 87 of file test_amxb_backend_mngr.c.

◆ has_info

bool has_info = true
static

Definition at line 93 of file test_amxb_backend_mngr.c.

◆ max_version_id

uint32_t max_version_id = 0
static

Definition at line 92 of file test_amxb_backend_mngr.c.

◆ min_version_id

uint32_t min_version_id = 0
static

Definition at line 91 of file test_amxb_backend_mngr.c.

◆ register_be

bool register_be = true
static

Definition at line 94 of file test_amxb_backend_mngr.c.

◆ return_val

int return_val = 0
static

Definition at line 89 of file test_amxb_backend_mngr.c.

◆ sup_max_version

amxb_version_t sup_max_version[]
static
Initial value:
= {
{
.major = 4,
.minor = 99,
.build = 999,
},
{
.major = 4,
.minor = 8,
.build = 999,
},
{
.major = -1,
}
}

Definition at line 137 of file test_amxb_backend_mngr.c.

◆ sup_min_version

amxb_version_t sup_min_version[]
static

Definition at line 96 of file test_amxb_backend_mngr.c.