ldb: Move test_ldb_attrs_case_insensitive closer to setup/teardown functions
authorAndrew Bartlett <abartlet@samba.org>
Tue, 30 May 2017 00:47:58 +0000 (12:47 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 31 May 2017 04:34:26 +0000 (06:34 +0200)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
lib/ldb/tests/ldb_mod_op_test.c

index 84043cbaec509a593491f83ac2762dd174076e21..878cf5c29b05e7026729e51c57acf1c9014ec8a6 100644 (file)
@@ -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 =