mirror of https://github.com/apache/lucene.git
LUCENE-1926: a more improved version of the test to also fill the attributes with bogus values. This should e.g. detect bugs with position increment not correctly set in all cases
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@818920 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b0706ed6b6
commit
c390d49290
|
@ -111,7 +111,13 @@ public abstract class BaseTokenStreamTestCase extends LuceneTestCase {
|
|||
|
||||
ts.reset();
|
||||
for (int i = 0; i < output.length; i++) {
|
||||
ts.clearAttributes(); // extra safety to enforce, that the state is not preserved
|
||||
// extra safety to enforce, that the state is not preserved and also assign bogus values
|
||||
ts.clearAttributes();
|
||||
termAtt.setTermBuffer("bogusTerm");
|
||||
if (offsetAtt != null) offsetAtt.setOffset(14584724,24683243);
|
||||
if (typeAtt != null) typeAtt.setType("bogusType");
|
||||
if (posIncrAtt != null) posIncrAtt.setPositionIncrement(45987657);
|
||||
|
||||
assertTrue("token "+i+" exists", ts.incrementToken());
|
||||
assertEquals("term "+i, output[i], termAtt.term());
|
||||
if (startOffsets != null)
|
||||
|
|
Loading…
Reference in New Issue