Skip to content
This repository was archived by the owner on Jun 14, 2019. It is now read-only.

Commit df5cb4a

Browse files
author
Aaron Leung
committed
Test to see whether or not there are memory leaks.
1 parent 9d10d03 commit df5cb4a

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

loop.c

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#include <stdio.h>
2+
#include "sass_interface.h"
3+
4+
int main(int argc, char** argv)
5+
{
6+
if (argc < 2) {
7+
printf("Hey, I need an input file!\n");
8+
return 0;
9+
}
10+
11+
while (1) {
12+
struct sass_file_context* ctx = sass_new_file_context();
13+
ctx->options.include_paths = "::/blah/bloo/fuzz:/slub/flub/chub::/Users/Aaron/dev/libsass/::::/huzz/buzz:::";
14+
ctx->options.output_style = SASS_STYLE_NESTED;
15+
ctx->input_path = argv[1];
16+
17+
sass_compile_file(ctx);
18+
19+
if (ctx->error_status) {
20+
if (ctx->error_message) printf("%s", ctx->error_message);
21+
else printf("An error occured; no error message available.\n");
22+
break;
23+
}
24+
else if (ctx->output_string) {
25+
continue;
26+
}
27+
else {
28+
printf("Unknown internal error.\n");
29+
break;
30+
}
31+
32+
sass_free_file_context(ctx);
33+
}
34+
return 0;
35+
}

0 commit comments

Comments
 (0)