Add regression test - #9397
Conversation
|
@mergify backport 0.28.x |
🟠 Waiting for conditions to matchDetails
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9397 +/- ##
==========================================
+ Coverage 65.48% 65.51% +0.02%
==========================================
Files 116 116
Lines 21534 21535 +1
Branches 10712 10712
==========================================
+ Hits 14102 14108 +6
+ Misses 5141 5134 -7
- Partials 2291 2293 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR adds regression coverage for the Canon MakerNote std::stoul exception-handling fix introduced in PR #9320, ensuring exiv2 -pa output remains stable and does not crash on crafted non-numeric Canon SerialNumber values.
Changes:
- Added a new system test that prints
Exif.Canon.SerialNumberfrompr_9320.jpgand asserts clean execution/output. - Added a reference
-paoutput file forpr_9320.jpgundertest_reference_files.
Show a summary per file
| File | Description |
|---|---|
| tests/bugfixes/github/test_pr_9320.py | New regression test covering exiv2 -pa -K Exif.Canon.SerialNumber for PR #9320. |
| test/data/test_reference_files/pr_9320.jpg.out | Adds the expected -pa reference output for the pr_9320.jpg fixture. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/3 changed files
- Comments generated: 1
- Review effort level: Low
| import system_tests | ||
|
|
||
| class TestCanonException0x000c(metaclass=system_tests.CaseMeta): |
03142c9 to
e782660
Compare
|
Tick the box to add this pull request to the merge queue (same as
|
| class TestCanonException0x000c(metaclass=system_tests.CaseMeta): | ||
| """Regression test for this PR: pr_9320.jpg""" | ||
| url = "https://github.com/Exiv2/exiv2/pull/9320" |
| commands = [ | ||
| "$exiv2 -pa -K Exif.Canon.SerialNumber $filename", | ||
| ] | ||
| stdout = [ | ||
| "Exif.Canon.SerialNumber Ascii 6 bogus\n", | ||
| ] |
| @@ -0,0 +1,118 @@ | |||
| Exif.Image.Make Ascii 6 Canon Canon | |||
| Exif.CanonSi.BulbDuration Short 1 0 0 | ||
| Exif.Canon.ImageType Ascii 32 IMG:EOS D30 JPEG IMG:EOS D30 JPEG | ||
| Exif.Canon.FirmwareVersion Ascii 24 Firmware Version Alpha Firmware Version Alpha | ||
| Exif.Canon.SerialNumber Ascii 6 bogus bogus |
| Exif.Thumbnail.YResolution Rational 1 180/1 180 | ||
| Exif.Thumbnail.ResolutionUnit Short 1 2 inch | ||
| Exif.Thumbnail.JPEGInterchangeFormat Long 1 1652 1652 | ||
| Exif.Thumbnail.JPEGInterchangeFormatLength Long 1 13824 13824 |
Add a regression test for #9320