From 85d85f955c9eab1cea57f19377a50b8d56d15074 Mon Sep 17 00:00:00 2001
From: Stephane Del Pino <stephane.delpino44@gmail.com>
Date: Wed, 13 May 2020 20:15:37 +0200
Subject: [PATCH] Fix debug tests

Compilation: function descriptor name was not named
Test failure: remove useless assertion which broke exception catching tests
---
 src/language/ASTNodeDataType.cpp | 1 -
 tests/test_FunctionTable.cpp     | 6 +++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/language/ASTNodeDataType.cpp b/src/language/ASTNodeDataType.cpp
index 0c5bdb27a..475971e8b 100644
--- a/src/language/ASTNodeDataType.cpp
+++ b/src/language/ASTNodeDataType.cpp
@@ -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());
diff --git a/tests/test_FunctionTable.cpp b/tests/test_FunctionTable.cpp
index 5c9d26f39..d1734d9dc 100644
--- a/tests/test_FunctionTable.cpp
+++ b/tests/test_FunctionTable.cpp
@@ -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);
-- 
GitLab