Flow123d
3.9.0-c13e246a6
|
Definitions of ASSERTS. More...
#include <iostream>
#include <string>
#include <vector>
#include "system/global_defs.h"
#include "system/exceptions.hh"
#include "system/fmt/posix.h"
Go to the source code of this file.
Classes | |
class | feal::Exc_assert |
Helper class. More... | |
class | feal::Assert |
Class defining debugging messages. More... | |
class | feal::AssertNull |
Namespaces | |
feal | |
Macros | |
#define | _FEAL_ASSERT_A(x) _FEAL_ASSERT_OP(x, B) |
Internal clever macro A. More... | |
#define | _FEAL_ASSERT_B(x) _FEAL_ASSERT_OP(x, A) |
Internal clever macro B. More... | |
#define | _FEAL_ASSERT_OP(x, next) _FEAL_ASSERT_A.add_value((x), #x)._FEAL_ASSERT_ ## next |
Internal clever macro recursion. More... | |
#define | FEAL_ASSERT_PERMANENT(expr) |
Definition of assert for debug and release mode. More... | |
#define | FEAL_ASSERT(expr) |
Definition of assert for debug mode only. More... | |
#define | ASSERT_PERMANENT_LT(a, b) FEAL_ASSERT_PERMANENT(a < b)(a)(b) |
Definition of comparative assert macro (Less Than) More... | |
#define | ASSERT_LT(a, b) FEAL_ASSERT(a < b)(a)(b) |
Definition of comparative assert macro (Less Than) only for debug mode. More... | |
#define | ASSERT_PERMANENT_LE(a, b) FEAL_ASSERT_PERMANENT(a <= b)(a)(b) |
Definition of comparative assert macro (Less or Equal) More... | |
#define | ASSERT_LE(a, b) FEAL_ASSERT(a <= b)(a)(b) |
Definition of comparative assert macro (Less or Equal) only for debug mode. More... | |
#define | ASSERT_PERMANENT_GT(a, b) FEAL_ASSERT_PERMANENT(a > b)(a)(b) |
Definition of comparative assert macro (Greater Than) More... | |
#define | ASSERT_GT(a, b) FEAL_ASSERT(a > b)(a)(b) |
Definition of comparative assert macro (Greater Than) only for debug mode. More... | |
#define | ASSERT_PERMANENT_GE(a, b) FEAL_ASSERT_PERMANENT(a >= b)(a)(b) |
Definition of comparative assert macro (Greater or Equal) More... | |
#define | ASSERT_GE(a, b) FEAL_ASSERT(a >= b)(a)(b) |
Definition of comparative assert macro (Greater or Equal) only for debug mode. More... | |
#define | ASSERT_PERMANENT_EQ(a, b) FEAL_ASSERT_PERMANENT(a == b)(a)(b) |
Definition of comparative assert macro (EQual) More... | |
#define | ASSERT_EQ(a, b) FEAL_ASSERT(a == b)(a)(b) |
Definition of comparative assert macro (EQual) only for debug mode. More... | |
#define | ASSERT_PERMANENT_PTR(ptr) FEAL_ASSERT_PERMANENT( (ptr) != nullptr ) |
Definition of assert macro checking non-null pointer (PTR) More... | |
#define | ASSERT_PTR(ptr) FEAL_ASSERT( (ptr) != nullptr ) |
Definition of assert macro checking non-null pointer (PTR) only for debug mode. More... | |
#define | ASSERT_PERMANENT(expr) FEAL_ASSERT_PERMANENT( expr) |
Allow use shorter versions of macro names if these names is not used with external library. More... | |
#define | ASSERT(expr) FEAL_ASSERT( expr) |
Definitions of ASSERTS.
* Copyright (C) 2015 Technical University of Liberec. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation. (http://www.gnu.org/licenses/gpl-3.0.en.html)
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Definition in file asserts.hh.
#define _FEAL_ASSERT_A | ( | x | ) | _FEAL_ASSERT_OP(x, B) |
#define _FEAL_ASSERT_B | ( | x | ) | _FEAL_ASSERT_OP(x, A) |
Internal clever macro B.
Definition at line 225 of file asserts.hh.
#define _FEAL_ASSERT_OP | ( | x, | |
next | |||
) | _FEAL_ASSERT_A.add_value((x), #x)._FEAL_ASSERT_ ## next |
Internal clever macro recursion.
Definition at line 227 of file asserts.hh.
#define ASSERT | ( | expr | ) | FEAL_ASSERT( expr) |
Definition at line 351 of file asserts.hh.
#define ASSERT_EQ | ( | a, | |
b | |||
) | FEAL_ASSERT(a == b)(a)(b) |
Definition of comparative assert macro (EQual) only for debug mode.
Definition at line 333 of file asserts.hh.
#define ASSERT_GE | ( | a, | |
b | |||
) | FEAL_ASSERT(a >= b)(a)(b) |
Definition of comparative assert macro (Greater or Equal) only for debug mode.
Definition at line 325 of file asserts.hh.
#define ASSERT_GT | ( | a, | |
b | |||
) | FEAL_ASSERT(a > b)(a)(b) |
Definition of comparative assert macro (Greater Than) only for debug mode.
Definition at line 317 of file asserts.hh.
#define ASSERT_LE | ( | a, | |
b | |||
) | FEAL_ASSERT(a <= b)(a)(b) |
Definition of comparative assert macro (Less or Equal) only for debug mode.
Definition at line 309 of file asserts.hh.
#define ASSERT_LT | ( | a, | |
b | |||
) | FEAL_ASSERT(a < b)(a)(b) |
Definition of comparative assert macro (Less Than) only for debug mode.
Definition at line 301 of file asserts.hh.
#define ASSERT_PERMANENT | ( | expr | ) | FEAL_ASSERT_PERMANENT( expr) |
Allow use shorter versions of macro names if these names is not used with external library.
Definition at line 348 of file asserts.hh.
#define ASSERT_PERMANENT_EQ | ( | a, | |
b | |||
) | FEAL_ASSERT_PERMANENT(a == b)(a)(b) |
Definition of comparative assert macro (EQual)
Definition at line 329 of file asserts.hh.
#define ASSERT_PERMANENT_GE | ( | a, | |
b | |||
) | FEAL_ASSERT_PERMANENT(a >= b)(a)(b) |
Definition of comparative assert macro (Greater or Equal)
Definition at line 321 of file asserts.hh.
#define ASSERT_PERMANENT_GT | ( | a, | |
b | |||
) | FEAL_ASSERT_PERMANENT(a > b)(a)(b) |
Definition of comparative assert macro (Greater Than)
Definition at line 313 of file asserts.hh.
#define ASSERT_PERMANENT_LE | ( | a, | |
b | |||
) | FEAL_ASSERT_PERMANENT(a <= b)(a)(b) |
Definition of comparative assert macro (Less or Equal)
Definition at line 305 of file asserts.hh.
#define ASSERT_PERMANENT_LT | ( | a, | |
b | |||
) | FEAL_ASSERT_PERMANENT(a < b)(a)(b) |
Definition of comparative assert macro (Less Than)
Definition at line 297 of file asserts.hh.
#define ASSERT_PERMANENT_PTR | ( | ptr | ) | FEAL_ASSERT_PERMANENT( (ptr) != nullptr ) |
Definition of assert macro checking non-null pointer (PTR)
Definition at line 337 of file asserts.hh.
#define ASSERT_PTR | ( | ptr | ) | FEAL_ASSERT( (ptr) != nullptr ) |
Definition of assert macro checking non-null pointer (PTR) only for debug mode.
Definition at line 341 of file asserts.hh.
#define FEAL_ASSERT | ( | expr | ) |
Definition of assert for debug mode only.
Definition at line 291 of file asserts.hh.
#define FEAL_ASSERT_PERMANENT | ( | expr | ) |
Definition of assert for debug and release mode.
Undefining redefinitions of comparsion macros.
You can define FEAL_OVERRIDE_ASSERTS (e.g. in unit tests) and undefine macros with same name in external libraries. Definitions of assert macros
Definition at line 281 of file asserts.hh.