AS3: Tests

This commit is contained in:
Jindra Petk
2013-02-28 22:16:22 +01:00
parent 743cf62b85
commit b85b396b2a
13 changed files with 1753 additions and 461 deletions

View File

@@ -0,0 +1,33 @@
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 static org.testng.Assert.*;
import org.testng.annotations.Test;
/**
*
* @author JPEXS
*/
public class ABCStreamTest {
@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();
}
}
}