1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-11-05 01:26:23 +00:00

Fixed test compilation

This commit is contained in:
litetex 2022-03-26 21:44:16 +01:00
parent 102c05e927
commit 93deaa5687

View File

@ -199,17 +199,17 @@ public class ListHelperTest {
public void getHighestQualityAudioFormatTest() {
AudioStream stream = AUDIO_STREAMS_TEST_LIST.get(ListHelper.getHighestQualityAudioIndex(
MediaFormat.M4A, AUDIO_STREAMS_TEST_LIST));
assertEquals(320, stream.average_bitrate);
assertEquals(320, stream.getAverageBitrate());
assertEquals(MediaFormat.M4A, stream.getFormat());
stream = AUDIO_STREAMS_TEST_LIST.get(ListHelper.getHighestQualityAudioIndex(
MediaFormat.WEBMA, AUDIO_STREAMS_TEST_LIST));
assertEquals(320, stream.average_bitrate);
assertEquals(320, stream.getAverageBitrate());
assertEquals(MediaFormat.WEBMA, stream.getFormat());
stream = AUDIO_STREAMS_TEST_LIST.get(ListHelper.getHighestQualityAudioIndex(
MediaFormat.MP3, AUDIO_STREAMS_TEST_LIST));
assertEquals(192, stream.average_bitrate);
assertEquals(192, stream.getAverageBitrate());
assertEquals(MediaFormat.MP3, stream.getFormat());
}
@ -227,7 +227,7 @@ public class ListHelperTest {
// It should fallback to the highest bitrate audio no matter what format it is
AudioStream stream = testList.get(ListHelper.getHighestQualityAudioIndex(
MediaFormat.MP3, testList));
assertEquals(192, stream.average_bitrate);
assertEquals(192, stream.getAverageBitrate());
assertEquals(MediaFormat.WEBMA, stream.getFormat());
////////////////////////////////////////////////////////
@ -245,14 +245,14 @@ public class ListHelperTest {
// List doesn't contains this format, it should fallback to the highest bitrate audio and
// the highest quality format.
stream = testList.get(ListHelper.getHighestQualityAudioIndex(MediaFormat.MP3, testList));
assertEquals(192, stream.average_bitrate);
assertEquals(192, stream.getAverageBitrate());
assertEquals(MediaFormat.M4A, stream.getFormat());
// Adding a new format and bitrate. Adding another stream will have no impact since
// it's not a preferred format.
testList.add(new AudioStream("", MediaFormat.WEBMA, /**/ 192));
stream = testList.get(ListHelper.getHighestQualityAudioIndex(MediaFormat.MP3, testList));
assertEquals(192, stream.average_bitrate);
assertEquals(192, stream.getAverageBitrate());
assertEquals(MediaFormat.M4A, stream.getFormat());
}
@ -266,17 +266,17 @@ public class ListHelperTest {
public void getLowestQualityAudioFormatTest() {
AudioStream stream = AUDIO_STREAMS_TEST_LIST.get(ListHelper.getMostCompactAudioIndex(
MediaFormat.M4A, AUDIO_STREAMS_TEST_LIST));
assertEquals(128, stream.average_bitrate);
assertEquals(128, stream.getAverageBitrate());
assertEquals(MediaFormat.M4A, stream.getFormat());
stream = AUDIO_STREAMS_TEST_LIST.get(ListHelper.getMostCompactAudioIndex(
MediaFormat.WEBMA, AUDIO_STREAMS_TEST_LIST));
assertEquals(64, stream.average_bitrate);
assertEquals(64, stream.getAverageBitrate());
assertEquals(MediaFormat.WEBMA, stream.getFormat());
stream = AUDIO_STREAMS_TEST_LIST.get(ListHelper.getMostCompactAudioIndex(
MediaFormat.MP3, AUDIO_STREAMS_TEST_LIST));
assertEquals(64, stream.average_bitrate);
assertEquals(64, stream.getAverageBitrate());
assertEquals(MediaFormat.MP3, stream.getFormat());
}
@ -294,13 +294,13 @@ public class ListHelperTest {
// It should fallback to the most compact audio no matter what format it is.
AudioStream stream = testList.get(ListHelper.getMostCompactAudioIndex(
MediaFormat.MP3, testList));
assertEquals(128, stream.average_bitrate);
assertEquals(128, stream.getAverageBitrate());
assertEquals(MediaFormat.M4A, stream.getFormat());
// WEBMA is more compact than M4A
testList.add(new AudioStream("", MediaFormat.WEBMA, /**/ 128));
stream = testList.get(ListHelper.getMostCompactAudioIndex(MediaFormat.MP3, testList));
assertEquals(128, stream.average_bitrate);
assertEquals(128, stream.getAverageBitrate());
assertEquals(MediaFormat.WEBMA, stream.getFormat());
////////////////////////////////////////////////////////
@ -317,12 +317,12 @@ public class ListHelperTest {
// List doesn't contain this format
// It should fallback to the most compact audio no matter what format it is.
stream = testList.get(ListHelper.getMostCompactAudioIndex(MediaFormat.MP3, testList));
assertEquals(192, stream.average_bitrate);
assertEquals(192, stream.getAverageBitrate());
assertEquals(MediaFormat.WEBMA, stream.getFormat());
// Should be same as above
stream = testList.get(ListHelper.getMostCompactAudioIndex(null, testList));
assertEquals(192, stream.average_bitrate);
assertEquals(192, stream.getAverageBitrate());
assertEquals(MediaFormat.WEBMA, stream.getFormat());
}