Skip to content

Commit c3c6ba4

Browse files
authored
Add files via upload
1 parent 4ae2e55 commit c3c6ba4

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.jme3.audio;
2+
3+
import com.jme3.asset.AssetManager;
4+
import com.jme3.asset.DesktopAssetManager;
5+
import com.jme3.export.binary.BinaryExporter;
6+
import org.junit.Assert;
7+
import org.junit.Test;
8+
9+
/**
10+
* Automated tests for the Filter class.
11+
*
12+
* @author capdevon
13+
*/
14+
public class AudioFilterTest {
15+
16+
/**
17+
* Tests serialization and de-serialization of a {@code LowPassFilter}.
18+
*/
19+
@Test
20+
public void testSaveAndLoad() {
21+
AssetManager assetManager = new DesktopAssetManager(true);
22+
23+
LowPassFilter f = new LowPassFilter(.5f, .5f);
24+
LowPassFilter copy = BinaryExporter.saveAndLoad(assetManager, f);
25+
26+
float delta = 0.001f;
27+
Assert.assertEquals(f.getVolume(), copy.getVolume(), delta);
28+
Assert.assertEquals(f.getHighFreqVolume(), copy.getHighFreqVolume(), delta);
29+
}
30+
31+
}

0 commit comments

Comments
 (0)