| 1 |
/* File: test_result_check_xml.c; Copyright and License: see below */ |
| 2 |
|
| 3 |
#include "u8/u8_trace.h" |
| 4 |
#include "test_expect.h" |
| 5 |
#include <glib.h> |
| 6 |
|
| 7 |
int test_result_check_xml_validate_xml( const char* xml_string ) |
| 8 |
{ |
| 9 |
bool success; |
| 10 |
|
| 11 |
static GMarkupParser DEV_NULL_PARSER = { |
| 12 |
.start_element=NULL, |
| 13 |
.end_element=NULL, |
| 14 |
.text=NULL, |
| 15 |
.passthrough=NULL, |
| 16 |
.error=NULL |
| 17 |
}; |
| 18 |
|
| 19 |
GMarkupParseContext *my_ctx = g_markup_parse_context_new ( &DEV_NULL_PARSER, 0, NULL, NULL ); |
| 20 |
TEST_ENVIRONMENT_ASSERT( NULL != my_ctx ); |
| 21 |
success = g_markup_parse_context_parse ( my_ctx, xml_string, strlen(xml_string), NULL ); |
| 22 |
success &= g_markup_parse_context_end_parse ( my_ctx, NULL ); |
| 23 |
g_markup_parse_context_free( my_ctx ); |
| 24 |
|
| 25 |
return ( success ? 0 : -1 ); |
| 26 |
} |
| 27 |
|
| 28 |
|
| 29 |
/* |
| 30 |
* Copyright 2020-2026 Andreas Warnke |
| 31 |
* |
| 32 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
| 33 |
* you may not use this file except in compliance with the License. |
| 34 |
* You may obtain a copy of the License at |
| 35 |
* |
| 36 |
* http://www.apache.org/licenses/LICENSE-2.0 |
| 37 |
* |
| 38 |
* Unless required by applicable law or agreed to in writing, software |
| 39 |
* distributed under the License is distributed on an "AS IS" BASIS, |
| 40 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 41 |
* See the License for the specific language governing permissions and |
| 42 |
* limitations under the License. |
| 43 |
*/ |