use fixed byte size valid unicode string rather than a truncated unicde string for fixed IDV variants in RIW

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1180439 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Simon Willnauer 2011-10-08 18:03:55 +00:00
parent 9ccc145128
commit bee60b6144
1 changed files with 2 additions and 1 deletions

View File

@ -178,7 +178,8 @@ public class RandomIndexWriter implements Closeable {
case BYTES_FIXED_DEREF:
case BYTES_FIXED_STRAIGHT:
case BYTES_FIXED_SORTED:
final String randomUnicodeString = _TestUtil.randomUnicodeString(random, fixedBytesLength);
//make sure we use a valid unicode string with a fixed size byte length
final String randomUnicodeString = _TestUtil.randomFixedByteLengthUnicodeString(random, fixedBytesLength);
BytesRef fixedRef = new BytesRef(randomUnicodeString);
if (fixedRef.length > fixedBytesLength) {
fixedRef = new BytesRef(fixedRef.bytes, 0, fixedBytesLength);