16
16
package com .google .android .exoplayer2 .ext .opus ;
17
17
18
18
import static com .google .common .truth .Truth .assertThat ;
19
+ import static org .junit .Assume .assumeTrue ;
19
20
20
21
import androidx .annotation .Nullable ;
21
22
import androidx .test .ext .junit .runners .AndroidJUnit4 ;
26
27
import com .google .common .collect .ImmutableList ;
27
28
import java .nio .ByteBuffer ;
28
29
import java .nio .ByteOrder ;
29
- import org .junit .Before ;
30
30
import org .junit .Test ;
31
31
import org .junit .runner .RunWith ;
32
32
@@ -69,11 +69,6 @@ protected void loadLibrary(String name) {
69
69
private static final ImmutableList <byte []> FULL_INITIALIZATION_DATA =
70
70
ImmutableList .of (HEADER , CUSTOM_PRE_SKIP_BYTES , CUSTOM_SEEK_PRE_ROLL_BYTES );
71
71
72
- @ Before
73
- public void setUp () {
74
- assertThat (LOADER .isAvailable ()).isTrue ();
75
- }
76
-
77
72
@ Test
78
73
public void getChannelCount () {
79
74
int channelCount = OpusDecoder .getChannelCount (HEADER );
@@ -120,6 +115,7 @@ public void getDiscardPaddingSamples_negativeSampleLength_returnZero() {
120
115
121
116
@ Test
122
117
public void decode_removesPreSkipFromOutput () throws OpusDecoderException {
118
+ assumeTrue (LOADER .isAvailable ());
123
119
OpusDecoder decoder =
124
120
new OpusDecoder (
125
121
/* numInputBuffers= */ 0 ,
@@ -139,6 +135,7 @@ public void decode_removesPreSkipFromOutput() throws OpusDecoderException {
139
135
@ Test
140
136
public void decode_whenDiscardPaddingDisabled_returnsDiscardPadding ()
141
137
throws OpusDecoderException {
138
+ assumeTrue (LOADER .isAvailable ());
142
139
OpusDecoder decoder =
143
140
new OpusDecoder (
144
141
/* numInputBuffers= */ 0 ,
@@ -159,6 +156,7 @@ public void decode_whenDiscardPaddingDisabled_returnsDiscardPadding()
159
156
160
157
@ Test
161
158
public void decode_whenDiscardPaddingEnabled_removesDiscardPadding () throws OpusDecoderException {
159
+ assumeTrue (LOADER .isAvailable ());
162
160
OpusDecoder decoder =
163
161
new OpusDecoder (
164
162
/* numInputBuffers= */ 0 ,
0 commit comments