1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 12:25:09 +03:00

testModule: exit if the module can't be opened

Instead of silently exiting with success when the module cannot be found,
emit a message and fail the test.
This commit is contained in:
Ross Burton 2022-12-06 14:33:32 +00:00
parent b1b0df6e9b
commit 21f2ce7112

View File

@ -52,8 +52,11 @@ int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
(const xmlChar*)LIBXML_MODULE_EXTENSION);
module = xmlModuleOpen((const char*)filename, 0);
if (module)
{
if (module == NULL) {
fprintf(stderr, "Failed to open module\n");
return(1);
}
if (xmlModuleSymbol(module, "hello_world", (void **) &hello_world)) {
fprintf(stderr, "Failure to lookup\n");
return(1);
@ -66,7 +69,6 @@ int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
(*hello_world)();
xmlModuleClose(module);
}
xmlMemoryDump();