Skip to content

Commit

Permalink
test: 修复本地单元测试
Browse files Browse the repository at this point in the history
  • Loading branch information
Kosthi committed Oct 19, 2024
1 parent b375cfe commit e34e603
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions unittest/observer/aggregate_hash_table_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ TEST(AggregateHashTableTest, DISABLED_standard_hash_table)
group_chunk.add_column(std::move(column1), 0);
aggr_chunk.add_column(std::move(column2), 1);

AggregateFunctionExpr aggregate_expr(AggregateFunctionExpr::Type::SUM, nullptr);
AggregateFunctionExpr aggregate_expr(AggregateFunctionType::SUM, nullptr);
std::vector<Expression *> aggregate_exprs;
aggregate_exprs.push_back(&aggregate_expr);
auto standard_hash_table = std::make_unique<StandardAggregateHashTable>(aggregate_exprs);
Expand Down Expand Up @@ -75,7 +75,7 @@ TEST(AggregateHashTableTest, DISABLED_standard_hash_table)
aggr_chunk.add_column(std::move(aggr1), 0);
aggr_chunk.add_column(std::move(aggr2), 1);

AggregateFunctionExpr aggregate_expr(AggregateFunctionExpr::Type::SUM, nullptr);
AggregateFunctionExpr aggregate_expr(AggregateFunctionType::SUM, nullptr);
std::vector<Expression *> aggregate_exprs;
aggregate_exprs.push_back(&aggregate_expr);
aggregate_exprs.push_back(&aggregate_expr);
Expand Down
14 changes: 7 additions & 7 deletions unittest/observer/expression_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ TEST(AggregateFunctionExpr, aggregate_expr_test)
{
Value int_value(1);
unique_ptr<Expression> value_expr(new ValueExpr(int_value));
AggregateFunctionExpr aggregate_expr(AggregateFunctionExpr::Type::SUM, std::move(value_expr));
AggregateFunctionExpr aggregate_expr(AggregateFunctionType::SUM, std::move(value_expr));
aggregate_expr.equal(aggregate_expr);
auto aggregator = aggregate_expr.create_aggregator();
for (int i = 0; i < 100; i++) {
Expand All @@ -320,17 +320,17 @@ TEST(AggregateFunctionExpr, aggregate_expr_test)
Value result;
aggregator->evaluate(result);
ASSERT_EQ(result.get_int(), 4950);
AggregateFunctionExpr::Type aggr_type;
AggregateFunctionType aggr_type;
ASSERT_EQ(RC::SUCCESS, AggregateFunctionExpr::type_from_string("sum", aggr_type));
ASSERT_EQ(aggr_type, AggregateFunctionExpr::Type::SUM);
ASSERT_EQ(aggr_type, AggregateFunctionType::SUM);
ASSERT_EQ(RC::SUCCESS, AggregateFunctionExpr::type_from_string("count", aggr_type));
ASSERT_EQ(aggr_type, AggregateFunctionExpr::Type::COUNT);
ASSERT_EQ(aggr_type, AggregateFunctionType::COUNT);
ASSERT_EQ(RC::SUCCESS, AggregateFunctionExpr::type_from_string("avg", aggr_type));
ASSERT_EQ(aggr_type, AggregateFunctionExpr::Type::AVG);
ASSERT_EQ(aggr_type, AggregateFunctionType::AVG);
ASSERT_EQ(RC::SUCCESS, AggregateFunctionExpr::type_from_string("max", aggr_type));
ASSERT_EQ(aggr_type, AggregateFunctionExpr::Type::MAX);
ASSERT_EQ(aggr_type, AggregateFunctionType::MAX);
ASSERT_EQ(RC::SUCCESS, AggregateFunctionExpr::type_from_string("min", aggr_type));
ASSERT_EQ(aggr_type, AggregateFunctionExpr::Type::MIN);
ASSERT_EQ(aggr_type, AggregateFunctionType::MIN);
ASSERT_EQ(RC::INVALID_ARGUMENT, AggregateFunctionExpr::type_from_string("invalid type", aggr_type));
}

Expand Down

0 comments on commit e34e603

Please sign in to comment.