Search in sources :

Example 16 with StringSink

use of io.questdb.std.str.StringSink in project questdb by bluestreak01.

the class CharFunctionTest method testGetStrZ2.

@Test
public void testGetStrZ2() {
    StringSink sink = new StringSink();
    zeroFunc.getStr(null, sink);
    TestUtils.assertEquals("", sink);
}
Also used : StringSink(io.questdb.std.str.StringSink) Test(org.junit.Test)

Example 17 with StringSink

use of io.questdb.std.str.StringSink in project questdb by bluestreak01.

the class CharFunctionTest method testGetStr2.

@Test
public void testGetStr2() {
    StringSink sink = new StringSink();
    function.getStr(null, sink);
    TestUtils.assertEquals("4", sink);
}
Also used : StringSink(io.questdb.std.str.StringSink) Test(org.junit.Test)

Example 18 with StringSink

use of io.questdb.std.str.StringSink in project questdb by bluestreak01.

the class GeoHashFunctionTest method testGetStrIntoSink1.

@Test
public void testGetStrIntoSink1() {
    Assert.assertEquals(GeoHashes.NULL, nullFunction.getGeoByte(null));
    StringSink sink = new StringSink();
    try {
        nullFunction.getStr(null, sink);
        Assert.fail();
    } catch (UnsupportedOperationException e) {
    // Good
    }
}
Also used : StringSink(io.questdb.std.str.StringSink) Test(org.junit.Test)

Example 19 with StringSink

use of io.questdb.std.str.StringSink in project questdb by bluestreak01.

the class NumbersTest method testLongToHex3.

@Test
public void testLongToHex3() {
    long value = 0xbfbca5da8f0645L;
    StringSink sink = new StringSink();
    Numbers.appendHex(sink, value, false);
    TestUtils.assertEquals(Long.toHexString(value), sink);
}
Also used : StringSink(io.questdb.std.str.StringSink) Test(org.junit.Test)

Example 20 with StringSink

use of io.questdb.std.str.StringSink in project questdb by bluestreak01.

the class NumbersTest method testLongToHex2.

@Test
public void testLongToHex2() {
    long value = 0x5374f5fbcef4819L;
    StringSink sink = new StringSink();
    Numbers.appendHex(sink, value, false);
    TestUtils.assertEquals("0" + Long.toHexString(value), sink);
}
Also used : StringSink(io.questdb.std.str.StringSink) Test(org.junit.Test)

Aggregations

StringSink (io.questdb.std.str.StringSink)284 Test (org.junit.Test)167 Function (io.questdb.cairo.sql.Function)38 BaseConnection (org.postgresql.core.BaseConnection)36 UnaryFunction (io.questdb.griffin.engine.functions.UnaryFunction)28 StrConstant (io.questdb.griffin.engine.functions.constants.StrConstant)22 StrFunction (io.questdb.griffin.engine.functions.StrFunction)20 AbstractGriffinTest (io.questdb.griffin.AbstractGriffinTest)16 Path (io.questdb.std.str.Path)16 CountDownLatch (java.util.concurrent.CountDownLatch)15 CyclicBarrier (java.util.concurrent.CyclicBarrier)15 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)13 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)11 SqlCompiler (io.questdb.griffin.SqlCompiler)10 SqlExecutionContextImpl (io.questdb.griffin.SqlExecutionContextImpl)10 SqlException (io.questdb.griffin.SqlException)9 Metrics (io.questdb.Metrics)8 io.questdb.cairo (io.questdb.cairo)8 AllowAllCairoSecurityContext (io.questdb.cairo.security.AllowAllCairoSecurityContext)8 NetUtils (io.questdb.cutlass.NetUtils)8