Skip to content
Snippets Groups Projects
Commit 7cc4262d authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Add tests for BuiltinFunctionEmbedderUtils

On the way, fixed arguments resulting from a function call of types
R^d or R^dxd
parent 50c298ca
No related branches found
No related tags found
1 merge request!104Add missing tests for ASTNodeBuiltinFunctionExpressionBuilder
...@@ -28,8 +28,9 @@ getBuiltinFunctionEmbedder(ASTNode& n) ...@@ -28,8 +28,9 @@ getBuiltinFunctionEmbedder(ASTNode& n)
FunctionDescriptor& function_descriptor = argument_node.m_symbol_table->functionTable()[function_id]; FunctionDescriptor& function_descriptor = argument_node.m_symbol_table->functionTable()[function_id];
ASTNode& function_image_domain = *function_descriptor.domainMappingNode().children[1]; ASTNode& function_image_domain = *function_descriptor.domainMappingNode().children[1];
if (not(function_image_domain.is_type<language::vector_type>() or
if (function_image_domain.children.size() > 0) { function_image_domain.is_type<language::matrix_type>()) and
function_image_domain.children.size() > 0) {
for (size_t i = 0; i < function_image_domain.children.size(); ++i) { for (size_t i = 0; i < function_image_domain.children.size(); ++i) {
arg_type_list.push_back(function_image_domain.children[i]->m_data_type); arg_type_list.push_back(function_image_domain.children[i]->m_data_type);
} }
...@@ -43,9 +44,11 @@ getBuiltinFunctionEmbedder(ASTNode& n) ...@@ -43,9 +44,11 @@ getBuiltinFunctionEmbedder(ASTNode& n)
arg_type_list.push_back(builtin_function->getReturnDataType()); arg_type_list.push_back(builtin_function->getReturnDataType());
break; break;
} }
// LCOV_EXCL_START
default: { default: {
throw UnexpectedError("unexpected function type"); throw UnexpectedError("unexpected function type");
} }
// LCOV_EXCL_STOP
} }
} else { } else {
arg_type_list.push_back(argument_node.m_data_type); arg_type_list.push_back(argument_node.m_data_type);
......
...@@ -47,6 +47,7 @@ add_executable (unit_tests ...@@ -47,6 +47,7 @@ add_executable (unit_tests
test_BiCGStab.cpp test_BiCGStab.cpp
test_BuildInfo.cpp test_BuildInfo.cpp
test_BuiltinFunctionEmbedder.cpp test_BuiltinFunctionEmbedder.cpp
test_BuiltinFunctionEmbedderUtils.cpp
test_BuiltinFunctionEmbedderTable.cpp test_BuiltinFunctionEmbedderTable.cpp
test_BuiltinFunctionProcessor.cpp test_BuiltinFunctionProcessor.cpp
test_CastArray.cpp test_CastArray.cpp
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment