Repository navigation
test_ppd_generator: give the printer-make-and-model checks a model - #96
Merged
tillkamppeter merged 1 commit intoNov 2, 2026
Merged
Conversation
The three printer-make-and-model checks added with ppd_escape_string() in 0598346 (OpenPrinting#89) fail on every CI leg. ppdCreatePPDFromIPP2() cuts the make and model at the first control character or double quote before escaping, so their inputs end up as a single word ("Acme", or "Acme\Model" in the backslash case). With no model part the generator falls back to the make_model argument and then to "Unknown", and the Acme lines the checks look for are never written. Give each input a make and a model before its payload, and check what the generator writes now: for the newline and the quote, that the value ends where it is cut and nothing of the payload follows; for the backslash, which reaches ppd_escape_string(), that it is doubled in *Manufacturer and *ModelName. The generator itself is unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As discussed on #94: this fixes the three
printer-make-and-modelchecks intest_ppd_generatorthat #89 added ('\n','"'and'\\'). They fail on every Build & Test leg on master.ppdCreatePPDFromIPP2()cuts the make and model at the first control character or double quote before escaping. Each input ended up as a single word: "Acme", or "Acme\Model" in the backslash case. With no model part, the generator falls back to themake_modelargument and then to "Unknown". So the Acme lines the checks look for are never written. The generated PPD never had an injected line; the inputs just needed a model.Changes (test only,
ppd/ppd-generator.cis untouched):"Acme Laser\n...","Acme Laser\" ...","Acme\\Model Laser").*Manufacturer: "Acme",*ModelName: "Acme Laser",*Product: "(Acme Laser)") and that none of the payload is written.ppd_escape_string(): the check verifies that it is doubled in*Manufacturerand*ModelName.make checkpasses (13/13), andtest_ppd_generatoralso passes under ASan/UBSan. With master's test file, the same three checks fail as in CI.