Move assets from FLAC extension to testdata
PiperOrigin-RevId: 293553412
This commit is contained in:
parent
011efcc522
commit
79a3bad4c3
@ -29,9 +29,12 @@ android {
|
|||||||
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets.main {
|
sourceSets {
|
||||||
jniLibs.srcDir 'src/main/libs'
|
main {
|
||||||
jni.srcDirs = [] // Disable the automatic ndk-build call by Android Studio.
|
jniLibs.srcDir 'src/main/libs'
|
||||||
|
jni.srcDirs = [] // Disable the automatic ndk-build call by Android Studio.
|
||||||
|
}
|
||||||
|
androidTest.assets.srcDir '../../testdata/src/test/assets/'
|
||||||
}
|
}
|
||||||
|
|
||||||
testOptions.unitTests.includeAndroidResources = true
|
testOptions.unitTests.includeAndroidResources = true
|
||||||
@ -46,6 +49,7 @@ dependencies {
|
|||||||
testImplementation 'androidx.test:core:' + androidxTestCoreVersion
|
testImplementation 'androidx.test:core:' + androidxTestCoreVersion
|
||||||
testImplementation 'androidx.test.ext:junit:' + androidxTestJUnitVersion
|
testImplementation 'androidx.test.ext:junit:' + androidxTestJUnitVersion
|
||||||
testImplementation project(modulePrefix + 'testutils')
|
testImplementation project(modulePrefix + 'testutils')
|
||||||
|
testImplementation project(modulePrefix + 'testdata')
|
||||||
testImplementation 'org.robolectric:robolectric:' + robolectricVersion
|
testImplementation 'org.robolectric:robolectric:' + robolectricVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ import org.junit.runner.RunWith;
|
|||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(AndroidJUnit4.class)
|
||||||
public final class FlacBinarySearchSeekerTest {
|
public final class FlacBinarySearchSeekerTest {
|
||||||
|
|
||||||
private static final String NOSEEKTABLE_FLAC = "bear_no_seek.flac";
|
private static final String NOSEEKTABLE_FLAC = "flac/ext-bear_no_seek.flac";
|
||||||
private static final int DURATION_US = 2_741_000;
|
private static final int DURATION_US = 2_741_000;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
|
@ -48,7 +48,7 @@ import org.junit.runner.RunWith;
|
|||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(AndroidJUnit4.class)
|
||||||
public final class FlacExtractorSeekTest {
|
public final class FlacExtractorSeekTest {
|
||||||
|
|
||||||
private static final String NO_SEEKTABLE_FLAC = "bear_no_seek.flac";
|
private static final String NO_SEEKTABLE_FLAC = "flac/ext-bear_no_seek.flac";
|
||||||
private static final int DURATION_US = 2_741_000;
|
private static final int DURATION_US = 2_741_000;
|
||||||
private static final Uri FILE_URI = Uri.parse("file:///android_asset/" + NO_SEEKTABLE_FLAC);
|
private static final Uri FILE_URI = Uri.parse("file:///android_asset/" + NO_SEEKTABLE_FLAC);
|
||||||
private static final Random RANDOM = new Random(1234L);
|
private static final Random RANDOM = new Random(1234L);
|
||||||
|
@ -38,12 +38,14 @@ public class FlacExtractorTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testExtractFlacSample() throws Exception {
|
public void testExtractFlacSample() throws Exception {
|
||||||
ExtractorAsserts.assertBehavior(
|
ExtractorAsserts.assertBehavior(
|
||||||
FlacExtractor::new, "bear.flac", ApplicationProvider.getApplicationContext());
|
FlacExtractor::new, "flac/ext-bear.flac", ApplicationProvider.getApplicationContext());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testExtractFlacSampleWithId3Header() throws Exception {
|
public void testExtractFlacSampleWithId3Header() throws Exception {
|
||||||
ExtractorAsserts.assertBehavior(
|
ExtractorAsserts.assertBehavior(
|
||||||
FlacExtractor::new, "bear_with_id3.flac", ApplicationProvider.getApplicationContext());
|
FlacExtractor::new,
|
||||||
|
"flac/ext-bear_with_id3.flac",
|
||||||
|
ApplicationProvider.getApplicationContext());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,8 +42,8 @@ import org.junit.runner.RunWith;
|
|||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(AndroidJUnit4.class)
|
||||||
public class FlacPlaybackTest {
|
public class FlacPlaybackTest {
|
||||||
|
|
||||||
private static final String BEAR_FLAC_16BIT = "bear-flac-16bit.mka";
|
private static final String BEAR_FLAC_16BIT = "flac/ext-bear-flac-16bit.mka";
|
||||||
private static final String BEAR_FLAC_24BIT = "bear-flac-24bit.mka";
|
private static final String BEAR_FLAC_24BIT = "flac/ext-bear-flac-24bit.mka";
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user