source: josm/trunk/test/unit/org/openstreetmap/josm/tools/AudioUtilTest.java@ 9951

Last change on this file since 9951 was 9669, checked in by bastiK, 8 years ago

add missing svn:eol-style=native (see #12410)

  • Property svn:eol-style set to native
File size: 1.1 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.tools;
3
4import static org.junit.Assert.assertEquals;
5
6import java.io.File;
7
8import org.junit.BeforeClass;
9import org.junit.Test;
10import org.openstreetmap.josm.JOSMFixture;
11import org.openstreetmap.josm.TestUtils;
12
13/**
14 * Unit tests of {@link AudioUtil} class.
15 */
16public class AudioUtilTest {
17
18 private static final double EPSILON = 1e-11;
19
20 /**
21 * Setup test.
22 */
23 @BeforeClass
24 public static void setUp() {
25 JOSMFixture.createUnitTestFixture().init();
26 }
27
28 /**
29 * Test method for {@code AudioUtil#getCalibratedDuration(File)}
30 */
31 @Test
32 public void testGetCalibratedDuration() {
33 assertEquals(0.0, AudioUtil.getCalibratedDuration(new File("invalid_file")), EPSILON);
34 File wav1 = new File(TestUtils.getRegressionDataFile(6851, "20111003_121226.wav"));
35 assertEquals(4.8317006802721085, AudioUtil.getCalibratedDuration(wav1), EPSILON);
36 File wav2 = new File(TestUtils.getRegressionDataFile(6851, "20111003_121557.wav"));
37 assertEquals(4.924580498866213, AudioUtil.getCalibratedDuration(wav2), EPSILON);
38 }
39}
Note: See TracBrowser for help on using the repository browser.