Lines Matching refs:fcontext
192 semanage_fcontext_t *fcontext; in get_fcontext_new() local
194 CU_ASSERT_FATAL(semanage_fcontext_create(sh, &fcontext) >= 0); in get_fcontext_new()
196 return fcontext; in get_fcontext_new()
202 semanage_fcontext_t *fcontext; in get_fcontext_nth() local
211 fcontext = records[idx]; in get_fcontext_nth()
217 return fcontext; in get_fcontext_nth()
223 semanage_fcontext_t *fcontext; in get_fcontext_key_nth() local
228 fcontext = get_fcontext_nth(idx); in get_fcontext_key_nth()
230 CU_ASSERT_FATAL(semanage_fcontext_key_extract(sh, fcontext, &key) >= 0); in get_fcontext_key_nth()
238 semanage_fcontext_t *fcontext; in add_local_fcontext() local
243 fcontext = get_fcontext_nth(fcontext_idx); in add_local_fcontext()
245 CU_ASSERT_FATAL(semanage_fcontext_key_extract(sh, fcontext, &key) >= 0); in add_local_fcontext()
248 CU_ASSERT_FATAL(semanage_fcontext_modify_local(sh, key, fcontext) >= 0); in add_local_fcontext()
281 semanage_fcontext_t *fcontext; in test_fcontext_compare() local
289 fcontext = get_fcontext_nth(I_FIRST); in test_fcontext_compare()
296 CU_ASSERT(semanage_fcontext_compare(fcontext, key1) == 0); in test_fcontext_compare()
297 CU_ASSERT(semanage_fcontext_compare(fcontext, key2) < 0); in test_fcontext_compare()
298 CU_ASSERT(semanage_fcontext_compare(fcontext, key3) > 0); in test_fcontext_compare()
301 semanage_fcontext_free(fcontext); in test_fcontext_compare()
311 semanage_fcontext_t *fcontext; in test_fcontext_compare2() local
319 fcontext = get_fcontext_nth(I_FIRST); in test_fcontext_compare2()
325 CU_ASSERT(semanage_fcontext_compare2(fcontext, fcontext1) == 0); in test_fcontext_compare2()
326 CU_ASSERT(semanage_fcontext_compare2(fcontext, fcontext2) < 0); in test_fcontext_compare2()
327 CU_ASSERT(semanage_fcontext_compare2(fcontext, fcontext3) > 0); in test_fcontext_compare2()
330 semanage_fcontext_free(fcontext); in test_fcontext_compare2()
367 semanage_fcontext_t *fcontext; in test_fcontext_key_extract() local
372 fcontext = get_fcontext_nth(I_FIRST); in test_fcontext_key_extract()
375 CU_ASSERT(semanage_fcontext_key_extract(sh, fcontext, &key) >= 0); in test_fcontext_key_extract()
380 semanage_fcontext_free(fcontext); in test_fcontext_key_extract()
387 semanage_fcontext_t *fcontext; in test_fcontext_get_set_expr() local
393 fcontext = get_fcontext_nth(I_FIRST); in test_fcontext_get_set_expr()
396 CU_ASSERT(semanage_fcontext_set_expr(sh, fcontext, expr_exp) >= 0); in test_fcontext_get_set_expr()
397 expr = semanage_fcontext_get_expr(fcontext); in test_fcontext_get_set_expr()
403 semanage_fcontext_free(fcontext); in test_fcontext_get_set_expr()
410 semanage_fcontext_t *fcontext; in test_fcontext_get_set_type() local
416 fcontext = get_fcontext_nth(I_FIRST); in test_fcontext_get_set_type()
419 semanage_fcontext_set_type(fcontext, type_exp); in test_fcontext_get_set_type()
420 type = semanage_fcontext_get_type(fcontext); in test_fcontext_get_set_type()
424 semanage_fcontext_free(fcontext); in test_fcontext_get_set_type()
454 semanage_fcontext_t *fcontext; in helper_fcontext_get_set_con() local
460 fcontext = get_fcontext_nth(fcontext_idx); in helper_fcontext_get_set_con()
470 CU_ASSERT(semanage_fcontext_set_con(sh, fcontext, con) >= 0); in helper_fcontext_get_set_con()
471 new_con = semanage_fcontext_get_con(fcontext); in helper_fcontext_get_set_con()
480 semanage_fcontext_free(fcontext); in helper_fcontext_get_set_con()
501 semanage_fcontext_t *fcontext; in helper_fcontext_create() local
507 CU_ASSERT(semanage_fcontext_create(sh, &fcontext) >= 0); in helper_fcontext_create()
508 CU_ASSERT_PTR_NULL(semanage_fcontext_get_expr(fcontext)); in helper_fcontext_create()
509 CU_ASSERT(semanage_fcontext_get_type(fcontext) in helper_fcontext_create()
511 CU_ASSERT_PTR_NULL(semanage_fcontext_get_con(fcontext)); in helper_fcontext_create()
514 semanage_fcontext_free(fcontext); in helper_fcontext_create()
529 semanage_fcontext_t *fcontext; in helper_fcontext_clone() local
540 fcontext = get_fcontext_nth(fcontext_idx); in helper_fcontext_clone()
543 CU_ASSERT(semanage_fcontext_clone(sh, fcontext, &fcontext_clone) >= 0); in helper_fcontext_clone()
545 expr = semanage_fcontext_get_expr(fcontext); in helper_fcontext_clone()
549 type = semanage_fcontext_get_type(fcontext); in helper_fcontext_clone()
553 con = semanage_fcontext_get_con(fcontext); in helper_fcontext_clone()
558 semanage_fcontext_free(fcontext); in helper_fcontext_clone()
770 semanage_fcontext_t *fcontext; in helper_fcontext_modify_del_local() local
778 fcontext = get_fcontext_nth(fcontext_idx); in helper_fcontext_modify_del_local()
779 CU_ASSERT(semanage_fcontext_key_extract(sh, fcontext, &key) >= 0); in helper_fcontext_modify_del_local()
789 CU_ASSERT(semanage_fcontext_set_con(sh, fcontext, con) >= 0); in helper_fcontext_modify_del_local()
792 res = semanage_fcontext_modify_local(sh, key, fcontext); in helper_fcontext_modify_del_local()
805 fcontext) == 0); in helper_fcontext_modify_del_local()
815 semanage_fcontext_free(fcontext); in helper_fcontext_modify_del_local()