Skip to content

Commit

Permalink
Ignore decoding test cases when library not available
Browse files Browse the repository at this point in the history
#minor-release

PiperOrigin-RevId: 452043577
  • Loading branch information
marcbaechinger committed May 31, 2022
1 parent 14ed32c commit c386644
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package com.google.android.exoplayer2.ext.opus;

import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assume.assumeTrue;

import androidx.annotation.Nullable;
import androidx.test.ext.junit.runners.AndroidJUnit4;
Expand All @@ -26,7 +27,6 @@
import com.google.common.collect.ImmutableList;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

Expand Down Expand Up @@ -69,11 +69,6 @@ protected void loadLibrary(String name) {
private static final ImmutableList<byte[]> FULL_INITIALIZATION_DATA =
ImmutableList.of(HEADER, CUSTOM_PRE_SKIP_BYTES, CUSTOM_SEEK_PRE_ROLL_BYTES);

@Before
public void setUp() {
assertThat(LOADER.isAvailable()).isTrue();
}

@Test
public void getChannelCount() {
int channelCount = OpusDecoder.getChannelCount(HEADER);
Expand Down Expand Up @@ -120,6 +115,7 @@ public void getDiscardPaddingSamples_negativeSampleLength_returnZero() {

@Test
public void decode_removesPreSkipFromOutput() throws OpusDecoderException {
assumeTrue(LOADER.isAvailable());
OpusDecoder decoder =
new OpusDecoder(
/* numInputBuffers= */ 0,
Expand All @@ -139,6 +135,7 @@ public void decode_removesPreSkipFromOutput() throws OpusDecoderException {
@Test
public void decode_whenDiscardPaddingDisabled_returnsDiscardPadding()
throws OpusDecoderException {
assumeTrue(LOADER.isAvailable());
OpusDecoder decoder =
new OpusDecoder(
/* numInputBuffers= */ 0,
Expand All @@ -159,6 +156,7 @@ public void decode_whenDiscardPaddingDisabled_returnsDiscardPadding()

@Test
public void decode_whenDiscardPaddingEnabled_removesDiscardPadding() throws OpusDecoderException {
assumeTrue(LOADER.isAvailable());
OpusDecoder decoder =
new OpusDecoder(
/* numInputBuffers= */ 0,
Expand Down

0 comments on commit c386644

Please sign in to comment.