Add a space in the ParserException
message
PiperOrigin-RevId: 668870991
This commit is contained in:
parent
3587afc9d7
commit
05cbbffbd7
@ -113,7 +113,7 @@ public class ParserException extends IOException {
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return super.getMessage()
|
||||
+ "{contentIsMalformed="
|
||||
+ " {contentIsMalformed="
|
||||
+ contentIsMalformed
|
||||
+ ", dataType="
|
||||
+ dataType
|
||||
|
@ -20,6 +20,7 @@ import static androidx.media3.extractor.VorbisUtil.verifyVorbisHeaderCapturePatt
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import androidx.media3.common.C;
|
||||
import androidx.media3.common.ParserException;
|
||||
import androidx.media3.common.util.ParsableByteArray;
|
||||
import androidx.media3.test.utils.TestUtil;
|
||||
@ -116,8 +117,9 @@ public final class VorbisUtilTest {
|
||||
VorbisUtil.verifyVorbisHeaderCapturePattern(0x99, header, false);
|
||||
fail();
|
||||
} catch (ParserException e) {
|
||||
assertThat(e.getMessage())
|
||||
.isEqualTo("expected header type 99{contentIsMalformed=true, dataType=1}");
|
||||
assertThat(e).hasMessageThat().contains("expected header type 99");
|
||||
assertThat(e.contentIsMalformed).isTrue();
|
||||
assertThat(e.dataType).isEqualTo(C.DATA_TYPE_MEDIA);
|
||||
}
|
||||
}
|
||||
|
||||
@ -137,8 +139,9 @@ public final class VorbisUtilTest {
|
||||
VorbisUtil.verifyVorbisHeaderCapturePattern(0x01, header, false);
|
||||
fail();
|
||||
} catch (ParserException e) {
|
||||
assertThat(e.getMessage())
|
||||
.isEqualTo("expected characters 'vorbis'{contentIsMalformed=true, dataType=1}");
|
||||
assertThat(e).hasMessageThat().contains("expected characters 'vorbis'");
|
||||
assertThat(e.contentIsMalformed).isTrue();
|
||||
assertThat(e.dataType).isEqualTo(C.DATA_TYPE_MEDIA);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -157,13 +157,11 @@ public class ImageAssetLoaderTest {
|
||||
});
|
||||
ParserException parserException = (ParserException) exceptionRef.get().getCause();
|
||||
|
||||
assertThat(parserException.contentIsMalformed).isFalse();
|
||||
assertThat(parserException.dataType).isEqualTo(C.DATA_TYPE_MEDIA);
|
||||
assertThat(parserException)
|
||||
.hasMessageThat()
|
||||
.isEqualTo(
|
||||
"Attempted to load a Bitmap from unsupported MIME type:"
|
||||
+ " image/gif{contentIsMalformed=false, dataType=1}");
|
||||
.contains("Attempted to load a Bitmap from unsupported MIME type: image/gif");
|
||||
assertThat(parserException.contentIsMalformed).isFalse();
|
||||
assertThat(parserException.dataType).isEqualTo(C.DATA_TYPE_MEDIA);
|
||||
}
|
||||
|
||||
private static AssetLoader getAssetLoader(AssetLoader.Listener listener, String uri) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user