changeset in /hg/icedtea6: Add missing Gervill test files.

Mark Wielaard mark at klomp.org
Mon Nov 24 04:30:13 PST 2008


changeset 1c9ba5e52e34 in /hg/icedtea6
details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=1c9ba5e52e34
description:
	Add missing Gervill test files.

	2008-11-24  Mark Wielaard  <mark at klomp.org>

	        * overlays/openjdk/jdk/test/com/sun/media/sound/
	        EmergencySoundbank/TestCreateSoundbank.java
	        ModelByteBuffer/RandomFileInputStream/Available.java
	        ModelByteBuffer/RandomFileInputStream/Close.java
	        ModelByteBuffer/RandomFileInputStream/MarkReset.java
	        ModelByteBuffer/RandomFileInputStream/MarkSupported.java
	        ModelByteBuffer/RandomFileInputStream/Read.java
	        ModelByteBuffer/RandomFileInputStream/ReadByte.java
	        ModelByteBuffer/RandomFileInputStream/ReadByteIntInt.java
	        ModelByteBuffer/RandomFileInputStream/Skip.java
	        SoftAudioSynthesizer/DummySourceDataLine.java
	        SoftFilter/TestProcessAudio.java
	        SoftSynthesizer/DummySourceDataLine.java: Add missing Gervill
	        test files.

diffstat:

13 files changed, 1519 insertions(+)
ChangeLog                                                                                               |   17 
overlays/openjdk/jdk/test/com/sun/media/sound/EmergencySoundbank/TestCreateSoundbank.java               |   59 ++
overlays/openjdk/jdk/test/com/sun/media/sound/ModelByteBuffer/RandomFileInputStream/Available.java      |  107 +++++
overlays/openjdk/jdk/test/com/sun/media/sound/ModelByteBuffer/RandomFileInputStream/Close.java          |  104 +++++
overlays/openjdk/jdk/test/com/sun/media/sound/ModelByteBuffer/RandomFileInputStream/MarkReset.java      |  129 ++++++
overlays/openjdk/jdk/test/com/sun/media/sound/ModelByteBuffer/RandomFileInputStream/MarkSupported.java  |  106 +++++
overlays/openjdk/jdk/test/com/sun/media/sound/ModelByteBuffer/RandomFileInputStream/Read.java           |  117 +++++
overlays/openjdk/jdk/test/com/sun/media/sound/ModelByteBuffer/RandomFileInputStream/ReadByte.java       |  118 +++++
overlays/openjdk/jdk/test/com/sun/media/sound/ModelByteBuffer/RandomFileInputStream/ReadByteIntInt.java |  118 +++++
overlays/openjdk/jdk/test/com/sun/media/sound/ModelByteBuffer/RandomFileInputStream/Skip.java           |  131 ++++++
overlays/openjdk/jdk/test/com/sun/media/sound/SoftAudioSynthesizer/DummySourceDataLine.java             |  207 ++++++++++
overlays/openjdk/jdk/test/com/sun/media/sound/SoftFilter/TestProcessAudio.java                          |   99 ++++
overlays/openjdk/jdk/test/com/sun/media/sound/SoftSynthesizer/DummySourceDataLine.java                  |  207 ++++++++++

diffs (truncated from 1574 to 500 lines):

diff -r b7ce0d293432 -r 1c9ba5e52e34 ChangeLog
--- a/ChangeLog	Sun Nov 23 17:46:11 2008 +0100
+++ b/ChangeLog	Mon Nov 24 13:30:00 2008 +0100
@@ -1,3 +1,20 @@ 2008-11-23  Mark Wielaard  <mark at klomp.o
+2008-11-24  Mark Wielaard  <mark at klomp.org>
+
+	* overlays/openjdk/jdk/test/com/sun/media/sound/
+	EmergencySoundbank/TestCreateSoundbank.java
+	ModelByteBuffer/RandomFileInputStream/Available.java
+	ModelByteBuffer/RandomFileInputStream/Close.java
+	ModelByteBuffer/RandomFileInputStream/MarkReset.java
+	ModelByteBuffer/RandomFileInputStream/MarkSupported.java
+	ModelByteBuffer/RandomFileInputStream/Read.java
+	ModelByteBuffer/RandomFileInputStream/ReadByte.java
+	ModelByteBuffer/RandomFileInputStream/ReadByteIntInt.java
+	ModelByteBuffer/RandomFileInputStream/Skip.java
+	SoftAudioSynthesizer/DummySourceDataLine.java
+	SoftFilter/TestProcessAudio.java
+	SoftSynthesizer/DummySourceDataLine.java: Add missing Gervill
+	test files.
+
 2008-11-23  Mark Wielaard  <mark at klomp.org>
 
 	* patches/icedtea-samejvm-safe.patch: New patch.
diff -r b7ce0d293432 -r 1c9ba5e52e34 overlays/openjdk/jdk/test/com/sun/media/sound/EmergencySoundbank/TestCreateSoundbank.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/overlays/openjdk/jdk/test/com/sun/media/sound/EmergencySoundbank/TestCreateSoundbank.java	Mon Nov 24 13:30:00 2008 +0100
@@ -0,0 +1,59 @@
+import java.io.File;
+
+import javax.sound.midi.Instrument;
+import javax.sound.midi.Patch;
+import javax.sound.midi.Soundbank;
+
+import com.sun.media.sound.EmergencySoundbank;
+import com.sun.media.sound.ModelInstrument;
+import com.sun.media.sound.ModelPatch;
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/* @test
+ @summary Test EmergencySoundbank createSoundbank() method */
+
+public class TestCreateSoundbank {
+
+    public static void main(String[] args) throws Exception {
+        
+        Soundbank soundbank = EmergencySoundbank.createSoundbank();
+        for (int i = 0; i < 128; i++) {
+            Patch patch = new ModelPatch(0, i, false);
+            ModelInstrument ins = (ModelInstrument)soundbank.getInstrument(patch);
+            if(ins == null)
+                throw new Exception("Instrument " + i + " is missing!");
+            if(ins.getPerformers().length == 0)
+                throw new Exception("Instrument " + i + " doesn't have any performers!");
+        }
+        Patch patch = new ModelPatch(0, 0, true);
+        ModelInstrument ins = (ModelInstrument)soundbank.getInstrument(patch);
+        if(ins == null)
+            throw new Exception("Drumkit instrument is missing!");
+        if(ins.getPerformers().length == 0)
+            throw new Exception("Drumkit instrument doesn't have any performers!");
+    }   
+}
diff -r b7ce0d293432 -r 1c9ba5e52e34 overlays/openjdk/jdk/test/com/sun/media/sound/ModelByteBuffer/RandomFileInputStream/Available.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/overlays/openjdk/jdk/test/com/sun/media/sound/ModelByteBuffer/RandomFileInputStream/Available.java	Mon Nov 24 13:30:00 2008 +0100
@@ -0,0 +1,107 @@
+/*
+ * Copyright 2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/* @test
+   @summary Test ModelByteBuffer.RandomFileInputStream available() method */
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.sound.sampled.*;
+
+import com.sun.media.sound.*;
+
+public class Available {
+
+    static float[] testarray;
+    static byte[] test_byte_array;  
+    static File test_file;
+    static AudioFormat format = new AudioFormat(44100, 16, 1, true, false);
+    
+    static void setUp() throws Exception {
+        testarray = new float[1024];
+        for (int i = 0; i < 1024; i++) {
+            double ii = i / 1024.0;
+            ii = ii * ii;
+            testarray[i] = (float)Math.sin(10*ii*2*Math.PI);
+            testarray[i] += (float)Math.sin(1.731 + 2*ii*2*Math.PI);
+            testarray[i] += (float)Math.sin(0.231 + 6.3*ii*2*Math.PI);
+            testarray[i] *= 0.3;
+        }       
+        test_byte_array = new byte[testarray.length*2];
+        AudioFloatConverter.getConverter(format).toByteArray(testarray, test_byte_array);
+        test_file = File.createTempFile("test", ".raw");
+        FileOutputStream fos = new FileOutputStream(test_file);
+        fos.write(test_byte_array);
+    }   
+    
+    static void tearDown() throws Exception {
+        if(!test_file.delete())
+            test_file.deleteOnExit();
+    }           
+    
+    public static void main(String[] args) throws Exception {
+        try
+        {
+            setUp();
+            
+            for (int i = 0; i < 8; i++) {
+                ModelByteBuffer buff;
+                if(i % 2 == 0)
+                    buff = new ModelByteBuffer(test_file);
+                else
+                    buff = new ModelByteBuffer(test_byte_array);
+                if((i / 2) == 1)
+                    buff.subbuffer(5);
+                if((i / 2) == 2)
+                    buff.subbuffer(5,500);
+                if((i / 2) == 3)
+                    buff.subbuffer(5,600,true);
+                
+                long capacity = buff.capacity();
+                InputStream is = buff.getInputStream();
+                try
+                {                                     
+                    int ret = is.available();
+                    if(ret != capacity)
+                        throw new RuntimeException("is.available() return unexpected value!");
+                }
+                finally
+                {
+                    is.close();
+                }
+                if(buff.capacity() != capacity)
+                    throw new RuntimeException("Capacity variable should not change!");                
+            }           
+        }
+        finally
+        {
+            tearDown();
+        }       
+    }
+
+}
diff -r b7ce0d293432 -r 1c9ba5e52e34 overlays/openjdk/jdk/test/com/sun/media/sound/ModelByteBuffer/RandomFileInputStream/Close.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/overlays/openjdk/jdk/test/com/sun/media/sound/ModelByteBuffer/RandomFileInputStream/Close.java	Mon Nov 24 13:30:00 2008 +0100
@@ -0,0 +1,104 @@
+/*
+ * Copyright 2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/* @test
+   @summary Test ModelByteBuffer.RandomFileInputStream close method */
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.sound.sampled.*;
+
+import com.sun.media.sound.*;
+
+public class Close {
+
+    static float[] testarray;
+    static byte[] test_byte_array;  
+    static File test_file;
+    static AudioFormat format = new AudioFormat(44100, 16, 1, true, false);
+    
+    static void setUp() throws Exception {
+        testarray = new float[1024];
+        for (int i = 0; i < 1024; i++) {
+            double ii = i / 1024.0;
+            ii = ii * ii;
+            testarray[i] = (float)Math.sin(10*ii*2*Math.PI);
+            testarray[i] += (float)Math.sin(1.731 + 2*ii*2*Math.PI);
+            testarray[i] += (float)Math.sin(0.231 + 6.3*ii*2*Math.PI);
+            testarray[i] *= 0.3;
+        }       
+        test_byte_array = new byte[testarray.length*2];
+        AudioFloatConverter.getConverter(format).toByteArray(testarray, test_byte_array);
+        test_file = File.createTempFile("test", ".raw");
+        FileOutputStream fos = new FileOutputStream(test_file);
+        fos.write(test_byte_array);
+    }   
+    
+    static void tearDown() throws Exception {
+        if(!test_file.delete())
+            test_file.deleteOnExit();
+    }           
+    
+    public static void main(String[] args) throws Exception {
+        try
+        {
+            setUp();
+            
+            for (int i = 0; i < 8; i++) {
+                ModelByteBuffer buff;
+                if(i % 2 == 0)
+                    buff = new ModelByteBuffer(test_file);
+                else
+                    buff = new ModelByteBuffer(test_byte_array);
+                if((i / 2) == 1)
+                    buff.subbuffer(5);
+                if((i / 2) == 2)
+                    buff.subbuffer(5,500);
+                if((i / 2) == 3)
+                    buff.subbuffer(5,600,true);
+                
+                long capacity = buff.capacity();
+                InputStream is = buff.getInputStream();
+                try
+                {                    
+                }
+                finally
+                {
+                    is.close();
+                }
+                if(buff.capacity() != capacity)
+                    throw new RuntimeException("Capacity variable should not change!");
+            }           
+        }
+        finally
+        {
+            tearDown();
+        }       
+    }
+
+}
diff -r b7ce0d293432 -r 1c9ba5e52e34 overlays/openjdk/jdk/test/com/sun/media/sound/ModelByteBuffer/RandomFileInputStream/MarkReset.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/overlays/openjdk/jdk/test/com/sun/media/sound/ModelByteBuffer/RandomFileInputStream/MarkReset.java	Mon Nov 24 13:30:00 2008 +0100
@@ -0,0 +1,129 @@
+/*
+ * Copyright 2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/* @test
+   @summary Test ModelByteBuffer.RandomFileInputStream mark and reset methods */
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.sound.sampled.*;
+
+import com.sun.media.sound.*;
+
+public class MarkReset {
+
+    static float[] testarray;
+    static byte[] test_byte_array;  
+    static File test_file;
+    static AudioFormat format = new AudioFormat(44100, 16, 1, true, false);
+    
+    static void setUp() throws Exception {
+        testarray = new float[1024];
+        for (int i = 0; i < 1024; i++) {
+            double ii = i / 1024.0;
+            ii = ii * ii;
+            testarray[i] = (float)Math.sin(10*ii*2*Math.PI);
+            testarray[i] += (float)Math.sin(1.731 + 2*ii*2*Math.PI);
+            testarray[i] += (float)Math.sin(0.231 + 6.3*ii*2*Math.PI);
+            testarray[i] *= 0.3;
+        }       
+        test_byte_array = new byte[testarray.length*2];
+        AudioFloatConverter.getConverter(format).toByteArray(testarray, test_byte_array);
+        test_file = File.createTempFile("test", ".raw");
+        FileOutputStream fos = new FileOutputStream(test_file);
+        fos.write(test_byte_array);
+    }   
+    
+    static void tearDown() throws Exception {
+        if(!test_file.delete())
+            test_file.deleteOnExit();
+    }           
+    
+    public static void main(String[] args) throws Exception {
+        try
+        {
+            setUp();
+            
+            for (int i = 0; i < 8; i++) {
+                ModelByteBuffer buff;
+                if(i % 2 == 0)
+                    buff = new ModelByteBuffer(test_file);
+                else
+                    buff = new ModelByteBuffer(test_byte_array);
+                if((i / 2) == 1)
+                    buff.subbuffer(5);
+                if((i / 2) == 2)
+                    buff.subbuffer(5,500);
+                if((i / 2) == 3)
+                    buff.subbuffer(5,600,true);
+                
+                long capacity = buff.capacity();
+                InputStream is = buff.getInputStream();
+                try
+                {                
+                    is.mark(1000);
+                    int ret = is.available();
+                    int a = is.read();
+                    is.skip(75);                          
+                    is.reset();
+                    if(is.available() != ret)
+                        throw new RuntimeException(
+                                "is.available() returns incorrect value ("
+                                + is.available() + "!="+(ret)+") !");
+                    int b = is.read();
+                    if(a != b)
+                        throw new RuntimeException(
+                                "is doesn't return same value after reset ("
+                                + a + "!="+b+") !");
+                    
+                    is.skip(15);        
+                    ret = is.available();
+                    is.mark(1000);
+                    is.reset();
+                    if(is.available() != ret)
+                        throw new RuntimeException(
+                                "is.available() returns incorrect value ("
+                                + is.available() + "!="+(ret)+") !");
+                   
+                    
+                }
+                finally
+                {
+                    is.close();
+                }
+                if(buff.capacity() != capacity)
+                    throw new RuntimeException("Capacity variable should not change!");                
+            }           
+        }
+        finally
+        {
+            tearDown();
+        }       
+    }
+
+}
diff -r b7ce0d293432 -r 1c9ba5e52e34 overlays/openjdk/jdk/test/com/sun/media/sound/ModelByteBuffer/RandomFileInputStream/MarkSupported.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/overlays/openjdk/jdk/test/com/sun/media/sound/ModelByteBuffer/RandomFileInputStream/MarkSupported.java	Mon Nov 24 13:30:00 2008 +0100
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/* @test
+   @summary Test ModelByteBuffer.RandomFileInputStream markSupported() method */
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.sound.sampled.*;
+
+import com.sun.media.sound.*;
+
+public class MarkSupported {
+
+    static float[] testarray;
+    static byte[] test_byte_array;  
+    static File test_file;
+    static AudioFormat format = new AudioFormat(44100, 16, 1, true, false);
+    
+    static void setUp() throws Exception {
+        testarray = new float[1024];
+        for (int i = 0; i < 1024; i++) {
+            double ii = i / 1024.0;
+            ii = ii * ii;
+            testarray[i] = (float)Math.sin(10*ii*2*Math.PI);
+            testarray[i] += (float)Math.sin(1.731 + 2*ii*2*Math.PI);
+            testarray[i] += (float)Math.sin(0.231 + 6.3*ii*2*Math.PI);
+            testarray[i] *= 0.3;
+        }       
+        test_byte_array = new byte[testarray.length*2];
+        AudioFloatConverter.getConverter(format).toByteArray(testarray, test_byte_array);
+        test_file = File.createTempFile("test", ".raw");



More information about the distro-pkg-dev mailing list