Skip to content

Commit

Permalink
Improve Extractor partial read tests.
Browse files Browse the repository at this point in the history
Partial reads were performed once using a partial size of 1 byte.
This was not enough to detect problems which only occur in combination
with IOExceptions. Partial reads are now only applied when no exception
is thrown.

Moreover, the tests didn't check whether the total number of sampled bytes
is what it is supposed to be. Added a field to the data dumps checking
the total number of bytes in the sampled data.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=181296545
  • Loading branch information
tonihei authored and ojw28 committed Jan 15, 2018
1 parent d427a1d commit 4ee9710
Show file tree
Hide file tree
Showing 57 changed files with 109 additions and 25 deletions.
1 change: 1 addition & 0 deletions extensions/flac/src/androidTest/assets/bear.flac.0.dump
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ track 0:
language = null
drmInitData = -
initializationData:
total output bytes = 526272
sample count = 33
sample 0:
time = 0
Expand Down
1 change: 1 addition & 0 deletions extensions/flac/src/androidTest/assets/bear.flac.1.dump
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ track 0:
language = null
drmInitData = -
initializationData:
total output bytes = 362432
sample count = 23
sample 0:
time = 853333
Expand Down
1 change: 1 addition & 0 deletions extensions/flac/src/androidTest/assets/bear.flac.2.dump
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ track 0:
language = null
drmInitData = -
initializationData:
total output bytes = 182208
sample count = 12
sample 0:
time = 1792000
Expand Down
1 change: 1 addition & 0 deletions extensions/flac/src/androidTest/assets/bear.flac.3.dump
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ track 0:
language = null
drmInitData = -
initializationData:
total output bytes = 18368
sample count = 2
sample 0:
time = 2645333
Expand Down
2 changes: 2 additions & 0 deletions library/core/src/androidTest/assets/flv/sample.flv.0.dump
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ track 8:
drmInitData = -
initializationData:
data = length 2, hash 5F7
total output bytes = 9529
sample count = 45
sample 0:
time = 112000
Expand Down Expand Up @@ -231,6 +232,7 @@ track 9:
initializationData:
data = length 30, hash F6F3D010
data = length 10, hash 7A0D0F2B
total output bytes = 89502
sample count = 30
sample 0:
time = 67000
Expand Down
2 changes: 2 additions & 0 deletions library/core/src/androidTest/assets/mkv/sample.mkv.0.dump
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ track 1:
initializationData:
data = length 30, hash F6F3D010
data = length 10, hash 7A0D0F2B
total output bytes = 89502
sample count = 30
sample 0:
time = 67000
Expand Down Expand Up @@ -170,6 +171,7 @@ track 2:
language = und
drmInitData = -
initializationData:
total output bytes = 12120
sample count = 29
sample 0:
time = 129000
Expand Down
2 changes: 2 additions & 0 deletions library/core/src/androidTest/assets/mkv/sample.mkv.1.dump
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ track 1:
initializationData:
data = length 30, hash F6F3D010
data = length 10, hash 7A0D0F2B
total output bytes = 30995
sample count = 22
sample 0:
time = 334000
Expand Down Expand Up @@ -138,6 +139,7 @@ track 2:
language = und
drmInitData = -
initializationData:
total output bytes = 8778
sample count = 21
sample 0:
time = 408000
Expand Down
2 changes: 2 additions & 0 deletions library/core/src/androidTest/assets/mkv/sample.mkv.2.dump
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ track 1:
initializationData:
data = length 30, hash F6F3D010
data = length 10, hash 7A0D0F2B
total output bytes = 10158
sample count = 11
sample 0:
time = 700000
Expand Down Expand Up @@ -94,6 +95,7 @@ track 2:
language = und
drmInitData = -
initializationData:
total output bytes = 4180
sample count = 10
sample 0:
time = 791000
Expand Down
2 changes: 2 additions & 0 deletions library/core/src/androidTest/assets/mkv/sample.mkv.3.dump
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ track 1:
initializationData:
data = length 30, hash F6F3D010
data = length 10, hash 7A0D0F2B
total output bytes = 0
sample count = 0
track 2:
format:
Expand All @@ -50,6 +51,7 @@ track 2:
language = und
drmInitData = -
initializationData:
total output bytes = 1254
sample count = 3
sample 0:
time = 1035000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ track 1:
language = null
drmInitData = 1305012705
initializationData:
total output bytes = 39
sample count = 1
sample 0:
time = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ track 1:
language = null
drmInitData = 1305012705
initializationData:
total output bytes = 24
sample count = 1
sample 0:
time = 0
Expand Down
1 change: 1 addition & 0 deletions library/core/src/androidTest/assets/mp3/bear.mp3.0.dump
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ track 0:
language = null
drmInitData = -
initializationData:
total output bytes = 44544
sample count = 116
sample 0:
time = 0
Expand Down
1 change: 1 addition & 0 deletions library/core/src/androidTest/assets/mp3/bear.mp3.1.dump
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ track 0:
language = null
drmInitData = -
initializationData:
total output bytes = 29568
sample count = 77
sample 0:
time = 928568
Expand Down
1 change: 1 addition & 0 deletions library/core/src/androidTest/assets/mp3/bear.mp3.2.dump
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ track 0:
language = null
drmInitData = -
initializationData:
total output bytes = 14592
sample count = 38
sample 0:
time = 1871586
Expand Down
1 change: 1 addition & 0 deletions library/core/src/androidTest/assets/mp3/bear.mp3.3.dump
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ track 0:
language = null
drmInitData = -
initializationData:
total output bytes = 0
sample count = 0
tracksEnded = true
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ track 0:
language = null
drmInitData = -
initializationData:
total output bytes = 418
sample count = 1
sample 0:
time = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ track 0:
language = null
drmInitData = -
initializationData:
total output bytes = 418
sample count = 1
sample 0:
time = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ track 0:
language = null
drmInitData = -
initializationData:
total output bytes = 418
sample count = 1
sample 0:
time = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ track 0:
language = null
drmInitData = -
initializationData:
total output bytes = 418
sample count = 1
sample 0:
time = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ track 0:
language = null
drmInitData = -
initializationData:
total output bytes = 418
sample count = 1
sample 0:
time = 0
Expand Down
2 changes: 2 additions & 0 deletions library/core/src/androidTest/assets/mp4/sample.mp4.0.dump
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ track 0:
initializationData:
data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B
total output bytes = 89876
sample count = 30
sample 0:
time = 0
Expand Down Expand Up @@ -171,6 +172,7 @@ track 1:
drmInitData = -
initializationData:
data = length 2, hash 5F7
total output bytes = 9529
sample count = 45
sample 0:
time = 44000
Expand Down
2 changes: 2 additions & 0 deletions library/core/src/androidTest/assets/mp4/sample.mp4.1.dump
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ track 0:
initializationData:
data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B
total output bytes = 89876
sample count = 30
sample 0:
time = 0
Expand Down Expand Up @@ -171,6 +172,7 @@ track 1:
drmInitData = -
initializationData:
data = length 2, hash 5F7
total output bytes = 7464
sample count = 33
sample 0:
time = 322639
Expand Down
2 changes: 2 additions & 0 deletions library/core/src/androidTest/assets/mp4/sample.mp4.2.dump
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ track 0:
initializationData:
data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B
total output bytes = 89876
sample count = 30
sample 0:
time = 0
Expand Down Expand Up @@ -171,6 +172,7 @@ track 1:
drmInitData = -
initializationData:
data = length 2, hash 5F7
total output bytes = 4019
sample count = 18
sample 0:
time = 670938
Expand Down
2 changes: 2 additions & 0 deletions library/core/src/androidTest/assets/mp4/sample.mp4.3.dump
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ track 0:
initializationData:
data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B
total output bytes = 89876
sample count = 30
sample 0:
time = 0
Expand Down Expand Up @@ -171,6 +172,7 @@ track 1:
drmInitData = -
initializationData:
data = length 2, hash 5F7
total output bytes = 470
sample count = 3
sample 0:
time = 1019238
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ track 0:
initializationData:
data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B
total output bytes = 85933
sample count = 30
sample 0:
time = 66000
Expand Down Expand Up @@ -171,6 +172,7 @@ track 1:
drmInitData = -
initializationData:
data = length 5, hash 2B7623A
total output bytes = 18257
sample count = 46
sample 0:
time = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ track 0:
initializationData:
data = length 29, hash 4746B5D9
data = length 10, hash 7A0D0F2B
total output bytes = 85933
sample count = 30
sample 0:
time = 66000
Expand Down Expand Up @@ -171,6 +172,7 @@ track 1:
drmInitData = -
initializationData:
data = length 5, hash 2B7623A
total output bytes = 18257
sample count = 46
sample 0:
time = 0
Expand Down Expand Up @@ -378,5 +380,6 @@ track 3:
language = null
drmInitData = -
initializationData:
total output bytes = 0
sample count = 0
tracksEnded = true
1 change: 1 addition & 0 deletions library/core/src/androidTest/assets/ogg/bear.opus.0.dump
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ track 0:
data = length 19, hash BFE794DB
data = length 8, hash CA22068C
data = length 8, hash 79C07075
total output bytes = 25541
sample count = 275
sample 0:
time = 0
Expand Down
1 change: 1 addition & 0 deletions library/core/src/androidTest/assets/ogg/bear.opus.1.dump
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ track 0:
data = length 19, hash BFE794DB
data = length 8, hash CA22068C
data = length 8, hash 79C07075
total output bytes = 17031
sample count = 184
sample 0:
time = 910000
Expand Down
1 change: 1 addition & 0 deletions library/core/src/androidTest/assets/ogg/bear.opus.2.dump
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ track 0:
data = length 19, hash BFE794DB
data = length 8, hash CA22068C
data = length 8, hash 79C07075
total output bytes = 8698
sample count = 92
sample 0:
time = 1830000
Expand Down
1 change: 1 addition & 0 deletions library/core/src/androidTest/assets/ogg/bear.opus.3.dump
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ track 0:
data = length 19, hash BFE794DB
data = length 8, hash CA22068C
data = length 8, hash 79C07075
total output bytes = 126
sample count = 1
sample 0:
time = 2741000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ track 0:
data = length 19, hash BFE794DB
data = length 8, hash CA22068C
data = length 8, hash 79C07075
total output bytes = 25541
sample count = 275
sample 0:
time = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ track 0:
drmInitData = -
initializationData:
data = length 42, hash 83F6895
total output bytes = 164431
sample count = 33
sample 0:
time = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ track 0:
drmInitData = -
initializationData:
data = length 42, hash 83F6895
total output bytes = 113666
sample count = 23
sample 0:
time = 853333
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ track 0:
drmInitData = -
initializationData:
data = length 42, hash 83F6895
total output bytes = 55652
sample count = 12
sample 0:
time = 1792000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ track 0:
drmInitData = -
initializationData:
data = length 42, hash 83F6895
total output bytes = 445
sample count = 1
sample 0:
time = 2730666
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ track 0:
drmInitData = -
initializationData:
data = length 42, hash 83F6895
total output bytes = 164431
sample count = 33
sample 0:
time = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ track 0:
drmInitData = -
initializationData:
data = length 42, hash 83F6895
total output bytes = 164431
sample count = 33
sample 0:
time = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ track 0:
drmInitData = -
initializationData:
data = length 42, hash 83F6895
total output bytes = 113666
sample count = 23
sample 0:
time = 853333
Expand Down
Loading

0 comments on commit 4ee9710

Please sign in to comment.