From f4de1c6ac7a702a325dd2bb31625efd3867f84c6 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 8 Apr 2008 12:30:21 +0200 Subject: libsmbconf: testsuite: add test for "get_includes" and use it in the text backend test. Michael (This used to be commit 1ca5afe58cef8b750a65bd8c2a5c9ee794ed50ba) --- source3/lib/smbconf/testsuite.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) 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; -- cgit