KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
expect.h File Reference
#include <cmath>
#include <limits>
#include <cstring>
#include "includes/exception.h"
Include dependency graph for expect.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

macros
#define KRATOS_EXPECT_TRUE(IsTrue)   if(!(IsTrue)) KRATOS_ERROR << "Check failed because " << #IsTrue << " is not true" << std::endl;
 
#define KRATOS_EXPECT_FALSE(IsFalse)   if(IsFalse) KRATOS_ERROR << "Check failed because " << #IsFalse << " is not false" << std::endl;
 
#define KRATOS_EXPECT_EQ(a, b)   if(!((a) == (b))) KRATOS_ERROR << "Check failed because " << #a << " is not equal to " << #b
 
#define KRATOS_EXPECT_NE(a, b)   if((a) == (b)) KRATOS_ERROR << "Check failed because " << #a << " is equal to " << #b
 
#define KRATOS_EXPECT_STREQ(a, b)   if((strcmp(a,b) != 0)) KRATOS_ERROR << "Check failed because \"" << a << "\" is not equal to \"" << b << "\"" << std::endl;
 
#define KRATOS_EXPECT_STRNE(a, b)   if((strcmp(a,b) == 0)) KRATOS_ERROR << "Check failed because \"" << a << "\" is equal to \"" << b << "\"" << std::endl;
 
#define KRATOS_EXPECT_LT(a, b)   if(!(a < b)) KRATOS_ERROR << "Check failed because " << #a << " is greater than or equal to " << #b << std::endl;
 
#define KRATOS_EXPECT_LE(a, b)   if(!(a <= b)) KRATOS_ERROR << "Check failed because " << #a << " is greater than " << #b << std::endl;
 
#define KRATOS_EXPECT_GT(a, b)   if(!(a > b)) KRATOS_ERROR << "Check failed because " << #a << " is less than or equal to " << #b
 
#define KRATOS_EXPECT_GE(a, b)   if(!(a >= b)) KRATOS_ERROR << "Check failed because " << #a << " is less than " << #b
 
#define KRATOS_EXPECT_HAS_SUBSTRING(TheString, SubString)
 
#define KRATOS_EXPECT_NEAR(a, b, tolerance)
 
#define KRATOS_EXPECT_RELATIVE_NEAR(a, b, tolerance)
 
#define KRATOS_EXPECT_DOUBLE_EQ(a, b)   KRATOS_EXPECT_NEAR(a,b,std::numeric_limits<double>::epsilon())
 
#define KRATOS_EXPECT_VECTOR_NEAR(a, b, tolerance)
 
#define KRATOS_EXPECT_VECTOR_RELATIVE_NEAR(a, b, tolerance)
 
#define KRATOS_EXPECT_VECTOR_EQ(a, b)   KRATOS_EXPECT_VECTOR_NEAR(a,b,std::numeric_limits<double>::epsilon())
 
#define KRATOS_EXPECT_MATRIX_NEAR(a, b, tolerance)
 
#define KRATOS_EXPECT_MATRIX_RELATIVE_NEAR(a, b, tolerance)
 
#define KRATOS_EXPECT_MATRIX_EQ(a, b)   KRATOS_EXPECT_MATRIX_NEAR(a,b,std::numeric_limits<double>::epsilon())
 
#define KRATOS_EXPECT_EXCEPTION_IS_THROWN(TheStatement, TheErrorMessage)
 
#define KRATOS_EXPECT_VARIABLE_IN_NODAL_DATA(TheVariable, TheNode)
 
#define KRATOS_EXPECT_DOF_IN_NODE(TheVariable, TheNode)
 
#define KRATOS_DEBUG_EXCEPT_EXCEPTION_IS_THROWN(TheStatement, TheErrorMessage)   if(false) KRATOS_EXPECT_EXCEPTION_IS_THROWN(TheStatement, TheErrorMessage)