MCPcopy Create free account
hub / github.com/OpenPrinting/cups / do_ppd_tests

Function do_ppd_tests

cups/testppd.c:1404–1446  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1402 */
1403
1404static int /* O - Number of errors */
1405do_ppd_tests(const char *filename, /* I - PPD file */
1406 int num_options, /* I - Number of options */
1407 cups_option_t *options) /* I - Options */
1408{
1409 ppd_file_t *ppd; /* PPD file data */
1410 cups_page_header2_t header; /* Page header */
1411
1412
1413 printf("\"%s\": ", filename);
1414 fflush(stdout);
1415
1416 if ((ppd = ppdOpenFile(filename)) == NULL)
1417 {
1418 ppd_status_t status; /* Status from PPD loader */
1419 int line; /* Line number containing error */
1420
1421
1422 status = ppdLastError(&line);
1423
1424 puts("FAIL (bad PPD file)");
1425 printf(" %s on line %d\n", ppdErrorString(status), line);
1426
1427 return (1);
1428 }
1429
1430 ppdMarkDefaults(ppd);
1431 cupsMarkOptions(ppd, num_options, options);
1432
1433 if (cupsRasterInterpretPPD(&header, ppd, 0, NULL, NULL))
1434 {
1435 puts("FAIL (error from function)");
1436 puts(cupsRasterErrorString());
1437
1438 return (1);
1439 }
1440 else
1441 {
1442 puts("PASS");
1443
1444 return (0);
1445 }
1446}
1447
1448
1449/*

Callers 1

mainFunction · 0.85

Calls 7

ppdOpenFileFunction · 0.85
ppdLastErrorFunction · 0.85
ppdErrorStringFunction · 0.85
ppdMarkDefaultsFunction · 0.85
cupsMarkOptionsFunction · 0.85
cupsRasterInterpretPPDFunction · 0.85
cupsRasterErrorStringFunction · 0.85

Tested by

no test coverage detected