projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tests: improve trace match reporting
[lttng-tools.git]
/
tests
/
utils
/
xml-utils
/
validate_xml.cpp
diff --git
a/tests/utils/xml-utils/validate_xml.cpp
b/tests/utils/xml-utils/validate_xml.cpp
index bb67e56e17edea75706b56c50ec072c49f2433be..887f7af524c146a2f1f6d8b5ecd2ee018cc981c3 100644
(file)
--- a/
tests/utils/xml-utils/validate_xml.cpp
+++ b/
tests/utils/xml-utils/validate_xml.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (C) 2014
Jonathan Rajotte <jonathan.r.julien@gmail.com>
+ * Copyright (C) 2014
EfficiOS Inc.
*
* SPDX-License-Identifier: LGPL-2.1-only
*
*
* SPDX-License-Identifier: LGPL-2.1-only
*
@@
-25,21
+25,24
@@
#include <libxml/parser.h>
#include <lttng/lttng-error.h>
#include <libxml/parser.h>
#include <lttng/lttng-error.h>
-#include <common/macros.h>
+#include <common/macros.h
pp
>
+namespace {
struct validation_ctx {
xmlSchemaParserCtxtPtr parser_ctx;
xmlSchemaPtr schema;
xmlSchemaValidCtxtPtr schema_validation_ctx;
};
struct validation_ctx {
xmlSchemaParserCtxtPtr parser_ctx;
xmlSchemaPtr schema;
xmlSchemaValidCtxtPtr schema_validation_ctx;
};
+} /* namespace */
enum command_err_code {
CMD_SUCCESS = 0,
CMD_ERROR
};
enum command_err_code {
CMD_SUCCESS = 0,
CMD_ERROR
};
-static
-void xml_error_handler(void *ctx, const char *format, ...)
+static ATTR_FORMAT_PRINTF(2, 3)
+void xml_error_handler(void *ctx __attribute__((unused)),
+ const char *format, ...)
{
char *err_msg;
va_list args;
{
char *err_msg;
va_list args;
@@
-144,14
+147,16
@@
static int validate_xml(const char *xml_file_path, struct validation_ctx *ctx)
ret = CMD_SUCCESS;
end:
ret = CMD_SUCCESS;
end:
+ if (doc) {
+ xmlFreeDoc(doc);
+ }
return ret;
return ret;
-
-
}
}
-int main(int argc, char **argv, char *env[])
+
+int main(int argc, char **argv)
{
int ret;
{
int ret;
- struct validation_ctx ctx = {
0
};
+ struct validation_ctx ctx = {};
/* Check if we have all argument */
if (argc < 3) {
/* Check if we have all argument */
if (argc < 3) {
This page took
0.044629 seconds
and
4
git commands to generate.