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";
110 }
else if (
ast_db_get(
"test/test",
"blah", value,
sizeof(value))) {
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";
#define AST_MODULE_INFO_STANDARD(keystr, desc)
#define ast_sorcery_object_field_register_nodoc(sorcery, type, name, default_val, opt_type, flags,...)
Register a field within an object without documentation.
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.
void ast_variables_destroy(struct ast_variable *var)
Free variable list.
Structure for variables, used for configurations and for channel variables.
static void * test_sorcery_object_alloc(const char *id)
Internal function to allocate a test object.
Perform no matching, return all objects.
#define AST_TEST_REGISTER(cb)
Full structure for sorcery.
static struct ast_sorcery * alloc_and_initialize_sorcery(void)
Return all matching objects.
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.
void * ast_sorcery_retrieve_by_id(const struct ast_sorcery *sorcery, const char *type, const char *id)
Retrieve an object using its unique identifier.
#define ast_sorcery_unref(sorcery)
Decrease the reference count of a sorcery structure.
int ast_sorcery_create(const struct ast_sorcery *sorcery, void *object)
Create and potentially persist an object using an available wizard.
#define FLDSET(type,...)
Convert a struct and list of fields to an argument list of field offsets.
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
Type for default option handler for unsigned integers.
#define ast_test_status_update(a, b, c...)
const char * ast_sorcery_object_get_id(const void *object)
Get the unique identifier of a sorcery object.
#define ast_variable_new(name, value, filename)
int ast_sorcery_delete(const struct ast_sorcery *sorcery, void *object)
Delete an object.
#define ast_sorcery_internal_object_register(sorcery, type, alloc, transform, apply)
Register an internal, hidden object type.
static int load_module(void)
#define AST_TEST_UNREGISTER(cb)
#define ast_sorcery_apply_default(sorcery, type, name, data)
static void deinitialize_sorcery(struct ast_sorcery *sorcery)
AST_TEST_DEFINE(object_create)
void * ast_sorcery_alloc(const struct ast_sorcery *sorcery, const char *type, const char *id)
Allocate an object.
int ast_db_get(const char *family, const char *key, char *value, int valuelen)
Get key value specified by family/key.
static int unload_module(void)
Support for logging to various files, console and syslog Configuration in file logger.conf.
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.
static struct ast_sorcery * sorcery
void * ast_sorcery_copy(const struct ast_sorcery *sorcery, const void *object)
Create a copy of an object.
#define ast_sorcery_open()
void * ast_sorcery_generic_alloc(size_t size, ao2_destructor_fn destructor)
Allocate a generic sorcery capable object.
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
Persistant data storage (akin to *doze registry)
int ast_db_deltree(const char *family, const char *keytree)
Delete one or more entries in astdb.
Sorcery Data Access Layer API.
int ast_sorcery_update(const struct ast_sorcery *sorcery, void *object)
Update an object.