Commit 98b7e7f4 by eguven Committed by Oliver Woodman

AdtsExtractorTest

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124335597
parent 57d6c49e
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.android.exoplayer.extractor.ts;
import com.google.android.exoplayer.extractor.Extractor;
import com.google.android.exoplayer.testutil.TestUtil;
import android.test.InstrumentationTestCase;
/**
* Unit test for {@link AdtsExtractor}.
*/
public final class AdtsExtractorTest extends InstrumentationTestCase {
public void testSample() throws Exception {
TestUtil.assertOutput(new TestUtil.ExtractorFactory() {
@Override
public Extractor create() {
return new AdtsExtractor();
}
}, "ts/sample.adts", getInstrumentation());
}
}
...@@ -89,8 +89,9 @@ public final class FakeExtractorOutput implements ExtractorOutput, Dumper.Dumpab ...@@ -89,8 +89,9 @@ public final class FakeExtractorOutput implements ExtractorOutput, Dumper.Dumpab
} }
public void assertOutput(Instrumentation instrumentation, String dumpFile) throws IOException { public void assertOutput(Instrumentation instrumentation, String dumpFile) throws IOException {
String dumpExpected = TestUtil.getString(instrumentation, dumpFile); String actual = new Dumper().add(this).toString();
Assert.assertEquals(dumpExpected, new Dumper().add(this).toString()); String expected = TestUtil.getString(instrumentation, dumpFile);
Assert.assertEquals(expected, actual);
} }
@Override @Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment