summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-04-08 12:30:21 +0200
committerMichael Adam <obnox@samba.org>2008-04-10 01:28:58 +0200
commitf4de1c6ac7a702a325dd2bb31625efd3867f84c6 (patch)
treefd07f885a575181ce78f4656b879f88b1cc4112e /source3/lib
parentdde53e5d6817e21da33277f5c85655a839e85102 (diff)
downloadsamba-f4de1c6ac7a702a325dd2bb31625efd3867f84c6.tar.gz
samba-f4de1c6ac7a702a325dd2bb31625efd3867f84c6.tar.bz2
samba-f4de1c6ac7a702a325dd2bb31625efd3867f84c6.zip
libsmbconf: testsuite: add test for "get_includes" and use it in the text backend test.
Michael (This used to be commit 1ca5afe58cef8b750a65bd8c2a5c9ee794ed50ba)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/smbconf/testsuite.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/source3/lib/smbconf/testsuite.c b/source3/lib/smbconf/testsuite.c
index fe9d8bf792..dd5dc5a9cc 100644
--- a/source3/lib/smbconf/testsuite.c
+++ b/source3/lib/smbconf/testsuite.c
@@ -19,6 +19,36 @@
#include "includes.h"
+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();
+
+ printf("test: get_includes\n");
+ werr = smbconf_get_includes(ctx, mem_ctx, GLOBAL_NAME,
+ &num_includes, &includes);
+ if (!W_ERROR_IS_OK(werr)) {
+ printf("failure: get_includes - %s\n", dos_errstr(werr));
+ goto done;
+ }
+
+ printf("got %u includes%s\n", num_includes,
+ (num_includes > 0) ? ":" : ".");
+ for (count = 0; count < num_includes; count++) {
+ printf("%s\n", includes[count]);
+ }
+
+ printf("success: get_includes\n");
+ ret = true;
+
+done:
+ TALLOC_FREE(mem_ctx);
+ return ret;
+}
static bool torture_smbconf_txt(void)
{
@@ -38,6 +68,8 @@ static bool torture_smbconf_txt(void)
}
printf("success: init\n");
+ ret &= test_get_includes(conf_ctx);
+
smbconf_shutdown(conf_ctx);
ret = true;