Lines Matching refs:opts
66 static void assert_defaults(struct dp_option *opts)
73 s = dp_opt_get_string(opts, OPT_STRING_NODEFAULT);
76 s = dp_opt_get_string(opts, OPT_STRING_DEFAULT);
80 b = dp_opt_get_blob(opts, OPT_BLOB_NODEFAULT);
84 b = dp_opt_get_blob(opts, OPT_BLOB_DEFAULT);
89 i = dp_opt_get_int(opts, OPT_INT_NODEFAULT);
92 i = dp_opt_get_int(opts, OPT_INT_DEFAULT);
95 bo = dp_opt_get_bool(opts, OPT_BOOL_TRUE);
98 bo = dp_opt_get_bool(opts, OPT_BOOL_FALSE);
106 struct dp_option *opts;
112 ret = dp_copy_defaults(mem_ctx, test_def_opts, OPT_NUM_OPTS, &opts);
114 assert_defaults(opts);
119 ret = dp_opt_set_string(opts, OPT_STRING_NODEFAULT, "str1");
121 ret = dp_opt_set_string(opts, OPT_STRING_DEFAULT, "str2");
126 ret = dp_opt_set_blob(opts, OPT_BLOB_NODEFAULT, b);
129 ret = dp_opt_set_blob(opts, OPT_BLOB_DEFAULT, b);
134 ret = dp_opt_set_int(opts, OPT_INT_NODEFAULT, 456);
136 ret = dp_opt_set_int(opts, OPT_INT_DEFAULT, 789);
139 ret = dp_opt_set_bool(opts, OPT_BOOL_TRUE, false);
141 ret = dp_opt_set_bool(opts, OPT_BOOL_FALSE, true);
144 talloc_free(opts);
145 ret = dp_copy_defaults(mem_ctx, test_def_opts, OPT_NUM_OPTS, &opts);
147 assert_defaults(opts);
154 struct dp_option *opts;
163 ret = dp_copy_options(mem_ctx, test_def_opts, OPT_NUM_OPTS, &opts);
167 ret = dp_opt_set_string(opts, OPT_STRING_NODEFAULT, "str1");
172 ret = dp_opt_set_blob(opts, OPT_BLOB_NODEFAULT, b);
175 ret = dp_opt_set_int(opts, OPT_INT_NODEFAULT, 456);
178 ret = dp_opt_set_bool(opts, OPT_BOOL_TRUE, false);
185 s = dp_opt_get_string(opts, OPT_STRING_NODEFAULT);
187 s = dp_opt_get_string(opts, OPT_STRING_DEFAULT);
190 b = dp_opt_get_blob(opts, OPT_BLOB_NODEFAULT);
194 b = dp_opt_get_blob(opts, OPT_BLOB_DEFAULT);
198 i = dp_opt_get_int(opts, OPT_INT_NODEFAULT);
200 i = dp_opt_get_int(opts, OPT_INT_DEFAULT);
203 bo = dp_opt_get_bool(opts, OPT_BOOL_TRUE);
211 struct dp_option *opts;
229 test_def_opts, OPT_NUM_OPTS, &opts);
236 s = dp_opt_get_string(opts, OPT_STRING_NODEFAULT);
240 s = dp_opt_get_string(opts, OPT_STRING_DEFAULT);
244 b = dp_opt_get_blob(opts, OPT_BLOB_NODEFAULT);
249 b = dp_opt_get_blob(opts, OPT_BLOB_DEFAULT);
254 i = dp_opt_get_int(opts, OPT_INT_NODEFAULT);
257 i = dp_opt_get_int(opts, OPT_INT_DEFAULT);
260 bo = dp_opt_get_bool(opts, OPT_BOOL_TRUE);
263 bo = dp_opt_get_bool(opts, OPT_BOOL_FALSE);
270 struct dp_option *opts;
273 test_def_opts, OPT_NUM_OPTS, &opts);
275 assert_defaults(opts);
277 *state = opts;
283 struct dp_option *opts = talloc_get_type(*state, struct dp_option);
284 talloc_free(opts);
288 static void assert_nondefault_string_empty(struct dp_option *opts)
292 s = dp_opt_get_string(opts, OPT_STRING_NODEFAULT);
296 static void set_nondefault_string(struct dp_option *opts)
300 ret = dp_opt_set_string(opts, OPT_STRING_NODEFAULT, "str1");
304 static void check_nondefault_string(struct dp_option *opts)
308 s = dp_opt_get_string(opts, OPT_STRING_NODEFAULT);
315 struct dp_option *opts = talloc_get_type(*state, struct dp_option);
317 assert_nondefault_string_empty(opts);
318 set_nondefault_string(opts);
319 check_nondefault_string(opts);
322 static void assert_nondefault_blob_empty(struct dp_option *opts)
326 b = dp_opt_get_blob(opts, OPT_BLOB_NODEFAULT);
331 static void set_nondefault_blob(struct dp_option *opts)
338 ret = dp_opt_set_blob(opts, OPT_BLOB_NODEFAULT, b);
342 static void check_nondefault_blob(struct dp_option *opts)
346 b = dp_opt_get_blob(opts, OPT_BLOB_NODEFAULT);
354 struct dp_option *opts = talloc_get_type(*state, struct dp_option);
356 assert_nondefault_blob_empty(opts);
357 set_nondefault_blob(opts);
358 check_nondefault_blob(opts);
361 static void assert_nondefault_int_notset(struct dp_option *opts)
364 i = dp_opt_get_int(opts, OPT_INT_NODEFAULT);
368 static void set_nondefault_int(struct dp_option *opts)
371 ret = dp_opt_set_int(opts, OPT_INT_NODEFAULT, 456);
375 static void assert_nondefault_int_set(struct dp_option *opts)
378 i = dp_opt_get_int(opts, OPT_INT_NODEFAULT);
384 struct dp_option *opts = talloc_get_type(*state, struct dp_option);
386 assert_nondefault_int_notset(opts);
387 set_nondefault_int(opts);
388 assert_nondefault_int_set(opts);
393 struct dp_option *opts = talloc_get_type(*state, struct dp_option);
397 b = dp_opt_get_bool(opts, OPT_BOOL_TRUE);
400 ret = dp_opt_set_bool(opts, OPT_BOOL_TRUE, false);
403 b = dp_opt_get_bool(opts, OPT_BOOL_TRUE);
409 struct dp_option *opts = talloc_get_type(*state, struct dp_option);
419 ret = dp_copy_defaults(opts, test_def_opts,
422 assert_defaults(opts);
425 opts, opts_copy);
431 set_nondefault_string(opts);
434 opts, opts_copy);
439 set_nondefault_blob(opts);
442 opts, opts_copy);
447 set_nondefault_int(opts);
450 opts, opts_copy);
456 ret = dp_opt_set_bool(opts, OPT_BOOL_TRUE, false);
461 opts, opts_copy);