Zoltan2 Version of the Day
Defines | Functions
ErrorHandlingForTests.hpp File Reference
#include <Zoltan2_config.h>
#include <iostream>
#include <string>
#include <exception>
#include <Teuchos_RCP.hpp>
#include <Teuchos_Comm.hpp>
#include <Teuchos_CommHelpers.hpp>
Include dependency graph for ErrorHandlingForTests.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#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)

Functions

int globalFail (const RCP< const Comm< int > > &comm, int fail)
void printFailureCode (const RCP< const Comm< int > > &comm, int fail)

Define Documentation

#define TEST_FAIL_AND_THROW (   comm,
  ok,
 
)
Value:
if ((!ok)){ \
  throw std::runtime_error(std::string(s)); \
}

Definition at line 110 of file ErrorHandlingForTests.hpp.

#define TEST_FAIL_AND_EXIT (   comm,
  ok,
  s,
  code 
)
Value:
if (!(ok)){ \
  std::cerr << "Error: " << s << std::endl;\
  std::cout << "FAIL" << std::endl;\
  exit(code);\
}

Definition at line 115 of file ErrorHandlingForTests.hpp.

#define TEST_FAIL_AND_RETURN (   comm,
  ok,
 
)
Value:
if (!(ok)){ \
  std::cerr << "Error: " << s << std::endl;\
  std::cout << "FAIL" << std::endl;\
  return;\
}

Definition at line 122 of file ErrorHandlingForTests.hpp.

#define TEST_FAIL_AND_RETURN_VALUE (   comm,
  ok,
  s,
  rc 
)
Value:
if (!(ok)){ \
  std::cerr << "Error: " << s << std::endl;\
  std::cout << "FAIL" << std::endl;\
  return (rc);\
}

Definition at line 129 of file ErrorHandlingForTests.hpp.


Function Documentation

int globalFail ( const RCP< const Comm< int > > &  comm,
int  fail 
)

Definition at line 137 of file ErrorHandlingForTests.hpp.

void printFailureCode ( const RCP< const Comm< int > > &  comm,
int  fail 
)

Definition at line 144 of file ErrorHandlingForTests.hpp.