mirror of
https://github.com/samba-team/samba.git
synced 2025-01-21 18:04:06 +03:00
s3-libsmbclient-examples Add tests for debug behaviour.
This commit is contained in:
parent
db2a61ab26
commit
e16c9904c6
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user