| 1402 | */ |
| 1403 | |
| 1404 | static int /* O - Number of errors */ |
| 1405 | do_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 | /* |
no test coverage detected