test(save): pin exact FPDF_SaveAsCopy flag values#48
Closed
billdenney wants to merge 1 commit into
Closed
Conversation
Stricter counterpart to the "honours ... flags" test in test-mut-save.R, which only asserts a save flag is accepted without error and therefore cannot detect a wrong flag *value*. The two value-pinning tests here pass today and lock in the chromium/7857 bitmask (FPDF_REMOVE_SECURITY = 4, not the old 3; FPDF_SUBSET_NEW_FONTS = 8). They would have caught the silent no-op that existed while the package was pinned to chromium/7202, where those flags were introduced (commit 41f348e) with 7857 values that did not match the 7202 binary. See dev/pdfium-7857-api-delta.md §C-3. The third test is skipped pending future work: it pins the *behaviour* of remove_security (the saved copy must carry no /Encrypt dict) and needs an encrypted.pdf fixture. To enable it: add an owner-password fixture to tools/build-fixtures.R + inst/extdata/fixtures/, then delete the skip(). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Member
Author
|
Incorporated into #43 |
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.
Stricter counterpart to the "honours ... flags" test in test-mut-save.R, which only asserts a save flag is accepted without error and therefore cannot detect a wrong flag value. The two value-pinning tests here pass today and lock in the chromium/7857 bitmask (FPDF_REMOVE_SECURITY = 4, not the old 3; FPDF_SUBSET_NEW_FONTS = 8). They would have caught the silent no-op that existed while the package was pinned to chromium/7202, where those flags were introduced (commit 41f348e) with 7857 values that did not match the 7202 binary. See dev/pdfium-7857-api-delta.md §C-3.
The third test is skipped pending future work: it pins the behaviour of remove_security (the saved copy must carry no /Encrypt dict) and needs an encrypted.pdf fixture. To enable it: add an owner-password fixture to tools/build-fixtures.R + inst/extdata/fixtures/, then delete the skip().
What changed
Why
Test coverage
covr::package_coverage()).src/, the change runs cleanly under AddressSanitizer (.github/workflows/cpp-asan.yaml) and valgrind (.github/workflows/valgrind.yaml).API stability
Decision records
Checklist
pre-commit run --all-filespasses locally.R CMD check --as-cranis clean (0 errors / 0 warnings).devtools::document().NEWS.mdupdated under "(development version)".