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

MVStore: tests

上级 247644d9
......@@ -115,6 +115,7 @@ import org.h2.test.store.TestDataUtils;
import org.h2.test.store.TestFreeSpace;
import org.h2.test.store.TestMVRTree;
import org.h2.test.store.TestMVStore;
import org.h2.test.store.TestMVStoreBenchmark;
import org.h2.test.store.TestMVTableEngine;
import org.h2.test.store.TestObjectDataType;
import org.h2.test.store.TestSpinLock;
......@@ -710,6 +711,7 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
new TestFreeSpace().runTest(this);
new TestMVRTree().runTest(this);
new TestMVStore().runTest(this);
new TestMVStoreBenchmark().runTest(this);
new TestMVTableEngine().runTest(this);
new TestObjectDataType().runTest(this);
new TestSpinLock().runTest(this);
......
......@@ -402,6 +402,15 @@ public abstract class TestBase {
* @return the used megabytes
*/
public static int getMemoryUsed() {
return (int) (getMemoryUsedBytes() / 1024 / 1024);
}
/**
* Get the number of bytes heap memory in use.
*
* @return the used bytes
*/
public static long getMemoryUsedBytes() {
Runtime rt = Runtime.getRuntime();
long memory = Long.MAX_VALUE;
for (int i = 0; i < 8; i++) {
......@@ -412,8 +421,7 @@ public abstract class TestBase {
}
memory = memNow;
}
int mb = (int) (memory / 1024 / 1024);
return mb;
return memory;
}
/**
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论