Skip to content

Commit 21c0cfc

Browse files
committed
#59: add test that checks whether file can now be extracted
1 parent 2ad7d9a commit 21c0cfc

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

src/test/combine_test_create.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,31 @@ SCENARIO("reading an existing archive", "[combine]")
195195
}
196196
}
197197

198+
199+
SCENARIO("reading an archive with zero sized entries", "[combine]")
200+
{
201+
GIVEN("a user loads a file with zero sized entries")
202+
{
203+
CombineArchive archive;
204+
REQUIRE(archive.getManifest() == NULL);
205+
REQUIRE(archive.initializeFromArchive(getTestFile("test-data/issue_59.omex")) == true);
206+
207+
// remove file if existing
208+
if (checkFileExists("sim.sedml"))
209+
std::remove("sim.sedml");
210+
211+
THEN("the file is extracted as zero sized file")
212+
{
213+
// extract zero sized file
214+
archive.extractEntry("sim.sedml", ".");
215+
REQUIRE (checkFileExists("sim.sedml") == true);
216+
217+
// remove it again
218+
std::remove("sim.sedml");
219+
}
220+
}
221+
}
222+
198223
SCENARIO("creating a combine archive", "[combine]")
199224
{
200225
CombineArchive archive;

src/test/test-data/issue_59.omex

653 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)