summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/omx/tests
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2010-03-18 13:37:39 -0700
committerAndreas Huber <andih@google.com>2010-03-18 13:37:39 -0700
commit1c6cebadf4579d997fdce946a1d00317c3e4c567 (patch)
tree920ee0a7dbf91ee8ff4eaa3802336830faa738a8 /media/libstagefright/omx/tests
parenta89e12dfa46fe42b6309e945585310a89a5a1600 (diff)
downloadframeworks_av-1c6cebadf4579d997fdce946a1d00317c3e4c567.zip
frameworks_av-1c6cebadf4579d997fdce946a1d00317c3e4c567.tar.gz
frameworks_av-1c6cebadf4579d997fdce946a1d00317c3e4c567.tar.bz2
Tweak the omx tests to always do a seek-beyond-EOS on the first iteration, followed by a linear read on the second iteration.
Change-Id: I16fc9e42ee9f8e4cb120ab41364cae6dd4544634 related-to-bug: 2338792
Diffstat (limited to 'media/libstagefright/omx/tests')
-rw-r--r--media/libstagefright/omx/tests/OMXHarness.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/media/libstagefright/omx/tests/OMXHarness.cpp b/media/libstagefright/omx/tests/OMXHarness.cpp
index c05d90a..fcf506d 100644
--- a/media/libstagefright/omx/tests/OMXHarness.cpp
+++ b/media/libstagefright/omx/tests/OMXHarness.cpp
@@ -595,6 +595,9 @@ status_t Harness::testSeek(
static const int32_t kNumIterations = 5000;
+ // We are always going to seek beyond EOS in the first iteration (i == 0)
+ // followed by a linear read for the second iteration (i == 1).
+ // After that it's all random.
for (int32_t i = 0; i < kNumIterations; ++i) {
int64_t requestedSeekTimeUs;
int64_t actualSeekTimeUs;
@@ -602,14 +605,14 @@ status_t Harness::testSeek(
double r = uniform_rand();
- if (i > 0 && r < 0.5) {
+ if ((i == 1) || (i > 0 && r < 0.5)) {
// 50% chance of just continuing to decode from last position.
requestedSeekTimeUs = -1;
LOGI("requesting linear read");
} else {
- if (i > 0 && r < 0.55) {
+ if (i == 0 || r < 0.55) {
// 5% chance of seeking beyond end of stream.
requestedSeekTimeUs = durationUs;
@@ -674,7 +677,15 @@ status_t Harness::testSeek(
buffer = NULL;
}
} else if (actualSeekTimeUs < 0) {
- CHECK(err != OK);
+ EXPECT(err != OK,
+ "We attempted to seek beyond EOS and expected "
+ "ERROR_END_OF_STREAM to be returned, but instead "
+ "we got a valid buffer.");
+ EXPECT(err == ERROR_END_OF_STREAM,
+ "We attempted to seek beyond EOS and expected "
+ "ERROR_END_OF_STREAM to be returned, but instead "
+ "we found some other error.");
+ CHECK_EQ(err, ERROR_END_OF_STREAM);
CHECK_EQ(buffer, NULL);
} else {
EXPECT(err == OK,