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

Function TEST_F

bolt/exec/tests/SimpleAggregateAdapterTest.cpp:55–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53};
54
55TEST_F(SimpleAverageAggregationTest, averageAggregate) {
56 auto inputVectors = makeRowVector(
57 {makeFlatVector<bool>(
58 {true,
59 false,
60 true,
61 false,
62 true,
63 false,
64 true,
65 false,
66 true,
67 false,
68 true,
69 false}),
70 makeFlatVector<bool>(
71 {true,
72 true,
73 true,
74 true,
75 true,
76 true,
77 true,
78 true,
79 true,
80 true,
81 false,
82 false}),
83 makeNullableFlatVector<int64_t>(
84 {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, std::nullopt, std::nullopt}),
85 makeNullableFlatVector<double>(
86 {1.1,
87 2.2,
88 3.3,
89 4.4,
90 5.5,
91 6.6,
92 7.7,
93 8.8,
94 9.9,
95 11,
96 std::nullopt,
97 std::nullopt})});
98
99 auto expected = makeRowVector(
100 {makeFlatVector<bool>({true, false}),
101 makeFlatVector<double>({5, 6}),
102 makeFlatVector<double>({5.5, 6.6})});
103 testAggregations(
104 {inputVectors}, {"c0"}, {"simple_avg(c2)", "simple_avg(c3)"}, {expected});
105
106 expected = makeRowVector(
107 {makeFlatVector<bool>({true, false}),
108 makeNullableFlatVector<double>({5.5, std::nullopt}),
109 makeNullableFlatVector<double>({6.05, std::nullopt})});
110 testAggregations(
111 {inputVectors}, {"c1"}, {"simple_avg(c2)", "simple_avg(c3)"}, {expected});
112

Callers

nothing calls this directly

Calls 15

isPartialOutputFunction · 0.85
ARRAYFunction · 0.85
nbytesFunction · 0.85
roundUpFunction · 0.85
isRawInputFunction · 0.85
createFunction · 0.50
poolFunction · 0.50
setAllocatorMethod · 0.45
setOffsetsMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected