diff options
author | Martin Schwenke <martin@meltin.net> | 2013-09-18 14:27:03 +1000 |
---|---|---|
committer | Amitay Isaacs <amitay@gmail.com> | 2013-10-04 15:15:35 +1000 |
commit | 24fb430d6e99e60af9b1f9e2e358ec707937e7a8 (patch) | |
tree | c51dd93c841f3a33b36641b2b731a99ae389b75c /ctdb/tests/src | |
parent | f3b179081933fc942c6fbcac3630203bbb24f0ed (diff) | |
download | samba-24fb430d6e99e60af9b1f9e2e358ec707937e7a8.tar.gz |
tests/tool: Remove references in libctdb in file and function names
Main changes are:
libctdb_test.c -> ctdb_test_stubs.c
ctdb_tool_libctdb.c -> ctdb_functest.c
ctdb_tool_stubby.c is gone, replaced with existing ctdb_test.c.
Functions starting with "libctdb_test_" now start with
"ctdb_test_stubs_".
Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 6182bd0c19f215a997efe5272e633b1b1bd0c882)
Diffstat (limited to 'ctdb/tests/src')
-rw-r--r-- | ctdb/tests/src/ctdb_functest.c (renamed from ctdb/tests/src/ctdb_tool_libctdb.c) | 26 | ||||
-rw-r--r-- | ctdb/tests/src/ctdb_test.c | 2 | ||||
-rw-r--r-- | ctdb/tests/src/ctdb_test_stubs.c (renamed from ctdb/tests/src/libctdb_test.c) | 24 | ||||
-rw-r--r-- | ctdb/tests/src/ctdb_tool_stubby.c | 20 |
4 files changed, 26 insertions, 46 deletions
diff --git a/ctdb/tests/src/ctdb_tool_libctdb.c b/ctdb/tests/src/ctdb_functest.c index 81755d4bbb4..16ca4fddd64 100644 --- a/ctdb/tests/src/ctdb_tool_libctdb.c +++ b/ctdb/tests/src/ctdb_functest.c @@ -1,5 +1,5 @@ /* - Tests for tools/ctdb.c and libctdb stubs + Tests for tools/ctdb.c and CTDB client stubs Copyright (C) Martin Schwenke 2011 @@ -24,8 +24,8 @@ static void test_read_nodemap(void) { struct ctdb_context *ctdb = talloc_zero(NULL, struct ctdb_context); - libctdb_test_read_nodemap(ctdb); - libctdb_test_print_nodemap(ctdb); + ctdb_test_stubs_read_nodemap(ctdb); + ctdb_test_stubs_print_nodemap(ctdb); talloc_free(ctdb); } @@ -34,8 +34,8 @@ static void test_read_ifaces(void) { struct ctdb_context *ctdb = talloc_zero(NULL, struct ctdb_context); - libctdb_test_read_ifaces(ctdb); - libctdb_test_print_ifaces(ctdb); + ctdb_test_stubs_read_ifaces(ctdb); + ctdb_test_stubs_print_ifaces(ctdb); talloc_free(ctdb); } @@ -44,8 +44,8 @@ static void test_read_vnnmap(void) { struct ctdb_context *ctdb = talloc_zero(NULL, struct ctdb_context); - libctdb_test_read_vnnmap(ctdb); - libctdb_test_print_vnnmap(ctdb); + ctdb_test_stubs_read_vnnmap(ctdb); + ctdb_test_stubs_print_vnnmap(ctdb); talloc_free(ctdb); } @@ -55,14 +55,14 @@ static void test_fake_setup(void) bool first = true; struct ctdb_context *ctdb = talloc_zero(NULL, struct ctdb_context); - libctdb_test_fake_setup(ctdb); + ctdb_test_stubs_fake_setup(ctdb); if (ctdb->nodes != NULL) { if (!first) { printf("\n"); } printf("NODEMAP\n"); - libctdb_test_print_nodemap(ctdb); + ctdb_test_stubs_print_nodemap(ctdb); first = false; } @@ -71,7 +71,7 @@ static void test_fake_setup(void) printf("\n"); } printf("IFACES\n"); - libctdb_test_print_ifaces(ctdb); + ctdb_test_stubs_print_ifaces(ctdb); first = false; } @@ -80,7 +80,7 @@ static void test_fake_setup(void) printf("\n"); } printf("VNNMAP\n"); - libctdb_test_print_vnnmap(ctdb); + ctdb_test_stubs_print_vnnmap(ctdb); first = false; } @@ -144,7 +144,7 @@ static void test_parse_nodestring(const char *nodestring_s, ctdb = talloc_zero(NULL, struct ctdb_context); - libctdb_test_read_nodemap(ctdb); + ctdb_test_stubs_read_nodemap(ctdb); if (parse_nodestring(ctdb, NULL, nodestring, CTDB_CURRENT_NODE, dd_ok, &nodes, &pnn_mode)) { @@ -156,7 +156,7 @@ static void test_parse_nodestring(const char *nodestring_s, static void usage(void) { - fprintf(stderr, "usage: ctdb_tool_libctdb <op>\n"); + fprintf(stderr, "usage: ctdb_tool_functest <op>\n"); exit(1); } diff --git a/ctdb/tests/src/ctdb_test.c b/ctdb/tests/src/ctdb_test.c index 5b0160a05cc..bbb51bd877c 100644 --- a/ctdb/tests/src/ctdb_test.c +++ b/ctdb/tests/src/ctdb_test.c @@ -99,6 +99,6 @@ #include "client/ctdb_client.c" /* TEST STUBS */ -#include "libctdb_test.c" +#include "ctdb_test_stubs.c" #endif /* _CTDBD_TEST_C */ diff --git a/ctdb/tests/src/libctdb_test.c b/ctdb/tests/src/ctdb_test_stubs.c index 31d163583f7..456b1fdc0ce 100644 --- a/ctdb/tests/src/libctdb_test.c +++ b/ctdb/tests/src/ctdb_test_stubs.c @@ -1,5 +1,5 @@ /* - Test stubs and support functions for some libctdb functions + Test stubs and support functions for some CTDB client functions Copyright (C) Martin Schwenke 2011 @@ -21,7 +21,7 @@ * <PNN> <FLAGS> [RECMASTER] [CURRENT] * EOF or a blank line terminates input. */ -void libctdb_test_read_nodemap(struct ctdb_context *ctdb) +void ctdb_test_stubs_read_nodemap(struct ctdb_context *ctdb) { char line[1024]; @@ -102,7 +102,7 @@ void libctdb_test_read_nodemap(struct ctdb_context *ctdb) } } -void libctdb_test_print_nodemap(struct ctdb_context *ctdb) +void ctdb_test_stubs_print_nodemap(struct ctdb_context *ctdb) { int i; @@ -129,7 +129,7 @@ struct ctdb_iface { uint32_t references; }; -void libctdb_test_read_ifaces(struct ctdb_context *ctdb) +void ctdb_test_stubs_read_ifaces(struct ctdb_context *ctdb) { char line[1024]; struct ctdb_iface *iface; @@ -189,7 +189,7 @@ void libctdb_test_read_ifaces(struct ctdb_context *ctdb) } } -void libctdb_test_print_ifaces(struct ctdb_context *ctdb) +void ctdb_test_stubs_print_ifaces(struct ctdb_context *ctdb) { struct ctdb_iface *iface; @@ -217,7 +217,7 @@ struct ctdb_vnn_map { uint32_t *map; }; */ -void libctdb_test_read_vnnmap(struct ctdb_context *ctdb) +void ctdb_test_stubs_read_vnnmap(struct ctdb_context *ctdb) { char line[1024]; @@ -261,7 +261,7 @@ void libctdb_test_read_vnnmap(struct ctdb_context *ctdb) } } -void libctdb_test_print_vnnmap(struct ctdb_context *ctdb) +void ctdb_test_stubs_print_vnnmap(struct ctdb_context *ctdb) { int i; @@ -271,7 +271,7 @@ void libctdb_test_print_vnnmap(struct ctdb_context *ctdb) } } -void libctdb_test_fake_setup(struct ctdb_context *ctdb) +void ctdb_test_stubs_fake_setup(struct ctdb_context *ctdb) { char line[1024]; @@ -284,11 +284,11 @@ void libctdb_test_fake_setup(struct ctdb_context *ctdb) } if (strcmp(line, "NODEMAP") == 0) { - libctdb_test_read_nodemap(ctdb); + ctdb_test_stubs_read_nodemap(ctdb); } else if (strcmp(line, "IFACES") == 0) { - libctdb_test_read_ifaces(ctdb); + ctdb_test_stubs_read_ifaces(ctdb); } else if (strcmp(line, "VNNMAP") == 0) { - libctdb_test_read_vnnmap(ctdb); + ctdb_test_stubs_read_vnnmap(ctdb); } else { printf("Unknown line %s\n", line); exit(1); @@ -326,7 +326,7 @@ struct ctdb_context *ctdb_cmdline_client_stub(struct tevent_context *ev, ctdb_set_socketname(ctdb, "fake"); - libctdb_test_fake_setup(ctdb); + ctdb_test_stubs_fake_setup(ctdb); return ctdb; } diff --git a/ctdb/tests/src/ctdb_tool_stubby.c b/ctdb/tests/src/ctdb_tool_stubby.c deleted file mode 100644 index 5492c8a7188..00000000000 --- a/ctdb/tests/src/ctdb_tool_stubby.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - Tests wrapper for tools/ctdb.c that uses stubs - - Copyright (C) Martin Schwenke 2011 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see <http://www.gnu.org/licenses/>. -*/ - -#include "ctdb_test.c" |