diff options
author | Andrew Bartlett <abartlet@samba.org> | 2010-11-01 20:30:33 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2010-11-02 04:36:04 +0000 |
commit | e16c9904c60bd7531ada1acd2396e56ee1213dea (patch) | |
tree | 87a2b691896a2a9d22dbddec64ad8bf104c6520d | |
parent | db2a61ab26f8dab5c9b8f27ae25f9b1ca5fe67b4 (diff) | |
download | samba-e16c9904c60bd7531ada1acd2396e56ee1213dea.tar.gz samba-e16c9904c60bd7531ada1acd2396e56ee1213dea.tar.bz2 samba-e16c9904c60bd7531ada1acd2396e56ee1213dea.zip |
s3-libsmbclient-examples Add tests for debug behaviour.
-rw-r--r-- | examples/libsmbclient/testctx.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/examples/libsmbclient/testctx.c b/examples/libsmbclient/testctx.c index 8820bc8342..cec9776ced 100644 --- a/examples/libsmbclient/testctx.c +++ b/examples/libsmbclient/testctx.c @@ -1,11 +1,26 @@ #include <libsmbclient.h> +#include <stdlib.h> +#include <stdio.h> void create_and_destroy_context (void) { + int i; SMBCCTX *ctx; ctx = smbc_new_context (); + /* Both should do the same thing */ + smbc_setOptionDebugToStderr(ctx, 1); + smbc_option_set(ctx, "debug_to_stderr", 1); + smbc_setDebug(ctx, 1); + i = smbc_getDebug(ctx); + if (i != 1) { + printf("smbc_getDebug() did not return debug level set\n"); + exit(1); + } + if (!smbc_getOptionDebugToStderr(ctx)) { + printf("smbc_setOptionDebugToStderr() did not stick\n"); + exit(1); + } smbc_init_context (ctx); - smbc_free_context (ctx, 1); } |