From: Andrew Bartlett Date: Tue, 30 May 2017 00:47:58 +0000 (+1200) Subject: ldb: Move test_ldb_attrs_case_insensitive closer to setup/teardown functions X-Git-Tag: ldb-1.1.30~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e903e08027b84ab434941f7e3ffb141d76720a24;p=thirdparty%2Fsamba.git ldb: Move test_ldb_attrs_case_insensitive closer to setup/teardown functions Signed-off-by: Andrew Bartlett Reviewed-by: Garming Sam --- diff --git a/lib/ldb/tests/ldb_mod_op_test.c b/lib/ldb/tests/ldb_mod_op_test.c index 84043cbaec5..878cf5c29b0 100644 --- a/lib/ldb/tests/ldb_mod_op_test.c +++ b/lib/ldb/tests/ldb_mod_op_test.c @@ -1463,6 +1463,30 @@ static int ldb_case_test_teardown(void **state) return 0; } +static void test_ldb_attrs_case_insensitive(void **state) +{ + int cnt; + struct ldbtest_ctx *ldb_test_ctx = talloc_get_type_abort(*state, + struct ldbtest_ctx); + + /* cn matches exact case */ + cnt = sub_search_count(ldb_test_ctx, "", "cn=CaseInsensitiveValue"); + assert_int_equal(cnt, 1); + + /* cn matches lower case */ + cnt = sub_search_count(ldb_test_ctx, "", "cn=caseinsensitivevalue"); + assert_int_equal(cnt, 1); + + /* uid matches exact case */ + cnt = sub_search_count(ldb_test_ctx, "", "uid=CaseSensitiveValue"); + assert_int_equal(cnt, 1); + + /* uid does not match lower case */ + cnt = sub_search_count(ldb_test_ctx, "", "uid=casesensitivevalue"); + assert_int_equal(cnt, 0); +} + + struct rename_test_ctx { struct ldbtest_ctx *ldb_test_ctx; @@ -1526,29 +1550,6 @@ static int ldb_rename_test_teardown(void **state) return 0; } -static void test_ldb_attrs_case_insensitive(void **state) -{ - int cnt; - struct ldbtest_ctx *ldb_test_ctx = talloc_get_type_abort(*state, - struct ldbtest_ctx); - - /* cn matches exact case */ - cnt = sub_search_count(ldb_test_ctx, "", "cn=CaseInsensitiveValue"); - assert_int_equal(cnt, 1); - - /* cn matches lower case */ - cnt = sub_search_count(ldb_test_ctx, "", "cn=caseinsensitivevalue"); - assert_int_equal(cnt, 1); - - /* uid matches exact case */ - cnt = sub_search_count(ldb_test_ctx, "", "uid=CaseSensitiveValue"); - assert_int_equal(cnt, 1); - - /* uid does not match lower case */ - cnt = sub_search_count(ldb_test_ctx, "", "uid=casesensitivevalue"); - assert_int_equal(cnt, 0); -} - static void test_ldb_rename(void **state) { struct rename_test_ctx *rename_test_ctx =