summaryrefslogtreecommitdiff
path: root/enigma/src/test
diff options
context:
space:
mode:
authorGravatar modmuss2023-11-28 09:00:33 +0000
committerGravatar GitHub2023-11-28 09:00:33 +0000
commit7622b753d2a99bd8f2bbb4568fd84ca9458ffba5 (patch)
treee3a5a6d2006787f2668e47bca34fb46beb40250c /enigma/src/test
parentUpdate deps (#535) (diff)
parentMerge branch 'upstream' into mapping-io (diff)
downloadenigma-fork-7622b753d2a99bd8f2bbb4568fd84ca9458ffba5.tar.gz
enigma-fork-7622b753d2a99bd8f2bbb4568fd84ca9458ffba5.tar.xz
enigma-fork-7622b753d2a99bd8f2bbb4568fd84ca9458ffba5.zip
Merge pull request #463 from NebelNidas/mapping-io
Initial Mapping-IO support
Diffstat (limited to 'enigma/src/test')
-rw-r--r--enigma/src/test/java/cuchaz/enigma/translation/mapping/TestReadWriteCycle.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/enigma/src/test/java/cuchaz/enigma/translation/mapping/TestReadWriteCycle.java b/enigma/src/test/java/cuchaz/enigma/translation/mapping/TestReadWriteCycle.java
index 681fd3f..25f11fb 100644
--- a/enigma/src/test/java/cuchaz/enigma/translation/mapping/TestReadWriteCycle.java
+++ b/enigma/src/test/java/cuchaz/enigma/translation/mapping/TestReadWriteCycle.java
@@ -4,6 +4,7 @@ import java.io.File;
4import java.io.IOException; 4import java.io.IOException;
5 5
6import org.junit.Assert; 6import org.junit.Assert;
7import org.junit.BeforeClass;
7import org.junit.Test; 8import org.junit.Test;
8 9
9import cuchaz.enigma.ProgressListener; 10import cuchaz.enigma.ProgressListener;
@@ -62,7 +63,7 @@ public class TestReadWriteCycle {
62 mappingFormat.write(testMappings, tempFile.toPath(), ProgressListener.none(), parameters); 63 mappingFormat.write(testMappings, tempFile.toPath(), ProgressListener.none(), parameters);
63 Assert.assertTrue("Written file not created", tempFile.exists()); 64 Assert.assertTrue("Written file not created", tempFile.exists());
64 65
65 EntryTree<EntryMapping> loadedMappings = mappingFormat.read(tempFile.toPath(), ProgressListener.none(), parameters); 66 EntryTree<EntryMapping> loadedMappings = mappingFormat.read(tempFile.toPath(), ProgressListener.none(), parameters, null);
66 67
67 Assert.assertTrue("Loaded mappings don't contain testClazz", loadedMappings.contains(testClazz.a)); 68 Assert.assertTrue("Loaded mappings don't contain testClazz", loadedMappings.contains(testClazz.a));
68 Assert.assertTrue("Loaded mappings don't contain testField1", loadedMappings.contains(testField1.a)); 69 Assert.assertTrue("Loaded mappings don't contain testField1", loadedMappings.contains(testField1.a));
@@ -87,6 +88,11 @@ public class TestReadWriteCycle {
87 tempFile.delete(); 88 tempFile.delete();
88 } 89 }
89 90
91 @BeforeClass
92 public static void setup() {
93 System.getProperties().setProperty("enigma.use_mappingio", "false");
94 }
95
90 @Test 96 @Test
91 public void testEnigmaFile() throws IOException, MappingParseException { 97 public void testEnigmaFile() throws IOException, MappingParseException {
92 testReadWriteCycle(MappingFormat.ENIGMA_FILE, true, ".enigma"); 98 testReadWriteCycle(MappingFormat.ENIGMA_FILE, true, ".enigma");