From: Michael R Sweet Date: Fri, 17 Oct 2025 17:43:32 +0000 (-0400) Subject: Show PPD load errors, stop test early for hard errors. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=39ea1c7e1a646aa0ce81cc651a8f33f22b1eae48;p=thirdparty%2Fcups.git Show PPD load errors, stop test early for hard errors. --- diff --git a/scheduler/testmime.c b/scheduler/testmime.c index b53968bbd2..f159acde07 100644 --- a/scheduler/testmime.c +++ b/scheduler/testmime.c @@ -70,6 +70,9 @@ main(int argc, // I - Number of command-line args mime = mimeLoad(argv[i], filter_path); testEnd(mime != NULL); + if (!mime) + return (1); + if (ppd) add_ppd_filters(mime, ppd); } @@ -88,10 +91,21 @@ main(int argc, // I - Number of command-line args if (i < argc) { testBegin("ppdOpenFile(\"%s\")", argv[i]); - ppd = ppdOpenFile(argv[i]); - testEnd(ppd != NULL); - - if (mime) + if ((ppd = ppdOpenFile(argv[i])) != NULL) + { + testEnd(true); + } + else + { + ppd_status_t status; // PPD error + int linenum;// Line number of error + + status = ppdLastError(&linenum); + testEndMessage(false, "%s on line %d", ppdErrorString(status), linenum); + return (1); + } + + if (mime && ppd) add_ppd_filters(mime, ppd); } } @@ -102,6 +116,8 @@ main(int argc, // I - Number of command-line args testBegin("mimeLoad(\"../conf\", \"%s\")", filter_path); mime = mimeLoad("../conf", filter_path); testEnd(mime != NULL); + if (!mime) + return (1); } if (ppd) @@ -146,6 +162,9 @@ main(int argc, // I - Number of command-line args mime = mimeLoad("../conf", filter_path); testEnd(mime != NULL); + if (!mime) + return (1); + if (ppd) add_ppd_filters(mime, ppd); }