diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rwxr-xr-x | make/build.xml | 11 | ||||
-rw-r--r-- | nbproject/project.xml | 2 | ||||
-rw-r--r-- | test/build.xml | 59 | ||||
-rw-r--r-- | test/lib/junit.jar | bin | 121070 -> 0 bytes | |||
-rw-r--r-- | test/src/com/jogamp/openal/ALTest.java | 850 |
6 files changed, 246 insertions, 677 deletions
@@ -1,4 +1,5 @@ build test/classes +test/results nbproject/private javadoc_public/
\ No newline at end of file diff --git a/make/build.xml b/make/build.xml index f14f7ad..70c42c6 100755 --- a/make/build.xml +++ b/make/build.xml @@ -369,7 +369,7 @@ <!-- Now check for the presence of one well-known file --> <uptodate property="java.generate.skip" - targetfile="${src.generated.java}/net/java/games/joal/AL.java"> + targetfile="${src.generated.java}/com/jogamp/openal/AL.java"> <srcfiles refid="stub.includes.dependencies.fileset.1" /> <srcfiles refid="stub.includes.dependencies.fileset.2" /> <srcfiles refid="stub.includes.dependencies.fileset.3" /> @@ -549,8 +549,7 @@ <!-- Build the jar excluding any build specific classes. --> <jar manifest="tempversion" destfile="${joal.jar}"> <fileset dir="${classes}"> - <include name="net/java/games/**" /> - <include name="com/sun/gluegen/runtime/**" /> + <include name="com/jogamp/openal/**" /> </fileset> </jar> <delete file="tempversion"/> @@ -612,7 +611,7 @@ <delete file="../${rootrel.build}/joal-${version-string}-src.zip" /> <zip destfile="../${rootrel.build}/joal-${version-string}-src.zip" basedir="../.." - includes="gluegen/LICENSE.txt,gluegen/doc/**,gluegen/make/**,gluegen/src/**,joal/README.txt,joal/LICENSE.txt,joal/make/**,joal/src/**,joal/${rootrel.build}/gensrc/classes/net/java/games/joal/AL.java,joal/${rootrel.build}/gensrc/classes/net/java/games/joal/ALC.java,joal/${rootrel.build}/gensrc/classes/net/java/games/joal/ALCConstants.java,joal/${rootrel.build}/gensrc/classes/net/java/games/joal/ALCcontext.java,joal/${rootrel.build}/gensrc/classes/net/java/games/joal/ALCdevice.java,joal/${rootrel.build}/gensrc/classes/net/java/games/joal/ALConstants.java" + includes="gluegen/LICENSE.txt,gluegen/doc/**,gluegen/make/**,gluegen/src/**,joal/README.txt,joal/LICENSE.txt,joal/make/**,joal/src/**,joal/${rootrel.build}/gensrc/classes/com/jogamp/openal/**" excludes="**/*.class,**/*~" /> </target> @@ -709,9 +708,7 @@ --> <target name="test" depends="all"> - <ant dir="../test" target="compile"/> - <ant dir="../test" target="runOpenALTest"/> - <ant dir="../test" target="runSound3DTest"/> + <ant dir="../test" target="test"/> </target> </project> diff --git a/nbproject/project.xml b/nbproject/project.xml index 651bd11..bb958bd 100644 --- a/nbproject/project.xml +++ b/nbproject/project.xml @@ -86,7 +86,7 @@ <compilation-unit> <package-root>test/src</package-root> <unit-tests/> - <classpath mode="compile">../gluegen/build/gluegen-rt.jar:build/classes:test/lib/junit.jar</classpath> + <classpath mode="compile">../gluegen/build/gluegen-rt.jar:build/classes:../gluegen/make/lib/junit.jar</classpath> <source-level>1.5</source-level> </compilation-unit> </java-data> diff --git a/test/build.xml b/test/build.xml index 4445eb5..9b037f9 100644 --- a/test/build.xml +++ b/test/build.xml @@ -33,51 +33,42 @@ * design, construction, operation or maintenance of any nuclear facility. --> -<project name="Sun Games Initiative Client Technologies" basedir="." default="all"> +<project name="tests" basedir="." default="all"> <target name="init"> - <mkdir dir="classes"/> + <mkdir dir="classes"/> </target> + <property name="junit.path" value="${basedir}/${gluegen.root}/make/lib/junit.jar"/> + <target name="compile" depends="init"> - <javac debug="true" srcdir="./src" classpath="../build/joal.jar;lib/junit.jar" destdir="classes"/> + <javac debug="true" srcdir="./src" destdir="classes" includeantruntime="false" + classpath="${gluegen.root}/build/gluegen-rt.jar;../build/joal.jar;${junit.path}"/> </target> <target name="clean"> - <delete dir="classes"/> + <delete dir="classes"/> </target> - <target name="runOpenALTest" depends="compile"> - <java classname="OpenALTest" fork="true"> - <classpath> - <pathelement location="../build/joal.jar"/> - <pathelement location="lib/junit.jar"/> - <pathelement location="classes"/> - </classpath> - <jvmarg value="-Djava.library.path=${basedir}/../build/obj"/> - </java> - </target> + <target name="test" depends="compile"> + <mkdir dir="${basedir}/results"/> + <junit forkmode="once" showoutput="true" fork="true" includeAntRuntime="true"> + <jvmarg value="-Djava.library.path=${basedir}/${gluegen.root}/build/obj:${basedir}/../build/obj"/> + <batchtest todir="${basedir}/results"> + <fileset dir="${basedir}/classes"> + <include name="com/jogamp/openal/**Test*"/> + <!--TODO convert to junit --> + <exclude name="com/jogamp/openal/OpenALTest*"/> + <exclude name="com/jogamp/openal/Sound3DTest*"/> + </fileset> + <formatter usefile="false" type="plain"/> + <formatter usefile="true" type="xml"/> + </batchtest> + <classpath> + <path path="${gluegen.root}/build/gluegen-rt.jar:../build/joal.jar:${basedir}/classes:${junit.path}"/> + </classpath> + </junit> - <target name="runALTest" depends="compile"> - <java classname="junit.textui.TestRunner" fork="true"> - <classpath> - <pathelement location="../build/joal.jar"/> - <pathelement location="lib/junit.jar"/> - <pathelement location="classes"/> - </classpath> - <jvmarg value="-Djava.library.path=${basedir}/../build/obj"/> - <arg value="com.jogamp.openal.ALTest" /> - </java> </target> - <target name="runSound3DTest" depends="compile"> - <java classname="Sound3DTest" fork="true"> - <classpath> - <pathelement location="../build/joal.jar"/> - <pathelement location="lib/junit.jar"/> - <pathelement location="classes"/> - </classpath> - <jvmarg value="-Djava.library.path=${basedir}/../build/obj"/> - </java> - </target> </project> diff --git a/test/lib/junit.jar b/test/lib/junit.jar Binary files differdeleted file mode 100644 index 674d71e..0000000 --- a/test/lib/junit.jar +++ /dev/null diff --git a/test/src/com/jogamp/openal/ALTest.java b/test/src/com/jogamp/openal/ALTest.java index 45b7995..7d77221 100644 --- a/test/src/com/jogamp/openal/ALTest.java +++ b/test/src/com/jogamp/openal/ALTest.java @@ -10,275 +10,272 @@ import java.io.IOException; import javax.sound.sampled.UnsupportedAudioFileException; -import junit.framework.TestCase; import com.jogamp.openal.util.*; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import static org.junit.Assert.*; /** * @author Athomas Goldberg * */ -public class ALTest extends TestCase { - +public class ALTest { static AL al; static ALC alc; static ALCcontext context; static ALCdevice device; - final static String TEST_FILE ="lewiscarroll.wav"; - - /** - * Constructor for ALTest. - * @param arg0 - */ - public ALTest(String arg0) { - super(arg0); - } + final static String TEST_FILE = "lewiscarroll.wav"; - public void setUp() { - try { - al = ALFactory.getAL(); - alc = ALFactory.getALC(); - device = alc.alcOpenDevice(null); - context = alc.alcCreateContext(device, null); - alc.alcMakeContextCurrent(context); + @BeforeClass + public static void setUp() { + try { + al = ALFactory.getAL(); + alc = ALFactory.getALC(); + device = alc.alcOpenDevice(null); + context = alc.alcCreateContext(device, null); + alc.alcMakeContextCurrent(context); } catch (ALException e) { e.printStackTrace(); } } - public void tearDown() { + @AfterClass + public static void tearDown() { alc.alcMakeContextCurrent(null); alc.alcDestroyContext(context); alc.alcCloseDevice(device); } - public static void main(String[] args) { - System.out.println("begin main"); - junit.textui.TestRunner.run(ALTest.class); - System.out.println("end main"); - } /* * Test for void alGenBuffers(int, IntBuffer) *//* - final public void testAlGenBuffersintIntBuffer() { - System.out.println("begin testAlGenBuffersintintBuffer"); - // try basic case - try { - IntBuffer buffers = BufferUtils.newIntBuffer(7); - al.alGenBuffers(7,buffers); - for(int i = 0; i < 7; i++) { - assertFalse(buffers.get(i) == 0); - assertTrue(al.alIsBuffer(buffers.get(i))); - } - } catch (Exception e) { - fail(e.getMessage()); - } - - Exception ex = null; - // buffers == null - try { - IntBuffer buffers = null; - al.alGenBuffers(7,buffers); - - - } catch(IllegalArgumentException e) { - ex = e; - } - assertNotNull(ex); + @Test public void testAlGenBuffersintIntBuffer() { + System.out.println("begin testAlGenBuffersintintBuffer"); + // try basic case + try { + IntBuffer buffers = BufferUtils.newIntBuffer(7); + al.alGenBuffers(7,buffers); + for(int i = 0; i < 7; i++) { + assertFalse(buffers.get(i) == 0); + assertTrue(al.alIsBuffer(buffers.get(i))); + } + } catch (Exception e) { + fail(e.getMessage()); + } - ex = null; - // buffer too small - try { - IntBuffer buffers = BufferUtils.newIntBuffer(5); - al.alGenBuffers(7,buffers); - } catch(IllegalArgumentException e) { - ex = e; - } - assertNotNull(ex); + Exception ex = null; + // buffers == null + try { + IntBuffer buffers = null; + al.alGenBuffers(7,buffers); - ex = null; - // buffer not direct - try { - IntBuffer buffers = IntBuffer.allocate(7); - al.alGenBuffers(7,buffers); - } catch(IllegalArgumentException e) { - ex = e; - } - assertNotNull(ex); - System.out.println("end testAlGenBuffersintintBuffer"); + + } catch(IllegalArgumentException e) { + ex = e; + } + assertNotNull(ex); + + ex = null; + // buffer too small + try { + IntBuffer buffers = BufferUtils.newIntBuffer(5); + al.alGenBuffers(7,buffers); + } catch(IllegalArgumentException e) { + ex = e; + } + assertNotNull(ex); + + ex = null; + // buffer not direct + try { + IntBuffer buffers = IntBuffer.allocate(7); + al.alGenBuffers(7,buffers); + } catch(IllegalArgumentException e) { + ex = e; } -*/ + assertNotNull(ex); + System.out.println("end testAlGenBuffersintintBuffer"); + } + */ /* * Test for void alGenBuffers(int, int[]) */ - final public void testAlGenBuffersintintArray() { - + + @Test + public void testAlGenBuffersintintArray() { + System.out.println("begin testAlGenBuffersintintArray"); // try basic case try { int[] buffers = new int[7]; - al.alGenBuffers(7,buffers, 0); - for(int i = 0; i < 7; i++) { + al.alGenBuffers(7, buffers, 0); + for (int i = 0; i < 7; i++) { assertFalse(buffers[i] == 0); assertTrue(al.alIsBuffer(buffers[i])); } } catch (Exception e) { fail(e.getMessage()); } - + Exception ex = null; // try exceptions try { int[] buffers = null; - al.alGenBuffers(7,buffers, 0); - - - } catch(IllegalArgumentException e) { + al.alGenBuffers(7, buffers, 0); + + + } catch (IllegalArgumentException e) { ex = e; } - assertNotNull(ex); + assertNotNull(ex); ex = null; try { int[] buffers = new int[5]; - al.alGenBuffers(7,buffers, 0); - } catch(IllegalArgumentException e) { + al.alGenBuffers(7, buffers, 0); + } catch (IllegalArgumentException e) { ex = e; } assertNotNull(ex); - + System.out.println("end testAlGenBuffersintintArray"); - + } /* * Test for void alDeleteBuffers(int, IntBuffer) */ - final public void testAlDeleteBuffersintIntBuffer() { + @Test + public void testAlDeleteBuffersintIntBuffer() { System.out.println("begin testAlDeleteBuffersintintArray"); // try basic case try { int[] buffers = new int[7]; - al.alGenBuffers(7,buffers,0); - for(int i = 0; i < 7; i++) { + al.alGenBuffers(7, buffers, 0); + for (int i = 0; i < 7; i++) { assertFalse(buffers[i] == 0); assertTrue(al.alIsBuffer(buffers[i])); } - al.alDeleteBuffers(7,buffers,0); - for(int i = 0; i < 7; i++) { + al.alDeleteBuffers(7, buffers, 0); + for (int i = 0; i < 7; i++) { assertFalse(al.alIsBuffer(buffers[i])); } } catch (Exception e) { fail(e.getMessage()); } - + Exception ex = null; // try exceptions try { - al.alDeleteBuffers(7,(int[])null, 0); - } catch(IllegalArgumentException e) { + al.alDeleteBuffers(7, (int[]) null, 0); + } catch (IllegalArgumentException e) { ex = e; } assertNotNull(ex); ex = null; try { int[] buffers = new int[5]; - al.alGenBuffers(5,buffers,0); - al.alDeleteBuffers(7,buffers,0); - } catch(IllegalArgumentException e) { + al.alGenBuffers(5, buffers, 0); + al.alDeleteBuffers(7, buffers, 0); + } catch (IllegalArgumentException e) { ex = e; } assertNotNull(ex); - + try { int[] buffers = new int[7]; - al.alDeleteBuffers(7,buffers,0); + al.alDeleteBuffers(7, buffers, 0); assertTrue(al.alGetError() != 0); - } catch(Exception e) { + } catch (Exception e) { fail("deleting an unfilled buffer list should generate an ALError but not an exception"); } - + System.out.println("end testAlDeleteBuffersintintArray"); } /* * Test for void alDeleteBuffers(int, int[]) */ - final public void testAlDeleteBuffersintintArray() { + @Test + public void testAlDeleteBuffersintintArray() { System.out.println("begin testAlDeleteBuffersintIntBuffer"); // try basic case try { int[] buffers = new int[7]; - al.alGenBuffers(7,buffers,0); - for(int i = 0; i < 7; i++) { + al.alGenBuffers(7, buffers, 0); + for (int i = 0; i < 7; i++) { assertFalse(buffers[i] == 0); assertTrue(al.alIsBuffer(buffers[i])); } - al.alDeleteBuffers(7,buffers,0); - for(int i = 0; i < 7; i++) { + al.alDeleteBuffers(7, buffers, 0); + for (int i = 0; i < 7; i++) { assertFalse(al.alIsBuffer(buffers[i])); } } catch (Exception e) { fail(e.getMessage()); } - + Exception ex = null; // try exceptions try { - al.alDeleteBuffers(7,(int[])null,0); - } catch(IllegalArgumentException e) { + al.alDeleteBuffers(7, (int[]) null, 0); + } catch (IllegalArgumentException e) { ex = e; } assertNotNull(ex); ex = null; try { int[] buffers = new int[5]; - al.alGenBuffers(5,buffers,0); - al.alDeleteBuffers(7,buffers,0); - } catch(IllegalArgumentException e) { + al.alGenBuffers(5, buffers, 0); + al.alDeleteBuffers(7, buffers, 0); + } catch (IllegalArgumentException e) { ex = e; } assertNotNull(ex); - + ex = null; try { int[] buffers = new int[5]; - al.alDeleteBuffers(7,buffers,0); - } catch(IllegalArgumentException e) { + al.alDeleteBuffers(7, buffers, 0); + } catch (IllegalArgumentException e) { ex = e; } assertNotNull(ex); - + try { int[] buffers = new int[7]; - al.alDeleteBuffers(7,buffers,0); + al.alDeleteBuffers(7, buffers, 0); assertTrue(al.alGetError() != 0); - } catch(Exception e) { + } catch (Exception e) { fail("deleting an unfilled buffer list should generate an ALError but not an exception"); } - + System.out.println("end testAlDeleteBuffersintintArray"); } - final public void testAlIsBuffer() { + @Test + public void testAlIsBuffer() { System.out.println("begin testALIsBuffer"); try { // check a bufferlist with known bad values int[] buffers = new int[7]; - for(int i = 0; i < 7; i++) { + for (int i = 0; i < 7; i++) { buffers[i] = -1; assertFalse(al.alIsBuffer(buffers[i])); } // created - al.alGenBuffers(7,buffers,0); - for(int i = 0; i < 7; i++) { + al.alGenBuffers(7, buffers, 0); + for (int i = 0; i < 7; i++) { assertTrue(al.alIsBuffer(buffers[i])); } // deleted - al.alDeleteBuffers(7,buffers,0); - for(int i = 0; i < 7; i++) { + al.alDeleteBuffers(7, buffers, 0); + for (int i = 0; i < 7; i++) { assertFalse(al.alIsBuffer(buffers[i])); - } + } } catch (Exception e) { e.printStackTrace(); fail(e.getMessage()); @@ -289,24 +286,24 @@ public class ALTest extends TestCase { /* * Test for void alBufferData(int, int, Buffer, int, int) */ - final public void testAlBufferDataintintByteBufferintint() { + @Test + public void testAlBufferDataintintByteBufferintint() { System.out.println("begin testAlBufferDataintintByteBufferintint"); try { int[] buffers = new int[1]; al.alGenBuffers(1, buffers, 0); WAVData wd = - WAVLoader.loadFromFile(TEST_FILE); + WAVLoader.loadFromFile(TEST_FILE); al.alBufferData( - buffers[0], - wd.format, - wd.data, - wd.size, - wd.freq - ); + buffers[0], + wd.format, + wd.data, + wd.size, + wd.freq); int[] tmp = new int[1]; - al.alGetBufferi(buffers[0],AL.AL_SIZE,tmp,0); + al.alGetBufferi(buffers[0], AL.AL_SIZE, tmp, 0); assertFalse(tmp[0] == 0); - } catch(Exception e) { + } catch (Exception e) { fail(e.toString()); } Exception ex = null; @@ -315,96 +312,97 @@ public class ALTest extends TestCase { al.alGenBuffers(1, buffers, 0); al.alBufferData( - buffers[0], - AL.AL_FORMAT_STEREO16, - null, - 0, - 0 - ); - } catch(IllegalArgumentException e) { + buffers[0], + AL.AL_FORMAT_STEREO16, + null, + 0, + 0); + } catch (IllegalArgumentException e) { ex = e; } assertNotNull(ex); - + System.out.println("end testAlBufferDataintintByteBufferintint"); } /* * Test for void alGetBufferf(int, int, float[]) */ - final public void testAlGetBufferfintintfloatArray() { + @Test + public void testAlGetBufferfintintfloatArray() { System.out.println("begin testAlGetBufferfintintfloatArray"); - + // there are currently NO float attributes for buffers. - + System.out.println("end testAlGetBufferfintintfloatArray"); } /* * Test for void alGetBufferf(int, int, FloatBuffer) */ - final public void testAlGetBufferfintintFloatBuffer() { + @Test + public void testAlGetBufferfintintFloatBuffer() { System.out.println("begin testAlGetBufferfintintFloatBuffer"); - + // there are currently NO float attributes for buffers. - + System.out.println("end testAlGetBufferfintintFloatBuffer"); } /* * Test for float alGetBufferf(int, int) */ - final public void testAlGetBufferfintint() { + @Test + public void testAlGetBufferfintint() { System.out.println("begin testAlGetBufferfintintFloatBuffer"); - + // there are currently NO float attributes for buffers. - + System.out.println("end testAlGetBufferfintintFloatBuffer"); } /* * Test for void alGetBufferi(int, int, int[]) */ - final public void testAlGetBufferiintintintArray() { + @Test + public void testAlGetBufferiintintintArray() { System.out.println("begin testAlGetBufferiintintintArray"); try { int[] buffers = new int[1]; al.alGenBuffers(1, buffers, 0); WAVData wd = - WAVLoader.loadFromFile(TEST_FILE); + WAVLoader.loadFromFile(TEST_FILE); al.alBufferData( - buffers[0], - wd.format, - wd.data, - wd.size, - wd.freq - ); + buffers[0], + wd.format, + wd.data, + wd.size, + wd.freq); int[] size = new int[1]; int[] freq = new int[1]; - al.alGetBufferi(buffers[0],AL.AL_SIZE, size, 0); - al.alGetBufferi(buffers[0],AL.AL_FREQUENCY, freq, 0); + al.alGetBufferi(buffers[0], AL.AL_SIZE, size, 0); + al.alGetBufferi(buffers[0], AL.AL_FREQUENCY, freq, 0); assertEquals(wd.size, size[0]); assertEquals(wd.freq, freq[0]); - } catch(Exception e) { + } catch (Exception e) { fail(e.toString()); } - + Exception ex = null; try { int[] buffers = new int[1]; al.alGenBuffers(1, buffers, 0); WAVData wd = - WAVLoader.loadFromFile(TEST_FILE); + WAVLoader.loadFromFile(TEST_FILE); al.alBufferData( - buffers[0], - wd.format, - wd.data, - wd.size, - wd.freq - ); + buffers[0], + wd.format, + wd.data, + wd.size, + wd.freq); int[] size = null; - al.alGetBufferi(buffers[0],AL.AL_SIZE, size, 0); - + al.alGetBufferi(buffers[0], AL.AL_SIZE, size, 0); + } catch (IllegalArgumentException e) { ex = e; } catch (UnsupportedAudioFileException e) { @@ -414,35 +412,35 @@ public class ALTest extends TestCase { e.printStackTrace(); fail(e.getMessage()); } - + assertNotNull(ex); - + System.out.println("end testAlGetBufferiintintintArray"); } /* * Test for void alGetBufferi(int, int, IntBuffer) */ - final public void testAlGetBufferiintintIntBuffer() { + @Test + public void testAlGetBufferiintintIntBuffer() { try { int[] buffers = new int[1]; al.alGenBuffers(1, buffers, 0); WAVData wd = - WAVLoader.loadFromFile(TEST_FILE); + WAVLoader.loadFromFile(TEST_FILE); al.alBufferData( - buffers[0], - wd.format, - wd.data, - wd.size, - wd.freq - ); + buffers[0], + wd.format, + wd.data, + wd.size, + wd.freq); int[] size = new int[1]; int[] freq = new int[1]; - al.alGetBufferi(buffers[0],AL.AL_SIZE, size, 0); - al.alGetBufferi(buffers[0],AL.AL_FREQUENCY, freq, 0); + al.alGetBufferi(buffers[0], AL.AL_SIZE, size, 0); + al.alGetBufferi(buffers[0], AL.AL_FREQUENCY, freq, 0); assertEquals(wd.size, size[0]); assertEquals(wd.freq, freq[0]); - } catch(Exception e) { + } catch (Exception e) { fail(e.toString()); } Exception ex = null; @@ -450,17 +448,16 @@ public class ALTest extends TestCase { int[] buffers = new int[1]; al.alGenBuffers(1, buffers, 0); WAVData wd = - WAVLoader.loadFromFile(TEST_FILE); + WAVLoader.loadFromFile(TEST_FILE); al.alBufferData( - buffers[0], - wd.format, - wd.data, - wd.size, - wd.freq - ); + buffers[0], + wd.format, + wd.data, + wd.size, + wd.freq); int[] size = null; - al.alGetBufferi(buffers[0],AL.AL_SIZE, size, 0); - + al.alGetBufferi(buffers[0], AL.AL_SIZE, size, 0); + } catch (IllegalArgumentException e) { ex = e; } catch (UnsupportedAudioFileException e) { @@ -470,450 +467,33 @@ public class ALTest extends TestCase { e.printStackTrace(); fail(e.getMessage()); } - + assertNotNull(ex); ex = null; - try { - int[] buffers = new int[1]; - al.alGenBuffers(1, buffers, 0); - WAVData wd = - WAVLoader.loadFromFile(TEST_FILE); - al.alBufferData( - buffers[0], - wd.format, - wd.data, - wd.size, - wd.freq - ); - int[] size = new int[1]; - al.alGetBufferi(buffers[0],AL.AL_SIZE, size, 0); - - } catch (IllegalArgumentException e) { - ex = e; - } catch (UnsupportedAudioFileException e) { - e.printStackTrace(); - fail(e.getMessage()); - } catch (IOException e) { - e.printStackTrace(); - fail(e.getMessage()); - } - -// assertNotNull(ex); - } - - /* - * Test for int alGetBufferi(int, int) - */ - final public void testAlGetBufferiintint() { - //TODO Implement alGetBufferi(). - } - - /* - * Test for void alGenSources(int, int[]) - */ - final public void testAlGenSourcesintintArray() { - //TODO Implement alGenSources(). - } - - /* - * Test for void alGenSources(int, IntBuffer) - */ - final public void testAlGenSourcesintIntBuffer() { - //TODO Implement alGenSources(). - } - - /* - * Test for void alDeleteSources(int, int[]) - */ - final public void testAlDeleteSourcesintintArray() { - //TODO Implement alDeleteSources(). - } - - /* - * Test for void alDeleteSources(int, IntBuffer) - */ - final public void testAlDeleteSourcesintIntBuffer() { - //TODO Implement alDeleteSources(). - } - - final public void testAlIsSource() { - //TODO Implement alIsSource(). - } - - final public void testAlSourcei() { - //TODO Implement alSourcei(). - } - - final public void testAlSourcef() { - //TODO Implement alSourcef(). - } - - /* - * Test for void alSourcefv(int, int, float[]) - */ - final public void testAlSourcefvintintfloatArray() { - //TODO Implement alSourcefv(). - } - - /* - * Test for void alSourcefv(int, int, FloatBuffer) - */ - final public void testAlSourcefvintintFloatBuffer() { - //TODO Implement alSourcefv(). - } - - final public void testAlSource3f() { - //TODO Implement alSource3f(). - } - - /* - * Test for void alGetSourcef(int, int, float[]) - */ - final public void testAlGetSourcefintintfloatArray() { - //TODO Implement alGetSourcef(). - } - - /* - * Test for void alGetSourcef(int, int, FloatBuffer) - */ - final public void testAlGetSourcefintintFloatBuffer() { - //TODO Implement alGetSourcef(). - } - - /* - * Test for float alGetSourcef(int, int) - */ - final public void testAlGetSourcefintint() { - //TODO Implement alGetSourcef(). - } - - /* - * Test for void alGetSourcefv(int, int, FloatBuffer) - */ - final public void testAlGetSourcefvintintFloatBuffer() { - //TODO Implement alGetSourcefv(). - } - - /* - * Test for void alGetSourcefv(int, int, float[]) - */ - final public void testAlGetSourcefvintintfloatArray() { - //TODO Implement alGetSourcefv(). - } - - /* - * Test for void alGetSourcei(int, int, int[]) - */ - final public void testAlGetSourceiintintintArray() { - //TODO Implement alGetSourcei(). - } - - /* - * Test for void alGetSourcei(int, int, IntBuffer) - */ - final public void testAlGetSourceiintintIntBuffer() { - //TODO Implement alGetSourcei(). - } - - /* - * Test for int alGetSourcei(int, int) - */ - final public void testAlGetSourceiintint() { - //TODO Implement alGetSourcei(). - } - - final public void testAlSourcePlay() { - //TODO Implement alSourcePlay(). - } - - /* - * Test for void alSourcePlayv(int, IntBuffer) - */ - final public void testAlSourcePlayvintIntBuffer() { - //TODO Implement alSourcePlayv(). - } - - /* - * Test for void alSourcePlayv(int, int[]) - */ - final public void testAlSourcePlayvintintArray() { - //TODO Implement alSourcePlayv(). - } - - final public void testAlSourcePause() { - //TODO Implement alSourcePause(). - } - - /* - * Test for void alSourcePausev(int, int[]) - */ - final public void testAlSourcePausevintintArray() { - //TODO Implement alSourcePausev(). - } - - /* - * Test for void alSourcePausev(int, IntBuffer) - */ - final public void testAlSourcePausevintIntBuffer() { - //TODO Implement alSourcePausev(). - } - - final public void testAlSourceStop() { - //TODO Implement alSourceStop(). - } - - /* - * Test for void alSourceStopv(int, int[]) - */ - final public void testAlSourceStopvintintArray() { - //TODO Implement alSourceStopv(). - } - - /* - * Test for void alSourceStopv(int, IntBuffer) - */ - final public void testAlSourceStopvintIntBuffer() { - //TODO Implement alSourceStopv(). - } - - final public void testAlSourceRewind() { - //TODO Implement alSourceRewind(). - } - - /* - * Test for void alSourceRewindv(int, int[]) - */ - final public void testAlSourceRewindvintintArray() { - //TODO Implement alSourceRewindv(). - } - - /* - * Test for void alSourceRewindv(int, IntBuffer) - */ - final public void testAlSourceRewindvintIntBuffer() { - //TODO Implement alSourceRewindv(). - } - - /* - * Test for void alSourceQueueBuffers(int, int, int[]) - */ - final public void testAlSourceQueueBuffersintintintArray() { - //TODO Implement alSourceQueueBuffers(). - } - - /* - * Test for void alSourceQueueBuffers(int, int, IntBuffer) - */ - final public void testAlSourceQueueBuffersintintIntBuffer() { - //TODO Implement alSourceQueueBuffers(). - } - - /* - * Test for void alSourceUnqueueBuffers(int, int, int[]) - */ - final public void testAlSourceUnqueueBuffersintintintArray() { - //TODO Implement alSourceUnqueueBuffers(). - } - - /* - * Test for void alSourceUnqueueBuffers(int, int, IntBuffer) - */ - final public void testAlSourceUnqueueBuffersintintIntBuffer() { - //TODO Implement alSourceUnqueueBuffers(). - } - - final public void testAlListenerf() { - //TODO Implement alListenerf(). - } - - final public void testAlListener3f() { - //TODO Implement alListener3f(). - } - - /* - * Test for void alListenerfv(int, float[]) - */ - final public void testAlListenerfvintfloatArray() { - //TODO Implement alListenerfv(). - } - - /* - * Test for void alListenerfv(int, FloatBuffer) - */ - final public void testAlListenerfvintFloatBuffer() { - //TODO Implement alListenerfv(). - } - - final public void testAlListeneri() { - //TODO Implement alListeneri(). - } - - /* - * Test for void alGetListenerf(int, float[]) - */ - final public void testAlGetListenerfintfloatArray() { - //TODO Implement alGetListenerf(). - } - - /* - * Test for void alGetListenerf(int, FloatBuffer) - */ - final public void testAlGetListenerfintFloatBuffer() { - //TODO Implement alGetListenerf(). - } - - /* - * Test for float alGetListenerf(int) - */ - final public void testAlGetListenerfint() { - //TODO Implement alGetListenerf(). - } - - /* - * Test for void alGetListener3f(int, FloatBuffer, FloatBuffer, FloatBuffer) - */ - final public void testAlGetListener3fintFloatBufferFloatBufferFloatBuffer() { - //TODO Implement alGetListener3f(). - } - - /* - * Test for void alGetListener3f(int, float[], float[], float[]) - */ - final public void testAlGetListener3fintfloatArrayfloatArrayfloatArray() { - //TODO Implement alGetListener3f(). - } - - /* - * Test for void alGetListenerfv(int, float[]) - */ - final public void testAlGetListenerfvintfloatArray() { - //TODO Implement alGetListenerfv(). - } - - /* - * Test for void alGetListenerfv(int, FloatBuffer) - */ - final public void testAlGetListenerfvintFloatBuffer() { - //TODO Implement alGetListenerfv(). - } - - /* - * Test for void alGetListeneri(int, int[]) - */ - final public void testAlGetListeneriintintArray() { - //TODO Implement alGetListeneri(). - } - - /* - * Test for void alGetListeneri(int, IntBuffer) - */ - final public void testAlGetListeneriintIntBuffer() { - //TODO Implement alGetListeneri(). - } - - /* - * Test for int alGetListeneri(int) - */ - final public void testAlGetListeneriint() { - //TODO Implement alGetListeneri(). - } - - final public void testAlEnable() { - //TODO Implement alEnable(). - } - - final public void testAlDisable() { - //TODO Implement alDisable(). - } - - final public void testAlIsEnabled() { - //TODO Implement alIsEnabled(). - } - - final public void testAlGetBoolean() { - //TODO Implement alGetBoolean(). - } - - final public void testAlGetDouble() { - //TODO Implement alGetDouble(). - } - - final public void testAlGetFloat() { - //TODO Implement alGetFloat(). - } - - final public void testAlGetInteger() { - //TODO Implement alGetInteger(). - } - - /* - * Test for void alGetDoublev(int, DoubleBuffer) - */ - final public void testAlGetDoublevintDoubleBuffer() { - //TODO Implement alGetDoublev(). - } - - /* - * Test for void alGetDoublev(int, double[]) - */ - final public void testAlGetDoublevintdoubleArray() { - //TODO Implement alGetDoublev(). - } - - /* - * Test for void alGetFloatv(int, FloatBuffer) - */ - final public void testAlGetFloatvintFloatBuffer() { - //TODO Implement alGetFloatv(). - } - - /* - * Test for void alGetFloatv(int, float[]) - */ - final public void testAlGetFloatvintfloatArray() { - //TODO Implement alGetFloatv(). - } - - /* - * Test for void alGetIntegerv(int, IntBuffer) - */ - final public void testAlGetIntegervintIntBuffer() { - //TODO Implement alGetIntegerv(). - } - - /* - * Test for void alGetIntegerv(int, int[]) - */ - final public void testAlGetIntegervintintArray() { - //TODO Implement alGetIntegerv(). - } - - final public void testAlGetString() { - //TODO Implement alGetString(). - } - - final public void testAlDistanceModel() { - //TODO Implement alDistanceModel(). - } - - final public void testAlDopplerFactor() { - //TODO Implement alDopplerFactor(). - } - - final public void testAlDopplerVelocity() { - //TODO Implement alDopplerVelocity(). - } - - final public void testAlGetError() { - //TODO Implement alGetError(). - } + try { + int[] buffers = new int[1]; + al.alGenBuffers(1, buffers, 0); + WAVData wd = + WAVLoader.loadFromFile(TEST_FILE); + al.alBufferData( + buffers[0], + wd.format, + wd.data, + wd.size, + wd.freq); + int[] size = new int[1]; + al.alGetBufferi(buffers[0], AL.AL_SIZE, size, 0); - final public void testAlIsExtensionPresent() { - //TODO Implement alIsExtensionPresent(). - } + } catch (IllegalArgumentException e) { + ex = e; + } catch (UnsupportedAudioFileException e) { + e.printStackTrace(); + fail(e.getMessage()); + } catch (IOException e) { + e.printStackTrace(); + fail(e.getMessage()); + } - final public void testAlGetEnumValue() { - //TODO Implement alGetEnumValue(). +// assertNotNull(ex); } - } |