diff options
author | Andreas Huber <andih@google.com> | 2010-01-20 12:12:24 -0800 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2010-01-20 12:16:36 -0800 |
commit | 06b3ff7d5a7903d6804d295110820c121629ee4d (patch) | |
tree | d42ab20d6eeab5f20dd0c544ea4c2dcd3c2bb387 /media/tests | |
parent | 918007b75539f5eabfd173a369c2da628c607ba7 (diff) | |
download | frameworks_base-06b3ff7d5a7903d6804d295110820c121629ee4d.zip frameworks_base-06b3ff7d5a7903d6804d295110820c121629ee4d.tar.gz frameworks_base-06b3ff7d5a7903d6804d295110820c121629ee4d.tar.bz2 |
Make the MediaMetadataTest a little more lenient when it comes to verifying the duration of media files, only require that the returned duration is within 100ms of the expected one, as the PV and stagefright implementations differ slightly.
related-to-bug: 2377534
Diffstat (limited to 'media/tests')
-rw-r--r-- | media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaMetadataTest.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaMetadataTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaMetadataTest.java index ca60e8c..95dbb97 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaMetadataTest.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaMetadataTest.java @@ -250,7 +250,11 @@ public class MediaMetadataTest extends AndroidTestCase { value = retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION); Log.v(TAG, "Expected = " + meta_data_file[fileIndex][meta.DURATION.ordinal()] + "reult = " + value); - assertEquals(TAG, meta_data_file[fileIndex][meta.DURATION.ordinal()], value); + // Only require that the returned duration is within 100ms of the expected + // one as PV and stagefright differ slightly in their implementation. + assertTrue(TAG, Math.abs(Integer.parseInt( + meta_data_file[fileIndex][meta.DURATION.ordinal()]) + - Integer.parseInt(value)) < 100); //METADATA_KEY_NUM_TRACKS should return the total number of tracks in the media //include the video and audio |