git.samba.org
/
kai
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3fee0d7
)
libsmbconf: testsuite: refactor printing of string lists out.
author
Michael Adam
<obnox@samba.org>
Tue, 8 Apr 2008 15:49:10 +0000
(17:49 +0200)
committer
Michael Adam
<obnox@samba.org>
Wed, 9 Apr 2008 23:28:59 +0000
(
01:28
+0200)
Michael
source/lib/smbconf/testsuite.c
patch
|
blob
|
history
diff --git
a/source/lib/smbconf/testsuite.c
b/source/lib/smbconf/testsuite.c
index f159faac4ddf3ab41e00b69eececbbf6f67a17a0..e718e734e39e6baaa323019cc18af98a61980b61 100644
(file)
--- a/
source/lib/smbconf/testsuite.c
+++ b/
source/lib/smbconf/testsuite.c
@@
-19,11
+19,24
@@
#include "includes.h"
#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;
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();
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) ? ":" : ".");
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;
printf("success: get_includes\n");
ret = true;