1 #include <assert.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include "uvwasi.h"
5 
main(void)6 int main(void) {
7   uvwasi_t uvwasi;
8   uvwasi_options_t init_options;
9 
10   uvwasi_options_init(&init_options);
11   assert(init_options.in == 0);
12   assert(init_options.out == 1);
13   assert(init_options.err == 2);
14   assert(init_options.fd_table_size == 3);
15   assert(init_options.argc == 0);
16   assert(init_options.argv == NULL);
17   assert(init_options.envp == NULL);
18   assert(init_options.preopenc == 0);
19   assert(init_options.preopens == NULL);
20   assert(init_options.allocator == NULL);
21 
22   assert(0 == uvwasi_init(&uvwasi, &init_options));
23   /* Calling uvwasi_destroy() multiple times should be fine. */
24   uvwasi_destroy(&uvwasi);
25   uvwasi_destroy(&uvwasi);
26   uvwasi_destroy(&uvwasi);
27 
28   return 0;
29 }
30