Repository navigation
Conversation
Local coverage measurement,
Files newly at or near 100% that weren't before: This is my own gcovr methodology, not codecov's exact algorithm, so codecov's reported numbers may differ - but the underlying coverage gain is real and verified, each commit checked in isolation to confirm it actually hits the specific line/branch it targets, not just returns correct output through some other path. |
veloman-yunkan
left a comment
There was a problem hiding this comment.
Some commit messages mention "this PR" while obviously referring to a different PR.
FileCompound::locate(offset,size) queried the part map with a single wide Range covering the whole read. less_range's comparator isn't a strict weak ordering for that case: the wide query can compare "equivalent" to two disjoint stored part ranges at once, breaking transitivity. With 3+ parts this can land lower_bound on the wrong part, underflowing the local-offset computation in MultiPartFileReader (PR openzim#1126's expanded multiPartReads test hits this on libc++). Fixed by querying the two boundary points instead (locate(offset) above already does this safely for a single point). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
19cdba3 to
c1c944e
Compare
FileCompound::locate(offset,size) queried the part map with a single wide Range covering the whole read. less_range's comparator isn't a strict weak ordering for that case: the wide query can compare "equivalent" to two disjoint stored part ranges at once, breaking transitivity. With 3+ parts this can land lower_bound on the wrong part, underflowing the local-offset computation in MultiPartFileReader (PR openzim#1126's expanded multiPartReads test hits this on libc++). Fixed by querying the two boundary points instead (locate(offset) above already does this safely for a single point). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
c1c944e to
64e764e
Compare
64e764e to
a5b214a
Compare
|
@veloman-yunkan I would like to consider closing this PR, I see no opportunity to get a full fix within a few iterations. What do you think? |
FileCompound::locate(offset,size) queried the part map with a single wide Range covering the whole read. less_range's comparator isn't a strict weak ordering for that case: the wide query can compare "equivalent" to two disjoint stored part ranges at once, breaking transitivity. With 3+ parts this can land lower_bound on the wrong part, underflowing the local-offset computation in MultiPartFileReader (PR openzim#1126's expanded multiPartReads test hits this on libc++). Fixed by querying the two boundary points instead (locate(offset) above already does this safely for a single point). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Scanned overall project coverage for easy, self-contained gaps and added tests for each, checking real content/behavior rather than shape (hex-string length, non-empty, substring) wherever a reviewer flagged that distinction: - Archive::getChecksum(): checks the archive's actual checksum value, one expected hex digest per zim-testing-suite category. - Archive::getIllustrationItem(size): the delegating overload and the not-found EntryNotFound throw, both previously uncalled. - SearchIterator::getDbData(): the uninitialized-guard path. - Reader::getMemorySize(): across all three Reader implementations, branching on real type (dynamic_cast) rather than factory identity. - MultiPartFileReader: small/whole/boundary/large reads, aligned or not, against a synthetic 3-part compound (all 8 access patterns). - Entry::getItem()'s redirect guard and multi-hop redirect chains. - zim::getVersions()/printVersions(): full expected content, built the same way src/version.cpp does, not substring/non-empty checks. - StringItem/FileItem round-trip, Item::getHints()'s base default, and getAmendedHints()'s FRONT_ARTICLE/COMPRESS mimetype guesses (both the zero and non-zero cases for each). Verified: full local build + `meson test`, all passing. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
a5b214a to
b0ddd96
Compare
addressed @veloman-yunkan comments. |
Split out of #1119 - these tests aren't related to that PR's fd-based Xapian fix, they cover pre-existing gaps found while looking at overall project coverage.
Three small, targeted additions, each amending an existing test rather than adding new fixtures where one already existed:
Archive::getChecksum()had zero test coverage anywhere - added a check that it returns a valid 32-char hex digest.Archive::getIllustrationItem(size)(the size-only overload, and its not-foundEntryNotFoundthrow) was never called by any test, despiteopenCreatedArchivealready building an archive with two real illustrations to exercise it on.SearchIterator::getDbData()'s uninitialized-guard path was the one method missing from the otherwise-thoroughsearch_iterator.uninitializedtest.(
getIllustrationSizes()andSearchIterator::getSize()are both deprecated - left alone rather than fighting-Werrorfor soon-to-be-removed APIs.)Verified: full local build +
meson test, 31/31 passing, on top of plainmain.