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

Fix debug tests

Compilation: function descriptor name was not named
Test failure: remove useless assertion which broke exception catching tests
parent 34d37b49
No related branches found
No related tags found
1 merge request!37Feature/language
......@@ -91,7 +91,6 @@ dataTypePromotion(const ASTNodeDataType& data_type_1, const ASTNodeDataType& dat
bool
isNaturalConversion(const ASTNodeDataType& data_type, const ASTNodeDataType& target_data_type)
{
Assert((data_type != ASTNodeDataType::undefined_t) and (target_data_type != ASTNodeDataType::undefined_t));
if (target_data_type == data_type) {
if (data_type == ASTNodeDataType::type_id_t) {
return (data_type.typeName() == target_data_type.typeName());
......
......@@ -35,14 +35,14 @@ TEST_CASE("FunctionTable", "[language]")
SECTION("nothing initialized")
{
FunctionDescriptor f{nullptr, nullptr};
FunctionDescriptor f{"function", nullptr, nullptr};
REQUIRE_THROWS_AS(f.domainMappingNode(), AssertError);
REQUIRE_THROWS_AS(f.definitionNode(), AssertError);
}
SECTION("domain mapping uninitialized")
{
FunctionDescriptor f{nullptr, std::move(definition_node)};
FunctionDescriptor f{"function", nullptr, std::move(definition_node)};
REQUIRE_THROWS_AS(f.domainMappingNode(), AssertError);
REQUIRE(f.definitionNode().m_data_type == ASTNodeDataType::double_t);
REQUIRE(definition_node == nullptr);
......@@ -50,7 +50,7 @@ TEST_CASE("FunctionTable", "[language]")
SECTION("definition node uninitialized")
{
FunctionDescriptor f{std::move(domain_mapping_node), nullptr};
FunctionDescriptor f{"function", std::move(domain_mapping_node), nullptr};
REQUIRE_THROWS_AS(f.definitionNode(), AssertError);
REQUIRE(f.domainMappingNode().m_data_type == ASTNodeDataType::unsigned_int_t);
REQUIRE(domain_mapping_node == nullptr);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment