mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-28 02:25:33 +00:00
Project renamed to Free Flash Decompiler.
Test code moved to new dir.
This commit is contained in:
29
trunk/test/com/jpexs/decompiler/flash/TestABCStream.java
Normal file
29
trunk/test/com/jpexs/decompiler/flash/TestABCStream.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package com.jpexs.decompiler.flash;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABCInputStream;
|
||||
import com.jpexs.decompiler.flash.abc.ABCOutputStream;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import junit.framework.TestCase;
|
||||
import org.junit.Test;
|
||||
|
||||
public class TestABCStream extends TestCase {
|
||||
@Test
|
||||
public void testU30() {
|
||||
try {
|
||||
long number = 1531;
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
ABCOutputStream aos = new ABCOutputStream(baos);
|
||||
aos.writeU30(number);
|
||||
aos.close();
|
||||
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
|
||||
ABCInputStream ais = new ABCInputStream(bais);
|
||||
assertEquals(number, ais.readU30());
|
||||
assertEquals(0, bais.available());
|
||||
ais.close();
|
||||
} catch (IOException ex) {
|
||||
fail();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user