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

--no commit message

--no commit message
上级 c6a5cfc3
......@@ -18,7 +18,10 @@ Change Log
<h1>Change Log</h1>
<h2>Next Version (unreleased)</h2>
<ul><li>The wrong parameters were bound to subqueries with parameters, specially
<ul><li>Opening large database is now faster.
</li><li>New system property h2.socketConnectTimeout, the timeout in milliseconds
to connect to a server. The default is 2000 (2 seconds).
</li><li>The wrong parameters were bound to subqueries with parameters, specially
when using IN(SELECT ...) and IN(...).
</li><li>Unset parameters were not detected when the query was re-compiled.
</li><li>New functions ISO_YEAR, ISO_WEEK, ISO_DAY_OF_WEEK.
......
......@@ -278,15 +278,7 @@ java org.h2.test.TestAll timer
System.setProperty("h2.check2", "true");
/*
java -Xmx3m
create table test(name varchar);
set max_log_size 1024;
@LOOP 20000 insert into test values(space(10000));
delete from test;
SELECT * FROM TEST where name like 'a';
test with 1.0
document shared connections for linked tables
......
......@@ -17,10 +17,51 @@ import org.h2.util.BitField;
*/
public class TestBitField extends TestBase {
/**
* Run just this test.
*
* @param a ignored
*/
public static void main(String[] a) throws Exception {
TestBase.createCaller().init().test();
}
public void test() {
testByteOperations();
testRandom();
testGetSet();
}
private void testByteOperations() {
BitField used = new BitField();
testSetFast(used, false);
testSetFast(used, true);
}
private void testSetFast(BitField used, boolean init) {
int len = 10000;
Random random = new Random(1);
for (int i = 0, x = 0; i < len / 8; i++) {
int mask = random.nextInt() & 255;
if (init) {
assertEquals(mask, used.getByte(x));
x += 8;
// for (int j = 0; j < 8; j++, x++) {
// if (used.get(x) != ((mask & (1 << j)) != 0)) {
// throw Message.getInternalError("Redo failure, block: " + x + " expected in-use bit: " + used.get(x));
// }
// }
} else {
used.setByte(x, mask);
x += 8;
// for (int j = 0; j < 8; j++, x++) {
// if ((mask & (1 << j)) != 0) {
// used.set(x);
// }
// }
}
}
}
private void testRandom() {
BitField bits = new BitField();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论