aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-02-21 14:47:36 +0100
committerSven Gothel <[email protected]>2014-02-21 14:47:36 +0100
commitd199e6cdbf1fe1283bad79f68d05a9037a91863b (patch)
treec9b5f489f44e75adb6beeea23f71fc97f98f0f79 /src/test/com/jogamp
parentb49859e5ea464a978812036bef05718e6ea00909 (diff)
WAVLoader: Use Bitstream and support big-endian RIFX; Fix ALutWAVLoaderTest
Diffstat (limited to 'src/test/com/jogamp')
-rw-r--r--src/test/com/jogamp/openal/test/junit/ALutWAVLoaderTest.java45
1 files changed, 15 insertions, 30 deletions
diff --git a/src/test/com/jogamp/openal/test/junit/ALutWAVLoaderTest.java b/src/test/com/jogamp/openal/test/junit/ALutWAVLoaderTest.java
index cda233d..7d8fa05 100644
--- a/src/test/com/jogamp/openal/test/junit/ALutWAVLoaderTest.java
+++ b/src/test/com/jogamp/openal/test/junit/ALutWAVLoaderTest.java
@@ -7,6 +7,7 @@ import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import org.junit.Test;
+import org.junit.Assert;
import com.jogamp.openal.test.resources.ResourceLocation;
import com.jogamp.openal.util.ALut;
@@ -23,39 +24,31 @@ public class ALutWAVLoaderTest {
ByteBuffer[] data = new ByteBuffer[1];
int[] freq = new int[1];
int[] loop = new int[1];
-
+
ALut.alutLoadWAVFile(ResourceLocation.getTestStream0(), format, data, size, freq, loop);
System.out.println("*** ALut.alutLoadWAV Stream0 size "+size[0]);
- assertEquals(size[0], ResourceLocation.getTestStream0Size());
-
- ALut.alutLoadWAVFile(ResourceLocation.getTestStream1(), format, data, size, freq, loop);
- System.out.println("*** ALut.alutLoadWAV Stream1 size "+size[0]);
- assertEquals(size[0], ResourceLocation.getTestStream1Size());
-
- ALut.alutLoadWAVFile(ResourceLocation.getTestStream2(), format, data, size, freq, loop);
- System.out.println("*** ALut.alutLoadWAV Stream2 size "+size[0]);
- assertEquals(size[0], ResourceLocation.getTestStream2Size());
-
+ Assert.assertTrue("Stream0 size "+ResourceLocation.getTestStream0Size()+" < "+size[0], size[0] <= ResourceLocation.getTestStream0Size());
+
ALut.alutLoadWAVFile(ResourceLocation.getTestStream3(), format, data, size, freq, loop);
System.out.println("*** ALut.alutLoadWAV Stream3 size "+size[0]);
- assertEquals(size[0], ResourceLocation.getTestStream3Size());
-
+ Assert.assertTrue("Stream3 size "+ResourceLocation.getTestStream3Size()+" < "+size[0], size[0] <= ResourceLocation.getTestStream3Size());
+
}
-
+
@Test
public void testWAVDataLoadStream() throws IOException {
WAVData wd0 = WAVData.loadFromStream(ResourceLocation.getTestStream0(), ResourceLocation.getTestStream0Size(), 1, 8, 22050, ByteOrder.LITTLE_ENDIAN, true);
System.out.println("*** WAVData.loadFrom Stream0 size "+wd0.data.limit());
assertEquals(wd0.data.limit(), ResourceLocation.getTestStream0Size());
-
+
WAVData wd1 = WAVData.loadFromStream(ResourceLocation.getTestStream1(), ResourceLocation.getTestStream1Size(), 2, 16, 44100, ByteOrder.BIG_ENDIAN, true);
System.out.println("*** WAVData.loadFrom Stream1 size "+wd1.data.limit());
assertEquals(wd1.data.limit(), ResourceLocation.getTestStream1Size());
-
+
WAVData wd2 = WAVData.loadFromStream(ResourceLocation.getTestStream2(), ResourceLocation.getTestStream2Size(), 2, 16, 44100, ByteOrder.LITTLE_ENDIAN, true);
System.out.println("*** WAVData.loadFrom Stream2 size "+wd2.data.limit());
assertEquals(wd2.data.limit(), ResourceLocation.getTestStream2Size());
-
+
WAVData wd3 = WAVData.loadFromStream(ResourceLocation.getTestStream3(), ResourceLocation.getTestStream3Size(), 2, 16, 44100, ByteOrder.LITTLE_ENDIAN, true);
System.out.println("*** WAVData.loadFrom Stream3 size "+wd3.data.limit());
assertEquals(wd3.data.limit(), ResourceLocation.getTestStream3Size());
@@ -66,23 +59,15 @@ public class ALutWAVLoaderTest {
public void testWAVLoaderLoadStream() throws IOException {
WAVData wd0 = WAVLoader.loadFromStream(ResourceLocation.getTestStream0());
System.out.println("*** WAVLoader.loadFrom Stream0 size "+wd0.data.limit());
- assertEquals(wd0.data.limit(), ResourceLocation.getTestStream0Size());
-
- WAVData wd1 = WAVLoader.loadFromStream(ResourceLocation.getTestStream1());
- System.out.println("*** WAVLoader.loadFrom Stream1 size "+wd1.data.limit());
- assertEquals(wd1.data.limit(), ResourceLocation.getTestStream1Size());
-
- WAVData wd2 = WAVLoader.loadFromStream(ResourceLocation.getTestStream2());
- System.out.println("*** WAVLoader.loadFrom Stream2 size "+wd2.data.limit());
- assertEquals(wd2.data.limit(), ResourceLocation.getTestStream2Size());
-
+ Assert.assertTrue("Stream0 size "+ResourceLocation.getTestStream0Size()+" < "+wd0.data.limit(), wd0.data.limit() <= ResourceLocation.getTestStream0Size());
+
WAVData wd3 = WAVLoader.loadFromStream(ResourceLocation.getTestStream3());
System.out.println("*** WAVLoader.loadFrom Stream3 size "+wd3.data.limit());
- assertEquals(wd3.data.limit(), ResourceLocation.getTestStream3Size());
+ Assert.assertTrue("Stream3 size "+ResourceLocation.getTestStream3Size()+" < "+wd3.data.limit()+" .. "+wd3.data, wd3.data.limit() <= ResourceLocation.getTestStream3Size());
}
-
+
// TODO test * LoadFile
-
+
public static void main(String args[]) throws IOException {
org.junit.runner.JUnitCore.main(ALutWAVLoaderTest.class.getName());
}