Last change
on this file since 9704 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
|
Rev | Line | |
---|
[9666] | 1 | // License: GPL. For details, see LICENSE file.
|
---|
| 2 | package org.openstreetmap.josm.tools;
|
---|
| 3 |
|
---|
| 4 | import static org.junit.Assert.assertEquals;
|
---|
| 5 |
|
---|
| 6 | import java.io.File;
|
---|
| 7 |
|
---|
| 8 | import org.junit.BeforeClass;
|
---|
| 9 | import org.junit.Test;
|
---|
| 10 | import org.openstreetmap.josm.JOSMFixture;
|
---|
| 11 | import org.openstreetmap.josm.TestUtils;
|
---|
| 12 |
|
---|
| 13 | /**
|
---|
| 14 | * Unit tests of {@link AudioUtil} class.
|
---|
| 15 | */
|
---|
| 16 | public 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.