summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-04-08 17:49:10 +0200
committerMichael Adam <obnox@samba.org>2008-04-10 01:28:59 +0200
commit097a056df9c1c3fc80a111f0ed2bb87ccbf86289 (patch)
tree5d99d8b2f79ba42395a005c3c82f4bfd9917ffaf
parent56c0f28a505611654d48c3283bf917ab95c2afa7 (diff)
downloadsamba-097a056df9c1c3fc80a111f0ed2bb87ccbf86289.tar.gz
samba-097a056df9c1c3fc80a111f0ed2bb87ccbf86289.tar.bz2
samba-097a056df9c1c3fc80a111f0ed2bb87ccbf86289.zip
libsmbconf: testsuite: refactor printing of string lists out.
Michael (This used to be commit 828c7297247a557ed8e2b6935bbc819aae95a660)
-rw-r--r--source3/lib/smbconf/testsuite.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/source3/lib/smbconf/testsuite.c b/source3/lib/smbconf/testsuite.c
index f159faac4d..e718e734e3 100644
--- a/source3/lib/smbconf/testsuite.c
+++ b/source3/lib/smbconf/testsuite.c
@@ -19,11 +19,24 @@
#include "includes.h"
+static void print_strings(const char *prefix,
+ uint32_t num_strings, const char **strings)
+{
+ uint32_t count;
+
+ if (prefix == NULL) {
+ prefix = "";
+ }
+
+ for (count = 0; count < num_strings; count++) {
+ printf("%s%s\n", prefix, strings[count]);
+ }
+}
+
static bool test_get_includes(struct smbconf_ctx *ctx)
{
WERROR werr;
bool ret = false;
- uint32_t count;
uint32_t num_includes = 0;
char **includes = NULL;
TALLOC_CTX *mem_ctx = talloc_stackframe();
@@ -38,9 +51,7 @@ static bool test_get_includes(struct smbconf_ctx *ctx)
printf("got %u includes%s\n", num_includes,
(num_includes > 0) ? ":" : ".");
- for (count = 0; count < num_includes; count++) {
- printf("%s\n", includes[count]);
- }
+ print_strings("", num_includes, (const char **)includes);
printf("success: get_includes\n");
ret = true;