From 2dc53a8123ac6db65a1138e0dbdba426c5604acd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
Date: Mon, 26 Jan 2015 11:17:24 +0100
Subject: [PATCH 01/13] cache_req tests: rename test_user to test_user_by_name

This is done in order to distinguish those tests from other
user tests that are about to come. For example: test_user_by_id.
---
 src/tests/cmocka/test_responder_cache_req.c | 50 ++++++++++++++---------------
 1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/src/tests/cmocka/test_responder_cache_req.c b/src/tests/cmocka/test_responder_cache_req.c
index 694e8dd46d2d18b06ea364e0d10d0c3f12c8b265..6c83cac0fb9bee6ebe767b5cca14622cce2db23c 100644
--- a/src/tests/cmocka/test_responder_cache_req.c
+++ b/src/tests/cmocka/test_responder_cache_req.c
@@ -95,7 +95,7 @@ __wrap_sss_dp_get_account_send(TALLOC_CTX *mem_ctx,
     return test_req_succeed_send(mem_ctx, rctx->ev);
 }
 
-static void cache_req_user_test_done(struct tevent_req *req)
+static void cache_req_user_by_name_test_done(struct tevent_req *req)
 {
     struct cache_req_test_ctx *ctx = NULL;
 
@@ -167,7 +167,7 @@ void test_multi_domain_teardown(void **state)
     test_multidom_suite_cleanup(TESTS_PATH, TEST_CONF_DB, domains);
 }
 
-void test_user_multiple_domains_found(void **state)
+void test_user_by_name_multiple_domains_found(void **state)
 {
     struct cache_req_test_ctx *test_ctx = NULL;
     struct sss_domain_info *domain = NULL;
@@ -198,7 +198,7 @@ void test_user_multiple_domains_found(void **state)
                                       test_ctx->rctx, test_ctx->ncache, 10, 0,
                                       NULL, name);
     assert_non_null(req);
-    tevent_req_set_callback(req, cache_req_user_test_done, test_ctx);
+    tevent_req_set_callback(req, cache_req_user_by_name_test_done, test_ctx);
 
     ret = test_ev_loop(test_ctx->tctx);
     assert_int_equal(ret, ERR_OK);
@@ -220,7 +220,7 @@ void test_user_multiple_domains_found(void **state)
     assert_string_equal(domain->name, test_ctx->domain->name);
 }
 
-void test_user_multiple_domains_notfound(void **state)
+void test_user_by_name_multiple_domains_notfound(void **state)
 {
     struct cache_req_test_ctx *test_ctx = NULL;
     TALLOC_CTX *req_mem_ctx = NULL;
@@ -240,7 +240,7 @@ void test_user_multiple_domains_notfound(void **state)
                                       test_ctx->rctx, test_ctx->ncache, 10, 0,
                                       NULL, name);
     assert_non_null(req);
-    tevent_req_set_callback(req, cache_req_user_test_done, test_ctx);
+    tevent_req_set_callback(req, cache_req_user_by_name_test_done, test_ctx);
 
     ret = test_ev_loop(test_ctx->tctx);
     assert_int_equal(ret, ENOENT);
@@ -249,7 +249,7 @@ void test_user_multiple_domains_notfound(void **state)
     assert_true(test_ctx->dp_called);
 }
 
-void test_user_cache_valid(void **state)
+void test_user_by_name_cache_valid(void **state)
 {
     struct cache_req_test_ctx *test_ctx = NULL;
     TALLOC_CTX *req_mem_ctx = NULL;
@@ -272,7 +272,7 @@ void test_user_cache_valid(void **state)
                                       test_ctx->rctx, test_ctx->ncache, 10, 0,
                                       test_ctx->tctx->dom->name, name);
     assert_non_null(req);
-    tevent_req_set_callback(req, cache_req_user_test_done, test_ctx);
+    tevent_req_set_callback(req, cache_req_user_by_name_test_done, test_ctx);
 
     ret = test_ev_loop(test_ctx->tctx);
     assert_int_equal(ret, ERR_OK);
@@ -289,7 +289,7 @@ void test_user_cache_valid(void **state)
     assert_string_equal(ldbname, name);
 }
 
-void test_user_cache_expired(void **state)
+void test_user_by_name_cache_expired(void **state)
 {
     struct cache_req_test_ctx *test_ctx = NULL;
     TALLOC_CTX *req_mem_ctx = NULL;
@@ -316,7 +316,7 @@ void test_user_cache_expired(void **state)
                                       test_ctx->rctx, test_ctx->ncache, 10, 0,
                                       test_ctx->tctx->dom->name, name);
     assert_non_null(req);
-    tevent_req_set_callback(req, cache_req_user_test_done, test_ctx);
+    tevent_req_set_callback(req, cache_req_user_by_name_test_done, test_ctx);
 
     ret = test_ev_loop(test_ctx->tctx);
     assert_int_equal(ret, ERR_OK);
@@ -335,7 +335,7 @@ void test_user_cache_expired(void **state)
     assert_string_equal(ldbname, name);
 }
 
-void test_user_cache_midpoint(void **state)
+void test_user_by_name_cache_midpoint(void **state)
 {
     struct cache_req_test_ctx *test_ctx = NULL;
     TALLOC_CTX *req_mem_ctx = NULL;
@@ -361,7 +361,7 @@ void test_user_cache_midpoint(void **state)
                                       test_ctx->rctx, test_ctx->ncache, 10, 50,
                                       test_ctx->tctx->dom->name, name);
     assert_non_null(req);
-    tevent_req_set_callback(req, cache_req_user_test_done, test_ctx);
+    tevent_req_set_callback(req, cache_req_user_by_name_test_done, test_ctx);
 
     ret = test_ev_loop(test_ctx->tctx);
     assert_int_equal(ret, ERR_OK);
@@ -380,7 +380,7 @@ void test_user_cache_midpoint(void **state)
     assert_string_equal(ldbname, name);
 }
 
-void test_user_ncache(void **state)
+void test_user_by_name_ncache(void **state)
 {
     struct cache_req_test_ctx *test_ctx = NULL;
     TALLOC_CTX *req_mem_ctx = NULL;
@@ -401,7 +401,7 @@ void test_user_ncache(void **state)
                                       test_ctx->rctx, test_ctx->ncache, 100, 0,
                                       test_ctx->tctx->dom->name, name);
     assert_non_null(req);
-    tevent_req_set_callback(req, cache_req_user_test_done, test_ctx);
+    tevent_req_set_callback(req, cache_req_user_by_name_test_done, test_ctx);
 
     ret = test_ev_loop(test_ctx->tctx);
     assert_int_equal(ret, ENOENT);
@@ -410,7 +410,7 @@ void test_user_ncache(void **state)
     assert_false(test_ctx->dp_called);
 }
 
-void test_user_missing_found(void **state)
+void test_user_by_name_missing_found(void **state)
 {
     struct cache_req_test_ctx *test_ctx = NULL;
     TALLOC_CTX *req_mem_ctx = NULL;
@@ -433,7 +433,7 @@ void test_user_missing_found(void **state)
                                       test_ctx->rctx, test_ctx->ncache, 100, 0,
                                       test_ctx->tctx->dom->name, name);
     assert_non_null(req);
-    tevent_req_set_callback(req, cache_req_user_test_done, test_ctx);
+    tevent_req_set_callback(req, cache_req_user_by_name_test_done, test_ctx);
 
     ret = test_ev_loop(test_ctx->tctx);
     assert_int_equal(ret, ERR_OK);
@@ -452,7 +452,7 @@ void test_user_missing_found(void **state)
     assert_string_equal(ldbname, name);
 }
 
-void test_user_missing_notfound(void **state)
+void test_user_by_name_missing_notfound(void **state)
 {
     struct cache_req_test_ctx *test_ctx = NULL;
     TALLOC_CTX *req_mem_ctx = NULL;
@@ -472,7 +472,7 @@ void test_user_missing_notfound(void **state)
                                       test_ctx->rctx, test_ctx->ncache, 100, 0,
                                       test_ctx->tctx->dom->name, name);
     assert_non_null(req);
-    tevent_req_set_callback(req, cache_req_user_test_done, test_ctx);
+    tevent_req_set_callback(req, cache_req_user_by_name_test_done, test_ctx);
 
     ret = test_ev_loop(test_ctx->tctx);
     assert_int_equal(ret, ENOENT);
@@ -492,14 +492,14 @@ int main(int argc, const char *argv[])
     };
 
     const UnitTest tests[] = {
-        new_single_domain_test(user_cache_valid),
-        new_single_domain_test(user_cache_expired),
-        new_single_domain_test(user_cache_midpoint),
-        new_single_domain_test(user_ncache),
-        new_single_domain_test(user_missing_found),
-        new_single_domain_test(user_missing_notfound),
-        new_multi_domain_test(user_multiple_domains_found),
-        new_multi_domain_test(user_multiple_domains_notfound)
+        new_single_domain_test(user_by_name_cache_valid),
+        new_single_domain_test(user_by_name_cache_expired),
+        new_single_domain_test(user_by_name_cache_midpoint),
+        new_single_domain_test(user_by_name_ncache),
+        new_single_domain_test(user_by_name_missing_found),
+        new_single_domain_test(user_by_name_missing_notfound),
+        new_multi_domain_test(user_by_name_multiple_domains_found),
+        new_multi_domain_test(user_by_name_multiple_domains_notfound)
     };
 
     /* Set debug level to invalid value so we can deside if -d 0 was used. */
-- 
1.7.11.7

