Commit 80b10b5f by eguven Committed by Oliver Woodman

TestUtil.consumeTestData(): Make sure extractor doesn't use the position holder out of purpose.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124335837
parent 98b7e7f4
...@@ -84,6 +84,9 @@ public class TestUtil { ...@@ -84,6 +84,9 @@ public class TestUtil {
int readResult = Extractor.RESULT_CONTINUE; int readResult = Extractor.RESULT_CONTINUE;
while (readResult != Extractor.RESULT_END_OF_INPUT) { while (readResult != Extractor.RESULT_END_OF_INPUT) {
try { try {
// Extractor.read should not read seekPositionHolder.position. Set it to a value that's
// likely to cause test failure if a read does occur.
seekPositionHolder.position = Long.MIN_VALUE;
readResult = extractor.read(input, seekPositionHolder); readResult = extractor.read(input, seekPositionHolder);
if (readResult == Extractor.RESULT_SEEK) { if (readResult == Extractor.RESULT_SEEK) {
long seekPosition = seekPositionHolder.position; long seekPosition = seekPositionHolder.position;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment