Skip to content

test: add regression unit test for embedded zim checksum verification - #1143

Open
sundeep8967 wants to merge 1 commit into
openzim:mainfrom
sundeep8967:fix/embedded-zim-checksum-test
Open

sundeep8967 wants to merge 1 commit into
openzim:mainfrom
sundeep8967:fix/embedded-zim-checksum-test

Conversation

@sundeep8967

Copy link
Copy Markdown

Description

Fixes #812

As suggested by @kelson42 and following the implementation of logical archive reading in FileImpl::verify (commit afdde72b), this PR adds the regression unit test checksumOfEmbeddedZim in test/archive.cpp.

The test opens small.zim.embedded at offset 8 via zim::FdInput(fd, 8, normalArchive.getFilesize()) and verifies that embeddedArchive.check() succeeds and evaluates identically to normalArchive.check().

Testing

  • Unit test ZimArchive.checksumOfEmbeddedZim added in test/archive.cpp.
  • Exercises Archive::check() against existing test artifact small.zim.embedded.

Add checksumOfEmbeddedZim test using small.zim.embedded to verify
that calling Archive::check() on an embedded ZIM file with an initial
offset succeeds.

Fixes openzim#812
Signed-off-by: sundeep8967 <sundeep8967@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Libzim fails to check embeded zim file.

1 participant