@@ -17,7 +17,7 @@ public class AudioFilterTest {
1717 * Tests serialization and de-serialization of a {@code LowPassFilter}.
1818 */
1919 @ Test
20- public void testSaveAndLoad () {
20+ public void testSaveAndLoad_LowPassFilter () {
2121 AssetManager assetManager = new DesktopAssetManager (true );
2222
2323 LowPassFilter f = new LowPassFilter (.5f , .5f );
@@ -28,4 +28,35 @@ public void testSaveAndLoad() {
2828 Assert .assertEquals (f .getHighFreqVolume (), copy .getHighFreqVolume (), delta );
2929 }
3030
31+ /**
32+ * Tests serialization and de-serialization of a {@code HighPassFilter}.
33+ */
34+ @ Test
35+ public void testSaveAndLoad_HighPassFilter () {
36+ AssetManager assetManager = new DesktopAssetManager (true );
37+
38+ HighPassFilter f = new HighPassFilter (.5f , .5f );
39+ HighPassFilter copy = BinaryExporter .saveAndLoad (assetManager , f );
40+
41+ float delta = 0.001f ;
42+ Assert .assertEquals (f .getVolume (), copy .getVolume (), delta );
43+ Assert .assertEquals (f .getLowFreqVolume (), copy .getLowFreqVolume (), delta );
44+ }
45+
46+ /**
47+ * Tests serialization and de-serialization of a {@code BandPassFilter}.
48+ */
49+ @ Test
50+ public void testSaveAndLoad_BandPassFilter () {
51+ AssetManager assetManager = new DesktopAssetManager (true );
52+
53+ BandPassFilter f = new BandPassFilter (.5f , .5f , .5f );
54+ BandPassFilter copy = BinaryExporter .saveAndLoad (assetManager , f );
55+
56+ float delta = 0.001f ;
57+ Assert .assertEquals (f .getVolume (), copy .getVolume (), delta );
58+ Assert .assertEquals (f .getHighFreqVolume (), copy .getHighFreqVolume (), delta );
59+ Assert .assertEquals (f .getLowFreqVolume (), copy .getLowFreqVolume (), delta );
60+ }
61+
3162}
0 commit comments