Skip to content

Commit

Permalink
newBlocksize test #2
Browse files Browse the repository at this point in the history
  • Loading branch information
WaterKnight committed Jul 15, 2018
1 parent ef1b047 commit 48ff52e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/test/java/systems/crigges/jmpq3test/MpqTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.file.Files;
import java.nio.file.OpenOption;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.util.Arrays;
Expand Down Expand Up @@ -343,11 +342,17 @@ private Set<File> getFiles(File dir) {

@Test()
public void newBlocksizeBufferOverflow() throws IOException {
File mpq = new File(MpqTests.class.getClassLoader().getResource("./mpqs/newBlocksizeBufferOverflow.w3x").getFile());
File mpq = new File(MpqTests.class.getClassLoader().getResource("newBlocksizeBufferOverflow/mpq/newBlocksizeBufferOverflow.w3x").getFile());

Files.copy(mpq.toPath(), mpq.toPath().resolveSibling("newBlocksizeBufferOverflow.mpq"), StandardCopyOption.REPLACE_EXISTING).toFile();
File targetMpq = mpq.toPath().resolveSibling("file1.mpq").toFile();

String resourceDir = "newBlocksizeBufferOverflowInsertions";
targetMpq.delete();

Files.copy(mpq.toPath(), targetMpq.toPath(), StandardCopyOption.REPLACE_EXISTING).toFile();

mpq = targetMpq;

String resourceDir = "newBlocksizeBufferOverflow/insertions";

Set<File> files = getFiles(new File(MpqTests.class.getClassLoader().getResource("./" + resourceDir + "/").getFile()));

Expand Down

0 comments on commit 48ff52e

Please sign in to comment.