]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libsmbconf: testsuite: add test for "get_includes" and use it in the text backend...
authorMichael Adam <obnox@samba.org>
Tue, 8 Apr 2008 10:30:21 +0000 (12:30 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 9 Apr 2008 23:28:58 +0000 (01:28 +0200)
Michael

source/lib/smbconf/testsuite.c

index fe9d8bf792935339b1da3d9436df027c201cfcd8..dd5dc5a9cc8acf7521f7cd6cd63e6ea20bf3f9be 100644 (file)
 
 #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;