use of com.questdb.std.IntHashSet in project questdb by bluestreak01.
the class DateFormatCompilerTest method testOperationUniqueness.
@Test
public void testOperationUniqueness() {
Assert.assertTrue(DateFormatCompiler.opList.size() > 0);
IntHashSet codeSet = new IntHashSet();
CharSequenceHashSet nameSet = new CharSequenceHashSet();
for (int i = 0, n = DateFormatCompiler.opList.size(); i < n; i++) {
String name = DateFormatCompiler.opList.getQuick(i);
int code = DateFormatCompiler.opMap.get(name);
Assert.assertTrue(codeSet.add(code));
Assert.assertTrue(nameSet.add(name));
}
}
use of com.questdb.std.IntHashSet in project questdb by bluestreak01.
the class DateFormatCompilerTest method testOperationUniqueness.
@Test
public void testOperationUniqueness() {
Assert.assertTrue(DateFormatCompiler.opList.size() > 0);
IntHashSet codeSet = new IntHashSet();
CharSequenceHashSet nameSet = new CharSequenceHashSet();
for (int i = 0, n = DateFormatCompiler.opList.size(); i < n; i++) {
String name = DateFormatCompiler.opList.getQuick(i);
int code = DateFormatCompiler.opMap.get(name);
Assert.assertTrue(codeSet.add(code));
Assert.assertTrue(nameSet.add(name));
}
}
use of com.questdb.std.IntHashSet in project questdb by bluestreak01.
the class HashTest method testStringHash.
@Test
public void testStringHash() {
Rnd rnd = new Rnd();
IntHashSet hashes = new IntHashSet(100000);
final int LEN = 64;
long address = Unsafe.malloc(LEN);
for (int i = 0; i < 100000; i++) {
rnd.nextChars(address, LEN / 2);
hashes.add(Hash.hashMem(address, LEN));
}
Assert.assertTrue("Hash function distribution dropped", hashes.size() > 99990);
}
Aggregations