Classes | Namespaces | Macros | Functions
TestUtil.hpp File Reference
#include <typeinfo>
#include <iostream>
#include <fstream>
#include <string>
#include <iomanip>
#include <sstream>
#include <cmath>
#include <vector>
#include <float.h>
#include "build_config.h"
#include "StringUtils.hpp"
#include "Matrix.hpp"
Include dependency graph for TestUtil.hpp:

Go to the source code of this file.

Classes

class  gnsstk::TestUtil
 

Namespaces

 gnsstk
 For Sinex::InputHistory.
 

Macros

#define TUASSERT(EXPR)
 
#define TUASSERTE(TYPE, EXP, GOT)
 
#define TUASSERTFE(EXP, GOT)
 
#define TUASSERTFEPS(EXP, GOT, EPS)
 
#define TUASSERTFESMRT(EXP, GOT)
 
#define TUCATCH(STATEMENT)
 
#define TUCMPFILE(F1, F2, SKIP)
 
#define TUCSM(METHOD)   testFramework.changeSourceMethod(METHOD)
 
#define TUDEF(CLASS, METHOD)   gnsstk::TestUtil testFramework(CLASS, METHOD, __FILE__, __LINE__)
 
#define TUFAIL(MSG)   testFramework.assert(false, MSG, __LINE__)
 
#define TUPASS(MSG)   testFramework.assert(true, MSG, __LINE__)
 
#define TURETURN()   return testFramework.countFails()
 
#define TUTHROW(STATEMENT)
 

Functions

template<typename T >
std::string gnsstk::typeString ()
 

Macro Definition Documentation

◆ TUASSERT

#define TUASSERT (   EXPR)
Value:
try \
{ \
testFramework.assert(EXPR, "Assertion failure: "#EXPR, __LINE__); \
} \
catch (gnsstk::Exception &exc) \
{ \
std::cerr << exc << std::endl; \
testFramework.assert(false, "Exception during "#EXPR, __LINE__); \
} \
catch (...) \
{ \
testFramework.assert(false, "Exception during "#EXPR, __LINE__); \
}

Definition at line 63 of file TestUtil.hpp.

◆ TUASSERTE

#define TUASSERTE (   TYPE,
  EXP,
  GOT 
)
Value:
try \
{ \
testFramework.assert_equals<TYPE>(EXP, GOT, __LINE__); \
} \
catch (gnsstk::Exception &exc) \
{ \
std::cerr << exc << std::endl; \
testFramework.assert(false, \
"Exception evaluating " #EXP " or " #GOT, \
__LINE__); \
} \
catch (...) \
{ \
testFramework.assert(false, \
"Exception evaluating " #EXP " or " #GOT, \
__LINE__); \
}

Definition at line 81 of file TestUtil.hpp.

◆ TUASSERTFE

#define TUASSERTFE (   EXP,
  GOT 
)
Value:
try \
{ \
testFramework.assert_equals(EXP, GOT, __LINE__); \
} \
catch (gnsstk::Exception &exc) \
{ \
std::cerr << exc << std::endl; \
testFramework.assert(false, \
"Exception evaluating " #EXP " or " #GOT, \
__LINE__); \
} \
catch (...) \
{ \
testFramework.assert(false, \
"Exception evaluating " #EXP " or " #GOT, \
__LINE__); \
}

Definition at line 103 of file TestUtil.hpp.

◆ TUASSERTFEPS

#define TUASSERTFEPS (   EXP,
  GOT,
  EPS 
)
Value:
try \
{ \
testFramework.assert_equals(EXP, GOT, __LINE__, "", EPS); \
} \
catch (gnsstk::Exception &exc) \
{ \
std::cerr << exc << std::endl; \
testFramework.assert(false, \
"Exception evaluating " #EXP " or " #GOT, \
__LINE__); \
} \
catch (...) \
{ \
testFramework.assert(false, \
"Exception evaluating " #EXP " or " #GOT, \
__LINE__); \
}

Definition at line 126 of file TestUtil.hpp.

◆ TUASSERTFESMRT

#define TUASSERTFESMRT (   EXP,
  GOT 
)
Value:
try \
{ \
testFramework.assert_equals_fps(EXP, GOT, __LINE__, ""); \
} \
catch (gnsstk::Exception &exc) \
{ \
std::cerr << exc << std::endl; \
testFramework.assert(false, \
"Exception evaluating " #EXP " or " #GOT, \
__LINE__); \
} \
catch (...) \
{ \
testFramework.assert(false, \
"Exception evaluating " #EXP " or " #GOT, \
__LINE__); \
}

Definition at line 150 of file TestUtil.hpp.

◆ TUCATCH

#define TUCATCH (   STATEMENT)
Value:
try \
{ \
STATEMENT; \
TUPASS(#STATEMENT); \
} \
catch (gnsstk::Exception &exc) \
{ \
std::cerr << exc << std::endl; \
TUFAIL("Exception"); \
} \
catch (...) \
{ \
TUFAIL("Exception"); \
}

Definition at line 193 of file TestUtil.hpp.

◆ TUCMPFILE

#define TUCMPFILE (   F1,
  F2,
  SKIP 
)
Value:
try \
{ \
testFramework.assert_files_equal(__LINE__, F1, F2, \
"File mismatch: "+F1+" "+F2, \
SKIP); \
} \
catch (gnsstk::Exception &exc) \
{ \
std::cerr << exc << std::endl; \
testFramework.assert(false, \
"Exception comparing " #F1 " and " #F2, \
__LINE__); \
} \
catch (...) \
{ \
testFramework.assert(false, \
"Exception comparing " #F1 " and " #F2, \
__LINE__); \
}

Definition at line 170 of file TestUtil.hpp.

◆ TUCSM

#define TUCSM (   METHOD)    testFramework.changeSourceMethod(METHOD)

Definition at line 59 of file TestUtil.hpp.

◆ TUDEF

#define TUDEF (   CLASS,
  METHOD 
)    gnsstk::TestUtil testFramework(CLASS, METHOD, __FILE__, __LINE__)

Definition at line 56 of file TestUtil.hpp.

◆ TUFAIL

#define TUFAIL (   MSG)    testFramework.assert(false, MSG, __LINE__)

Definition at line 228 of file TestUtil.hpp.

◆ TUPASS

#define TUPASS (   MSG)    testFramework.assert(true, MSG, __LINE__)

Definition at line 230 of file TestUtil.hpp.

◆ TURETURN

#define TURETURN ( )    return testFramework.countFails()

Definition at line 232 of file TestUtil.hpp.

◆ TUTHROW

#define TUTHROW (   STATEMENT)
Value:
try \
{ \
STATEMENT; \
TUFAIL("Did not throw Exception"); \
} \
catch (gnsstk::Exception &exc) \
{ \
TUPASS(#STATEMENT); \
} \
catch (...) \
{ \
TUPASS(#STATEMENT); \
}

Definition at line 211 of file TestUtil.hpp.

gnsstk::Exception
Definition: Exception.hpp:151


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:43