87 info->name =
"object_create";
88 info->category =
"/res/sorcery_astdb/";
89 info->summary =
"sorcery astdb object creation unit test";
91 "Test object creation in sorcery using astdb wizard";
125 info->name =
"object_retrieve_id";
126 info->category =
"/res/sorcery_astdb/";
127 info->summary =
"sorcery object retrieval using id unit test";
129 "Test object retrieval using id in sorcery with astdb wizard";
183 info->name =
"object_retrieve_field";
184 info->category =
"/res/sorcery_astdb/";
185 info->summary =
"sorcery object retrieval using a specific field unit test";
187 "Test object retrieval using a specific field in sorcery with astdb wizard";
246 info->name =
"object_retrieve_multiple_all";
247 info->category =
"/res/sorcery_astdb/";
248 info->summary =
"sorcery multiple object retrieval unit test";
250 "Test multiple object retrieval in sorcery using astdb wizard";
303 info->name =
"object_retrieve_multiple_field";
304 info->category =
"/res/sorcery_astdb/";
305 info->summary =
"sorcery multiple object retrieval unit test";
307 "Test multiple object retrieval in sorcery using fields using astdb wizard";
368 info->name =
"object_retrieve_regex";
369 info->category =
"/res/sorcery_astdb/";
370 info->summary =
"sorcery multiple object retrieval using regex unit test";
372 "Test multiple object retrieval in sorcery using regular expression for matching using astdb wizard";
436 info->name =
"object_update";
437 info->category =
"/res/sorcery_astdb/";
438 info->summary =
"sorcery object update unit test";
440 "Test object updating in sorcery using astdb wizard";
479 }
else if ((obj->bob != obj2->bob) || (obj->joe != obj2->joe)) {
494 info->name =
"object_update_uncreated";
495 info->category =
"/res/sorcery_astdb/";
496 info->summary =
"sorcery object update unit test";
498 "Test updating of an uncreated object in sorcery using astdb wizard";
529 info->name =
"object_delete";
530 info->category =
"/res/sorcery_astdb/";
531 info->summary =
"sorcery object deletion unit test";
533 "Test object deletion in sorcery using astdb wizard";
576 info->name =
"object_delete_uncreated";
577 info->category =
"/res/sorcery_astdb/";
578 info->summary =
"sorcery object deletion unit test";
580 "Test object deletion of an uncreated object in sorcery using astdb wizard";
Persistent data storage (akin to *doze registry)
int ast_db_get(const char *family, const char *key, char *value, int valuelen)
Get key value specified by family/key.
int ast_db_deltree(const char *family, const char *keytree)
Delete one or more entries in astdb.
Asterisk main include file. File version handling, generic pbx functions.
int ao2_container_count(struct ao2_container *c)
Returns the number of elements in a container.
#define FLDSET(type,...)
Convert a struct and list of fields to an argument list of field offsets.
@ OPT_UINT_T
Type for default option handler for unsigned integers.
#define ast_variable_new(name, value, filename)
void ast_variables_destroy(struct ast_variable *var)
Free variable list.
Support for logging to various files, console and syslog Configuration in file logger....
Asterisk module definitions.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
#define ASTERISK_GPL_KEY
The text the key() function should return.
@ AST_MODULE_LOAD_SUCCESS
static struct ast_sorcery * sorcery
Sorcery Data Access Layer API.
#define ast_sorcery_unref(sorcery)
Decrease the reference count of a sorcery structure.
const char * ast_sorcery_object_get_id(const void *object)
Get the unique identifier of a sorcery object.
#define ast_sorcery_object_field_register_nodoc(sorcery, type, name, default_val, opt_type, flags,...)
Register a field within an object without documentation.
@ AST_RETRIEVE_FLAG_MULTIPLE
Return all matching objects.
@ AST_RETRIEVE_FLAG_DEFAULT
Default retrieval flags.
@ AST_RETRIEVE_FLAG_ALL
Perform no matching, return all objects.
int ast_sorcery_create(const struct ast_sorcery *sorcery, void *object)
Create and potentially persist an object using an available wizard.
void * ast_sorcery_retrieve_by_id(const struct ast_sorcery *sorcery, const char *type, const char *id)
Retrieve an object using its unique identifier.
struct ao2_container * ast_sorcery_retrieve_by_regex(const struct ast_sorcery *sorcery, const char *type, const char *regex)
Retrieve multiple objects using a regular expression on their id.
#define ast_sorcery_internal_object_register(sorcery, type, alloc, transform, apply)
Register an internal, hidden object type.
void * ast_sorcery_generic_alloc(size_t size, ao2_destructor_fn destructor)
Allocate a generic sorcery capable object.
void * ast_sorcery_alloc(const struct ast_sorcery *sorcery, const char *type, const char *id)
Allocate an object.
int ast_sorcery_update(const struct ast_sorcery *sorcery, void *object)
Update an object.
#define ast_sorcery_apply_default(sorcery, type, name, data)
#define ast_sorcery_open()
Open a new sorcery structure.
void * ast_sorcery_retrieve_by_fields(const struct ast_sorcery *sorcery, const char *type, unsigned int flags, struct ast_variable *fields)
Retrieve an object or multiple objects using specific fields.
int ast_sorcery_delete(const struct ast_sorcery *sorcery, void *object)
Delete an object.
void * ast_sorcery_copy(const struct ast_sorcery *sorcery, const void *object)
Create a copy of an object.
@ AST_SORCERY_APPLY_SUCCESS
Full structure for sorcery.
Structure for variables, used for configurations and for channel variables.
#define AST_TEST_REGISTER(cb)
#define ast_test_status_update(a, b, c...)
#define AST_TEST_UNREGISTER(cb)
static struct ast_sorcery * alloc_and_initialize_sorcery(void)
static void * test_sorcery_object_alloc(const char *id)
Internal function to allocate a test object.
static void deinitialize_sorcery(struct ast_sorcery *sorcery)
static int load_module(void)
static int unload_module(void)
AST_TEST_DEFINE(object_create)
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.