MCPcopy Create free account
hub / github.com/bytedance/bolt / TEST_F

Function TEST_F

bolt/expression/tests/GenericWriterTest.cpp:51–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49class GenericWriterTest : public functions::test::FunctionBaseTest {};
50
51TEST_F(GenericWriterTest, boolean) {
52 VectorPtr result;
53 BaseVector::ensureWritable(SelectivityVector(5), BOOLEAN(), pool(), result);
54
55 VectorWriter<Any> writer;
56 writer.init(*result);
57
58 for (int i = 0; i < 5; ++i) {
59 writer.setOffset(i);
60
61 auto& current = writer.current();
62 current.castTo<bool>() = i % 2;
63
64 writer.commit(true);
65 }
66 writer.finish();
67 test::assertEqualVectors(
68 makeFlatVector<bool>({false, true, false, true, false}), result);
69
70 writer.setOffset(0);
71 auto& current = writer.current();
72
73 ASSERT_NO_THROW(current.tryCastTo<int32_t>());
74 ASSERT_TRUE(current.tryCastTo<int32_t>() == nullptr);
75}
76
77TEST_F(GenericWriterTest, integer) {
78 VectorPtr result;

Callers

nothing calls this directly

Calls 15

ensureWritableFunction · 0.85
SelectivityVectorClass · 0.85
ARRAYFunction · 0.85
evaluateFunction · 0.85
VARIANTFunction · 0.85
MAPFunction · 0.85
ROWFunction · 0.85
UNKNOWNFunction · 0.85
JSONClass · 0.85
add_itemMethod · 0.80
add_nullMethod · 0.80
childAtMethod · 0.80

Tested by

no test coverage detected