git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
db2a61a
)
s3-libsmbclient-examples Add tests for debug behaviour.
author
Andrew Bartlett
<abartlet@samba.org>
Mon, 1 Nov 2010 09:30:33 +0000
(20:30 +1100)
committer
Andrew Bartlett
<abartlet@samba.org>
Tue, 2 Nov 2010 04:36:04 +0000
(
04:36
+0000)
examples/libsmbclient/testctx.c
patch
|
blob
|
history
diff --git
a/examples/libsmbclient/testctx.c
b/examples/libsmbclient/testctx.c
index 8820bc8342ed717f3c9f988fce41104f8134015d..cec9776ced2445bf1cb64804df5281e755a091d1 100644
(file)
--- a/
examples/libsmbclient/testctx.c
+++ b/
examples/libsmbclient/testctx.c
@@
-1,11
+1,26
@@
#include <libsmbclient.h>
#include <libsmbclient.h>
+#include <stdlib.h>
+#include <stdio.h>
void create_and_destroy_context (void)
{
void create_and_destroy_context (void)
{
+ int i;
SMBCCTX *ctx;
ctx = smbc_new_context ();
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_init_context (ctx);
-
smbc_free_context (ctx, 1);
}
smbc_free_context (ctx, 1);
}