MOAB: Mesh Oriented datABase
(version 5.5.0)
|
#include "moab/MOABConfig.h"
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <csignal>
#include <csetjmp>
#include "moab/Types.hpp"
#include "Internals.hpp"
Go to the source code of this file.
Macros | |
#define | STRINGIFY_(X) #X |
#define | STRINGIFY(X) STRINGIFY_( X ) |
#define | CHECK_ERR(A) check_equal( MB_SUCCESS, ( A ), "MB_SUCCESS", #A, __LINE__, __FILE__ ) |
#define | CHECK(A) check_true( ( A ), #A, __LINE__, __FILE__ ) |
#define | CHECK_EQUAL(EXP, ACT) check_equal( ( EXP ), ( ACT ), #EXP, #ACT, __LINE__, __FILE__ ) |
#define | CHECK_REAL_EQUAL(EXP, ACT, EPS) check_equal( ( EXP ), ( ACT ), ( EPS ), #EXP, #ACT, __LINE__, __FILE__ ) |
#define | CHECK_ARRAYS_EQUAL(EXP, EXP_LEN, ACT, ACT_LEN) check_array_equal( ( EXP ), ( EXP_LEN ), ( ACT ), ( ACT_LEN ), #EXP, #ACT, __LINE__, __FILE__ ) |
#define | CHECK_VECREAL_EQUAL(EXP, ACT, EPS) check_equal_cartvect( ( EXP ), ( ACT ), ( EPS ), #EXP, #ACT, __LINE__, __FILE__ ) |
#define | RUN_TEST(FUNC) run_test( &( ( ( ( FUNC ) ) ) ), #FUNC ) |
#define | EXCEPTION_MODE 1 |
#define | FORK_MODE 2 |
#define | LONGJMP_MODE 3 |
#define | MODE LONGJMP_MODE |
#define | FLAG_ERROR siglongjmp( jmpenv, -1 ) |
#define | IS_BUILDING_MB |
#define | EQUAL_TEST_IMPL(TEST, TYPE) |
Typedefs | |
typedef void(* | sigfunc_t) (int) |
typedef void(* | test_func) (void) |
Functions | |
void | sighandler (int sig) |
int | sethandler (int sig) |
int | init_signal_handlers () |
void | flag_error () |
int | run_test (test_func test, const char *func_name) |
void | check_equal (int A, int B, const char *sA, const char *sB, int line, const char *file) |
void | check_equal (unsigned A, unsigned B, const char *sA, const char *sB, int line, const char *file) |
void | check_equal (long A, long B, const char *sA, const char *sB, int line, const char *file) |
void | check_equal (unsigned long A, unsigned long B, const char *sA, const char *sB, int line, const char *file) |
void | check_equal (unsigned long long A, unsigned long long B, const char *sA, const char *sB, int line, const char *file) |
void | check_equal (long long A, long long B, const char *sA, const char *sB, int line, const char *file) |
void | check_equal (void *A, void *B, const char *sA, const char *sB, int line, const char *file) |
void | check_equal (const char *A, const char *B, const char *sA, const char *sB, int line, const char *file) |
void | check_equal (const std::string &A, const std::string &B, const char *sA, const char *sB, int line, const char *file) |
void | check_equal (float A, float B, float eps, const char *sA, const char *sB, int line, const char *file) |
void | check_equal (double A, double B, double eps, const char *sA, const char *sB, int line, const char *file) |
const char * | mb_error_str (moab::ErrorCode err) |
void | check_equal (moab::ErrorCode A, moab::ErrorCode B, const char *sA, const char *sB, int line, const char *file) |
const char * | mb_type_str (moab::EntityType type) |
const char * | mb_type_str (moab::EntityHandle a) |
void | check_true (bool cond, const char *str, int line, const char *file) |
Variables | |
sigjmp_buf | jmpenv |
int | junk_init_var = init_signal_handlers() |
#define CHECK | ( | A | ) | check_true( ( A ), #A, __LINE__, __FILE__ ) |
Ensure that A is true
Definition at line 37 of file TestUtil.hpp.
#define CHECK_ARRAYS_EQUAL | ( | EXP, | |
EXP_LEN, | |||
ACT, | |||
ACT_LEN | |||
) | check_array_equal( ( EXP ), ( EXP_LEN ), ( ACT ), ( ACT_LEN ), #EXP, #ACT, __LINE__, __FILE__ ) |
Check that two arrays contain the same values in the same order
Definition at line 43 of file TestUtil.hpp.
#define CHECK_EQUAL | ( | EXP, | |
ACT | |||
) | check_equal( ( EXP ), ( ACT ), #EXP, #ACT, __LINE__, __FILE__ ) |
Check that two values are equal
Definition at line 39 of file TestUtil.hpp.
#define CHECK_ERR | ( | A | ) | check_equal( MB_SUCCESS, ( A ), "MB_SUCCESS", #A, __LINE__, __FILE__ ) |
Check that A is MB_SUCCESS
Definition at line 35 of file TestUtil.hpp.
#define CHECK_REAL_EQUAL | ( | EXP, | |
ACT, | |||
EPS | |||
) | check_equal( ( EXP ), ( ACT ), ( EPS ), #EXP, #ACT, __LINE__, __FILE__ ) |
Check that two real (float or double) values are equal within EPS
Definition at line 41 of file TestUtil.hpp.
#define CHECK_VECREAL_EQUAL | ( | EXP, | |
ACT, | |||
EPS | |||
) | check_equal_cartvect( ( EXP ), ( ACT ), ( EPS ), #EXP, #ACT, __LINE__, __FILE__ ) |
Check that two CartVect objects contain same values
Definition at line 46 of file TestUtil.hpp.
#define EQUAL_TEST_IMPL | ( | TEST, | |
TYPE | |||
) |
Definition at line 391 of file TestUtil.hpp.
#define EXCEPTION_MODE 1 |
Definition at line 56 of file TestUtil.hpp.
#define FLAG_ERROR siglongjmp( jmpenv, -1 ) |
Definition at line 124 of file TestUtil.hpp.
#define FORK_MODE 2 |
Definition at line 61 of file TestUtil.hpp.
#define IS_BUILDING_MB |
Definition at line 265 of file TestUtil.hpp.
#define LONGJMP_MODE 3 |
Definition at line 70 of file TestUtil.hpp.
#define MODE LONGJMP_MODE |
Definition at line 77 of file TestUtil.hpp.
#define RUN_TEST | ( | FUNC | ) | run_test( &( ( ( ( FUNC ) ) ) ), #FUNC ) |
Run a test Argument should be a function with the signature: void func(void) Evaluates to zero if test is successful, one otherwise.
Definition at line 52 of file TestUtil.hpp.
#define STRINGIFY | ( | X | ) | STRINGIFY_( X ) |
Definition at line 16 of file TestUtil.hpp.
#define STRINGIFY_ | ( | X | ) | #X |
Definition at line 15 of file TestUtil.hpp.
typedef void( * sigfunc_t) (int) |
Definition at line 149 of file TestUtil.hpp.
typedef void( * test_func) (void) |
Definition at line 273 of file TestUtil.hpp.
void check_equal | ( | const char * | A, |
const char * | B, | ||
const char * | sA, | ||
const char * | sB, | ||
int | line, | ||
const char * | file | ||
) |
Definition at line 442 of file TestUtil.hpp.
References EQUAL_TEST_IMPL.
void check_equal | ( | const std::string & | A, |
const std::string & | B, | ||
const char * | sA, | ||
const char * | sB, | ||
int | line, | ||
const char * | file | ||
) |
Definition at line 447 of file TestUtil.hpp.
References check_equal().
void check_equal | ( | double | A, |
double | B, | ||
double | eps, | ||
const char * | sA, | ||
const char * | sB, | ||
int | line, | ||
const char * | file | ||
) |
Definition at line 462 of file TestUtil.hpp.
References eps, and EQUAL_TEST_IMPL.
void check_equal | ( | float | A, |
float | B, | ||
float | eps, | ||
const char * | sA, | ||
const char * | sB, | ||
int | line, | ||
const char * | file | ||
) |
Definition at line 457 of file TestUtil.hpp.
References eps, and EQUAL_TEST_IMPL.
void check_equal | ( | int | A, |
int | B, | ||
const char * | sA, | ||
const char * | sB, | ||
int | line, | ||
const char * | file | ||
) |
Definition at line 402 of file TestUtil.hpp.
References EQUAL_TEST_IMPL.
Referenced by check_equal().
void check_equal | ( | long | A, |
long | B, | ||
const char * | sA, | ||
const char * | sB, | ||
int | line, | ||
const char * | file | ||
) |
Definition at line 412 of file TestUtil.hpp.
References EQUAL_TEST_IMPL.
void check_equal | ( | long long | A, |
long long | B, | ||
const char * | sA, | ||
const char * | sB, | ||
int | line, | ||
const char * | file | ||
) |
Definition at line 432 of file TestUtil.hpp.
References EQUAL_TEST_IMPL.
void check_equal | ( | moab::ErrorCode | A, |
moab::ErrorCode | B, | ||
const char * | sA, | ||
const char * | sB, | ||
int | line, | ||
const char * | file | ||
) |
void check_equal | ( | unsigned | A, |
unsigned | B, | ||
const char * | sA, | ||
const char * | sB, | ||
int | line, | ||
const char * | file | ||
) |
Definition at line 407 of file TestUtil.hpp.
References EQUAL_TEST_IMPL.
void check_equal | ( | unsigned long | A, |
unsigned long | B, | ||
const char * | sA, | ||
const char * | sB, | ||
int | line, | ||
const char * | file | ||
) |
Definition at line 417 of file TestUtil.hpp.
References EQUAL_TEST_IMPL.
void check_equal | ( | unsigned long long | A, |
unsigned long long | B, | ||
const char * | sA, | ||
const char * | sB, | ||
int | line, | ||
const char * | file | ||
) |
Definition at line 422 of file TestUtil.hpp.
References EQUAL_TEST_IMPL.
void check_equal | ( | void * | A, |
void * | B, | ||
const char * | sA, | ||
const char * | sB, | ||
int | line, | ||
const char * | file | ||
) |
Definition at line 437 of file TestUtil.hpp.
References EQUAL_TEST_IMPL.
void check_true | ( | bool | cond, |
const char * | str, | ||
int | line, | ||
const char * | file | ||
) |
|
inline |
Definition at line 253 of file TestUtil.hpp.
References FLAG_ERROR.
Referenced by check_equal(), check_equal_eigvect(), and check_true().
int init_signal_handlers | ( | ) |
const char* mb_error_str | ( | moab::ErrorCode | err | ) |
Definition at line 467 of file TestUtil.hpp.
References MB_ALREADY_ALLOCATED, MB_ENTITY_NOT_FOUND, MB_FILE_DOES_NOT_EXIST, MB_FILE_WRITE_ERROR, MB_INDEX_OUT_OF_RANGE, MB_INVALID_SIZE, MB_MEMORY_ALLOCATION_FAILED, MB_MULTIPLE_ENTITIES_FOUND, MB_NOT_IMPLEMENTED, MB_STRUCTURED_MESH, MB_SUCCESS, MB_TAG_NOT_FOUND, MB_TYPE_OUT_OF_RANGE, MB_UNHANDLED_OPTION, MB_UNSUPPORTED_OPERATION, and MB_VARIABLE_DATA_LENGTH.
Referenced by check_equal().
const char* mb_type_str | ( | moab::EntityHandle | a | ) |
Definition at line 559 of file TestUtil.hpp.
References mb_type_str(), and moab::TYPE_FROM_HANDLE().
const char* mb_type_str | ( | moab::EntityType | type | ) |
Definition at line 524 of file TestUtil.hpp.
References MBEDGE, MBENTITYSET, MBHEX, MBKNIFE, MBMAXTYPE, MBPOLYGON, MBPOLYHEDRON, MBPRISM, MBPYRAMID, MBQUAD, MBTET, MBTRI, and MBVERTEX.
Referenced by mb_type_str().
int run_test | ( | test_func | test, |
const char * | func_name | ||
) |
Definition at line 274 of file TestUtil.hpp.
References jmpenv, MPI_COMM_WORLD, and rank.
int sethandler | ( | int | sig | ) |
Definition at line 153 of file TestUtil.hpp.
References sighandler().
Referenced by init_signal_handlers().
void sighandler | ( | int | sig | ) |
sigjmp_buf jmpenv |
Definition at line 136 of file TestUtil.hpp.
Referenced by run_test(), and sighandler().
int junk_init_var = init_signal_handlers() |
Definition at line 243 of file TestUtil.hpp.