projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tests: signedness -> signed
[babeltrace.git]
/
formats
/
ctf
/
metadata
/
ctf-parser-test.c
diff --git
a/formats/ctf/metadata/ctf-parser-test.c
b/formats/ctf/metadata/ctf-parser-test.c
index cfd847d016bb1641b305d3de13a58a0dc7e0d4e3..cab0d1645ca7f3ee2e0ec9e91974ea0595f7c7d9 100644
(file)
--- a/
formats/ctf/metadata/ctf-parser-test.c
+++ b/
formats/ctf/metadata/ctf-parser-test.c
@@
-19,6
+19,7
@@
#include <stdlib.h>
#include <stdio.h>
#include <glib.h>
#include <stdlib.h>
#include <stdio.h>
#include <glib.h>
+#include <errno.h>
#include "ctf-scanner.h"
#include "ctf-parser.h"
#include "ctf-ast.h"
#include "ctf-scanner.h"
#include "ctf-parser.h"
#include "ctf-ast.h"
@@
-33,17
+34,28
@@
int main(int argc, char **argv)
yydebug = 1;
scanner = ctf_scanner_alloc(stdin);
if (!scanner) {
yydebug = 1;
scanner = ctf_scanner_alloc(stdin);
if (!scanner) {
- fprintf(stderr, "Error allocating scanner\n");
- return -1;
+ fprintf(stdout, "Error allocating scanner\n");
+ return -ENOMEM;
+ }
+ ret = ctf_scanner_append_ast(scanner);
+ if (ret) {
+ fprintf(stdout, "Error creating AST\n");
+ goto end;
}
}
- ctf_scanner_append_ast(scanner);
- if (ctf_visitor_print_xml(stdout, 0, &scanner->ast->root)) {
- fprintf(stderr, "error visiting AST for XML output\n");
- ret = -1;
+ ret = ctf_visitor_print_xml(stdout, 0, &scanner->ast->root);
+ if (ret) {
+ fprintf(stdout, "Error visiting AST for XML output\n");
+ goto end;
}
}
- ctf_scanner_free(scanner);
+ ret = ctf_visitor_semantic_check(stdout, 0, &scanner->ast->root);
+ if (ret) {
+ fprintf(stdout, "Error in CTF semantic validation %d\n", ret);
+ goto end;
+ }
+end:
+ ctf_scanner_free(scanner);
return ret;
}
return ret;
}
This page took
0.026365 seconds
and
4
git commands to generate.