build: a more portable way of finding waf in makefiles
[sfrench/samba-autobuild/.git] / examples / libsmbclient / testctx.c
1 #include <libsmbclient.h>
2 #include <stdlib.h>
3 #include <stdio.h>
4
5 void create_and_destroy_context (void)
6 {
7   int i;
8   SMBCCTX *ctx;
9   ctx = smbc_new_context ();
10   /* Both should do the same thing */
11   smbc_setOptionDebugToStderr(ctx, 1);
12   smbc_option_set(ctx, "debug_to_stderr", 1);
13   smbc_setDebug(ctx, 1);
14   i = smbc_getDebug(ctx);
15   if (i != 1) { 
16           printf("smbc_getDebug() did not return debug level set\n");
17           exit(1);
18   }
19   if (!smbc_getOptionDebugToStderr(ctx)) {
20           printf("smbc_setOptionDebugToStderr() did not stick\n");
21           exit(1);
22   }
23   smbc_init_context (ctx);
24   smbc_free_context (ctx, 1);
25 }
26
27 int main (int argc, char **argv)
28 {
29   create_and_destroy_context ();
30   create_and_destroy_context ();
31   return 0;
32 }