提交 deed1585 authored 作者: Thomas Mueller's avatar Thomas Mueller

spaces instead of tabs

上级 39c7c431
/*
* Copyright 2004-2009 H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
* Copyright 2004-2009 H2 Group. Multiple-Licensed under the H2 License, Version
* 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html). Initial Developer: H2 Group
*/
package org.h2.test.unit;
import java.util.BitSet;
import java.util.Random;
import org.h2.test.TestBase;
import org.h2.util.BitField;
......@@ -151,21 +149,21 @@ public class TestBitField extends TestBase {
}
}
private void testRandomSetRange(){
private void testRandomSetRange() {
BitField bits = new BitField();
BitSet set = new BitSet();
Random random = new Random(1);
int maxoff = 500;
int maxlen = 500;
int total = maxoff+maxlen;
int total = maxoff + maxlen;
int count = 10000;
for (int i = 0; i < count; i++) {
int offset = random.nextInt(maxoff);
int len = random.nextInt(maxlen);
boolean val = random.nextBoolean();
set.set(offset,offset+len,val);
bits.setRange(offset,len,val);
for(int j=0; j<total; j++){
set.set(offset, offset + len, val);
bits.setRange(offset, len, val);
for (int j = 0; j < total; j++) {
assertEquals(bits.get(j), set.get(j));
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论