Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.

Commit 791c495

Browse files
committed
Add smoke tests and enable the last smem test case
1 parent 3a09f26 commit 791c495

File tree

1 file changed

+94
-15
lines changed

1 file changed

+94
-15
lines changed

omniscidb/Tests/L0SharedMemoryTest.cpp

Lines changed: 94 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -266,19 +266,99 @@ void perform_test_and_verify_results(TestInputData input) {
266266
ASSERT_EQ(cmp_result, 0);
267267
}
268268

269-
TEST(Smoke, Simple) {
270-
TestInputData input;
271-
input.setDeviceId(0)
272-
.setNumInputBuffers(1)
273-
.setTargetInfos(generate_custom_agg_target_infos(
274-
{1}, {hdk::ir::AggType::kCount}, {int32_type}, {int32_type}))
275-
.setAggWidth(4)
276-
.setMinEntry(0)
277-
.setMaxEntry(10)
278-
.setStepSize(2)
279-
.setKeylessHash(true)
280-
.setTargetIndexForKey(0);
281-
perform_test_and_verify_results(input);
269+
TEST(Smoke, Count) {
270+
std::vector<const hdk::ir::Type*> variants = {
271+
int32_type, int64_type, float_type, double_type};
272+
for (auto* type : variants) {
273+
TestInputData input;
274+
input.setDeviceId(0)
275+
.setNumInputBuffers(1)
276+
.setTargetInfos(generate_custom_agg_target_infos(
277+
{1}, {hdk::ir::AggType::kCount}, {type}, {type}))
278+
.setAggWidth(type->size())
279+
.setMinEntry(0)
280+
.setMaxEntry(10)
281+
.setStepSize(2)
282+
.setKeylessHash(true)
283+
.setTargetIndexForKey(0);
284+
perform_test_and_verify_results(input);
285+
}
286+
}
287+
288+
TEST(Smoke, Min) {
289+
std::vector<const hdk::ir::Type*> variants = {
290+
int32_type, int64_type, float_type, double_type};
291+
for (auto* type : variants) {
292+
TestInputData input;
293+
input.setDeviceId(0)
294+
.setNumInputBuffers(4)
295+
.setTargetInfos(generate_custom_agg_target_infos(
296+
{1}, {hdk::ir::AggType::kMin}, {type}, {type}))
297+
.setAggWidth(type->size())
298+
.setMinEntry(0)
299+
.setMaxEntry(10)
300+
.setStepSize(2)
301+
.setKeylessHash(true)
302+
.setTargetIndexForKey(0);
303+
perform_test_and_verify_results(input);
304+
}
305+
}
306+
307+
TEST(Smoke, Max) {
308+
std::vector<const hdk::ir::Type*> variants = {
309+
int32_type, int64_type, float_type, double_type};
310+
for (auto* type : variants) {
311+
TestInputData input;
312+
input.setDeviceId(0)
313+
.setNumInputBuffers(4)
314+
.setTargetInfos(generate_custom_agg_target_infos(
315+
{1}, {hdk::ir::AggType::kMax}, {type}, {type}))
316+
.setAggWidth(type->size())
317+
.setMinEntry(0)
318+
.setMaxEntry(10)
319+
.setStepSize(2)
320+
.setKeylessHash(true)
321+
.setTargetIndexForKey(0);
322+
perform_test_and_verify_results(input);
323+
}
324+
}
325+
326+
TEST(Smoke, Sum) {
327+
std::vector<const hdk::ir::Type*> variants = {
328+
int32_type, int64_type, float_type, double_type};
329+
for (auto* type : variants) {
330+
TestInputData input;
331+
input.setDeviceId(0)
332+
.setNumInputBuffers(4)
333+
.setTargetInfos(generate_custom_agg_target_infos(
334+
{1}, {hdk::ir::AggType::kSum}, {type}, {type}))
335+
.setAggWidth(type->size())
336+
.setMinEntry(0)
337+
.setMaxEntry(10)
338+
.setStepSize(2)
339+
.setKeylessHash(true)
340+
.setTargetIndexForKey(0);
341+
perform_test_and_verify_results(input);
342+
}
343+
}
344+
345+
TEST(Smoke, Avg) {
346+
std::vector<const hdk::ir::Type*> variants = {
347+
int32_type, int64_type, float_type, double_type};
348+
for (auto* type : variants) {
349+
TestInputData input;
350+
input.setDeviceId(0)
351+
.setNumInputBuffers(4)
352+
.setTargetInfos(generate_custom_agg_target_infos(
353+
{1}, {hdk::ir::AggType::kAvg}, {type}, {type}))
354+
.setAggWidth(8) // type->size()?
355+
.setMinEntry(0)
356+
.setMaxEntry(10)
357+
.setStepSize(2)
358+
.setKeylessHash(true)
359+
.setTargetIndexForKey(0);
360+
perform_test_and_verify_results(input);
361+
}
282362
}
283363

284364
TEST(SingleColumn, VariableEntries_CountQuery_4B_Group) {
@@ -418,12 +498,11 @@ TEST(SingleColumn, VariableSteps_FixedEntries_4) {
418498
}
419499

420500
TEST(SingleColumn, VariableNumBuffers) {
421-
GTEST_SKIP();
422501
TestInputData input;
423502
input.setDeviceId(0)
424503
.setAggWidth(8)
425504
.setMinEntry(0)
426-
.setMaxEntry(266)
505+
.setMaxEntry(255)
427506
.setKeylessHash(true)
428507
.setTargetIndexForKey(0)
429508
.setTargetInfos(generate_custom_agg_target_infos(

0 commit comments

Comments
 (0)