s3:libsmb: Check return code of cli_credentials_guess()
[Samba.git] / examples / libsmbclient / testctx.c
blob7f27fbd7c9cfbdbe7c252f654de7d2cd0f42b44e
1 #include <libsmbclient.h>
2 #include <stdlib.h>
3 #include <stdio.h>
4 #include <string.h>
6 static void create_and_destroy_context (void)
8 int i;
9 SMBCCTX *ctx;
10 ctx = smbc_new_context ();
11 /* Both should do the same thing */
12 smbc_setOptionDebugToStderr(ctx, 1);
13 smbc_option_set(ctx, strdup("debug_to_stderr"), 1);
14 smbc_setDebug(ctx, 1);
15 i = smbc_getDebug(ctx);
16 if (i != 1) {
17 printf("smbc_getDebug() did not return debug level set\n");
18 exit(1);
20 if (!smbc_getOptionDebugToStderr(ctx)) {
21 printf("smbc_setOptionDebugToStderr() did not stick\n");
22 exit(1);
24 smbc_init_context (ctx);
25 smbc_free_context (ctx, 1);
28 int main (int argc, char **argv)
30 create_and_destroy_context ();
31 create_and_destroy_context ();
32 return 0;