119 amxc_var_init(&args);
120 amxc_var_init(&retval);
128 amxc_var_set_type(&args, AMXC_VAR_ID_HTABLE);
130 assert_int_equal(amxc_var_type_of(&retval), AMXC_VAR_ID_NULL);
132 amxc_var_set_type(&args, AMXC_VAR_ID_HTABLE);
133 amxc_var_add_key(uint32_t, &args,
"index", 1);
135 assert_int_equal(amxc_var_type_of(&retval), AMXC_VAR_ID_NULL);
137 assert_ptr_not_equal(instance, NULL);
140 assert_ptr_not_equal(instance, NULL);
145 amxc_var_set_type(&args, AMXC_VAR_ID_HTABLE);
146 amxc_var_add_key(cstring_t, &args,
"name",
"TestInst1");
148 amxc_var_add_key(
bool, &args,
"set_read_only",
false);
150 amxc_var_set_type(&args, AMXC_VAR_ID_HTABLE);
151 amxc_var_add_key(cstring_t, &args,
"name",
"TestInst1");
153 amxc_var_add_key(
bool, &args,
"set_read_only",
false);
156 assert_ptr_not_equal(instance, NULL);
158 assert_ptr_equal(instance, NULL);
160 assert_ptr_equal(instance, NULL);
164 amxc_var_set_type(&args, AMXC_VAR_ID_HTABLE);
165 amxc_var_add_key(uint32_t, &args,
"index", 3);
167 amxc_var_add_key(
bool, &args,
"set_read_only",
false);
169 amxc_var_set_type(&args, AMXC_VAR_ID_HTABLE);
170 amxc_var_add_key(uint32_t, &args,
"index", 3);
172 amxc_var_add_key(
bool, &args,
"set_read_only",
true);
175 assert_ptr_not_equal(instance, NULL);
178 assert_ptr_equal(instance, NULL);
181 amxc_var_set_type(&args, AMXC_VAR_ID_HTABLE);
182 amxc_var_add_key(uint32_t, &args,
"index", 10);
184 amxc_var_set_type(&args, AMXC_VAR_ID_HTABLE);
185 amxc_var_add_key(uint32_t, &args,
"index", 10);
187 amxc_var_set_type(&args, AMXC_VAR_ID_HTABLE);
188 amxc_var_add_key(uint32_t, &args,
"index", 10);
190 amxc_var_set_type(&args, AMXC_VAR_ID_HTABLE);
191 amxc_var_add_key(uint32_t, &args,
"index", 10);
194 assert_ptr_not_equal(instance, NULL);
197 assert_ptr_equal(instance, NULL);
204 amxc_var_clean(&args);
205 amxc_var_clean(&retval);
amxd_status_t amxd_action_object_del_inst(amxd_object_t *const object, amxd_param_t *const param, amxd_action_t reason, const amxc_var_t *const args, amxc_var_t *const retval, void *priv)
@ amxd_dm_access_protected
void amxd_dm_clean(amxd_dm_t *dm)
Cleans a data model structure.
amxd_status_t amxd_action_object_destroy(amxd_object_t *object, amxd_param_t *const param, amxd_action_t reason, const amxc_var_t *const args, amxc_var_t *const retval, void *priv)
Default object destroy action implementation.
amxd_object_t * amxd_object_get_instance(const amxd_object_t *object, const char *name, uint32_t index)
Get an instance of the template object.
amxd_status_t amxd_object_set_attr(amxd_object_t *const object, const amxd_oattr_id_t attr, const bool enable)
Sets or unsets an object attribute.
amxd_status_t amxd_object_new_instance(amxd_object_t **object, amxd_object_t *templ, const char *name, uint32_t index, amxc_var_t *values)
Data model object constructor function.
void amxd_object_delete(amxd_object_t **object)
Invokes the destroy handler(s) of the object.
static amxd_object_t * test_build_dm(void)