#include <Zoltan2_config.h>
#include <iostream>
#include <string>
#include <exception>
#include <Teuchos_RCP.hpp>
#include <Teuchos_Comm.hpp>
#include <Teuchos_CommHelpers.hpp>
Go to the source code of this file.
|
#define | TEST_FAIL_AND_THROW(comm, ok, s) |
|
#define | TEST_FAIL_AND_EXIT(comm, ok, s, code) |
|
#define | TEST_FAIL_AND_RETURN(comm, ok, s) |
|
#define | TEST_FAIL_AND_RETURN_VALUE(comm, ok, s, rc) |
|
#define TEST_FAIL_AND_THROW |
( |
|
comm, |
|
|
|
ok, |
|
|
|
s |
|
) |
| |
Value:{ \
int gval, lval=( (ok) ? 0 : 1); \
reduceAll<int,int>(comm, Teuchos::REDUCE_SUM, 1, &lval, &gval);\
if (gval){ \
throw std::runtime_error(std::string(s)); \
} \
}
Definition at line 26 of file ErrorHandlingForTests.hpp.
#define TEST_FAIL_AND_EXIT |
( |
|
comm, |
|
|
|
ok, |
|
|
|
s, |
|
|
|
code |
|
) |
| |
Value:{ \
int gval, lval=( (ok) ? 0 : 1); \
reduceAll<int,int>(comm, Teuchos::REDUCE_SUM, 1, &lval, &gval);\
if (gval){ \
if ((comm).getRank() == 0){\
std::cerr << "Error: " << s << std::endl;\
std::cout << "Error: " << s << std::endl;\
std::cout << "FAIL" << std::endl;\
} \
exit(code);\
} \
}
Definition at line 34 of file ErrorHandlingForTests.hpp.
#define TEST_FAIL_AND_RETURN |
( |
|
comm, |
|
|
|
ok, |
|
|
|
s |
|
) |
| |
Value:{ \
int gval, lval=( (ok) ? 0 : 1); \
reduceAll<int,int>(comm, Teuchos::REDUCE_SUM, 1, &lval, &gval);\
if (gval){ \
if ((comm).getRank() == 0){\
std::cerr << "Error: " << s << std::endl;\
std::cout << "Error: " << s << std::endl;\
std::cout << "FAIL" << std::endl;\
} \
return; \
} \
}
Definition at line 47 of file ErrorHandlingForTests.hpp.
#define TEST_FAIL_AND_RETURN_VALUE |
( |
|
comm, |
|
|
|
ok, |
|
|
|
s, |
|
|
|
rc |
|
) |
| |
Value:{ \
int gval, lval=( (ok) ? 0 : 1); \
reduceAll<int,int>(comm, Teuchos::REDUCE_SUM, 1, &lval, &gval);\
if (gval){ \
if ((comm).getRank() == 0){\
std::cerr << "Error: " << s << std::endl;\
std::cout << "Error: " << s << std::endl;\
std::cout << "FAIL" << std::endl;\
} \
return (rc); \
} \
}
Definition at line 60 of file ErrorHandlingForTests.hpp.
int globalFail |
( |
const Comm< int > & |
comm, |
|
|
int |
fail |
|
) |
| |
void printFailureCode |
( |
const Comm< int > & |
comm, |
|
|
int |
fail |
|
) |
| |