From 0fdc72560277374fec73934a613d8863190e2b39 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Wed, 30 Oct 2013 21:35:18 +0100 Subject: AD: Fix ad_access_filter parsing with empty filter --- src/tests/cmocka/test_ad_access_filter.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/tests/cmocka/test_ad_access_filter.c') diff --git a/src/tests/cmocka/test_ad_access_filter.c b/src/tests/cmocka/test_ad_access_filter.c index e31f2dc37..3f4e44f14 100644 --- a/src/tests/cmocka/test_ad_access_filter.c +++ b/src/tests/cmocka/test_ad_access_filter.c @@ -99,6 +99,18 @@ done: talloc_free(tmp_ctx); } +/* Test that setting no filter lets all access through + */ +void test_no_filter(void **state) +{ + struct filter_parse_result expected = { + .result = EOK, + .best_match = NULL + }; + + test_parse_filter_generic(NULL, &expected); +} + /* Test that if one filter is provided, it is returned as-is */ void test_single_filter(void **state) @@ -304,6 +316,10 @@ int main(int argc, const char *argv[]) parse_test_setup, parse_test_teardown), + unit_test_setup_teardown(test_no_filter, + ad_access_filter_test_setup, + ad_access_filter_test_teardown), + unit_test_setup_teardown(test_single_filter, ad_access_filter_test_setup, ad_access_filter_test_teardown), -- cgit