xmscore  1.0
TestTools.h File Reference
#include <sstream>
#include <vector>
#include <cxxtest/TestSuite.h>
#include <xmscore/points/ptsfwd.h>
#include <xmscore/stl/utility.h>

Go to the source code of this file.

Classes

class  xms::ETestMessagingState
 Class to allow running in batch mode without ui elements. Currently only used for testing but it can be used for anything. More...
 

Macros

#define _TS_ASSERT_EQUALS_AVEC(f, l, expected, length, actual)   xms::ttAssertEqualsAVec(f, l, expected, length, actual)
 Tests if array and vector are equal and gives useful output.
 
#define TS_ASSERT_EQUALS_AVEC(expected, length, actual)   _TS_ASSERT_EQUALS_AVEC(__FILE__, __LINE__, expected, length, actual)
 Tests if array and vector are equal and gives useful output.
 
#define _TS_ASSERT_DELTA_VEC(f, l, a, b, delta)   xms::ttAssertDeltaVec((f), (l), (a), (b), (delta))
 Tests if two vectors are equal and gives useful output.
 
#define TS_ASSERT_DELTA_VEC(a, b, delta)   _TS_ASSERT_DELTA_VEC(__FILE__, __LINE__, a, b, delta)
 Tests if two vectors are equal and gives useful output.
 
#define _TS_ASSERT_DELTA_VEC2D(f, l, a, b, delta)   xms::ttAssertDeltaVec2D((f), (l), (a), (b), (delta))
 Tests if two 2D vectors are equal within delta and gives useful output.
 
#define TS_ASSERT_DELTA_VEC2D(a, b, delta)   _TS_ASSERT_DELTA_VEC2D(__FILE__, __LINE__, a, b, delta)
 Tests if two 2D vectors are equal within delta and gives useful output.
 
#define _TS_ASSERT_EQUALS_VEC2D(f, l, expected, actual)   xms::ttAssertEqualsVec2D((f), (l), (expected), (actual))
 Tests if two 2D vectors are equal and gives useful output.
 
#define TS_ASSERT_EQUALS_VEC2D(expected, actual)   _TS_ASSERT_EQUALS_VEC2D(__FILE__, __LINE__, expected, actual)
 Tests if two 2D vectors are equal and gives useful output.
 
#define _TS_ASSERT_DELTA_VECPT3D(f, l, a, b, delta)   ttAssertDeltaVecPt3d(f, l, a, b, delta)
 Tests if two point vectors are equal within delta and gives useful output.
 
#define TS_ASSERT_DELTA_VECPT3D(a, b, delta)   _TS_ASSERT_DELTA_VECPT3D(__FILE__, __LINE__, a, b, delta)
 Tests if two point vectors are equal within delta and gives useful output.
 
#define TS_ASSERT_DELTA_VEC_MP3(a, b, delta)   _TS_ASSERT_DELTA_VECPT3D(__FILE__, __LINE__, a, b, delta)
 Tests if two point vectors are equal within delta and gives useful output. More...
 
#define _TS_ASSERT_DELTA_VECPT2D(f, l, a, b, delta)   ttAssertDeltaVecPt2d(f, l, a, b, delta)
 Tests if two point vectors are equal within delta and gives useful output.
 
#define TS_ASSERT_DELTA_VECPT2D(a, b, delta)   _TS_ASSERT_DELTA_VECPT2D(__FILE__, __LINE__, a, b, delta)
 Tests if two point vectors are equal within delta and gives useful output.
 
#define TS_ASSERT_DELTA_VEC_MP2(a, b, delta)   _TS_ASSERT_DELTA_VECPT2D(__FILE__, __LINE__, a, b, delta)
 Tests if two point vectors are equal within delta and gives useful output. More...
 
#define _TS_ASSERT_DELTA_PT3D(f, l, a, b, delta)   ttAssertDeltaPt3d(f, l, a, b, delta)
 Used to compare two Pt3ds and give useful output information.
 
#define _TS_ASSERT_DELTA_PT2D(f, l, a, b, delta)   ttAssertDeltaPt2d(f, l, a, b, delta);
 Tests if two points are equal within delta and gives useful output.
 
#define TS_ASSERT_DELTA_PT3D(a, b, delta)   _TS_ASSERT_DELTA_PT3D(__FILE__, __LINE__, a, b, delta)
 Tests if two points are equal within delta and gives useful output.
 
#define TS_ASSERT_DELTA_PT2D(a, b, delta)   _TS_ASSERT_DELTA_PT2D(__FILE__, __LINE__, a, b, delta)
 Tests if two points are equal within delta and gives useful output.
 
#define _TS_ASSERT_TXT_FILES_EQUAL(f, l, a, b)   xms::ttTextFilesEqual((f), (l), a, b)
 Tests if two files are equal and gives useful output.
 
#define TS_ASSERT_TXT_FILES_EQUAL(a, b)   _TS_ASSERT_TXT_FILES_EQUAL(__FILE__, __LINE__, a, b)
 Tests if two files are equal and gives useful output.
 
#define _TS_ASSERT_STREAMS_EQUAL(f, l, a, b)   xms::ttStreamsEqual((f), (l), a, b)
 Tests if two streams are equal and gives useful output.
 
#define TS_ASSERT_STREAMS_EQUAL(a, b)   _TS_ASSERT_STREAMS_EQUAL(__FILE__, __LINE__, a, b)
 Tests if two streams are equal and gives useful output.
 
#define _TS_ASSERT_EQUALS_VEC(f, l, a, b)
 Used to compare to vectors and give useful output information. More...
 
#define TS_ASSERT_EQUALS_VEC(a, b)   _TS_ASSERT_EQUALS_VEC(__FILE__, __LINE__, a, b)
 Used to compare to vectors and give useful output information.
 
#define _TS_REQUIRE_NOT_NULL(f, l, pointer)
 Fails if pointer is null. More...
 
#define TS_REQUIRE_NOT_NULL(pointer)   _TS_REQUIRE_NOT_NULL(__FILE__, __LINE__, pointer)
 Fails if pointer is null.
 
#define _TS_ASSERT_STACKED_ERRORS(f, l, expected)   ::xms::ttAssertStackedErrors(f, l, expected)
 
#define TS_ASSERT_STACKED_ERRORS(expected)   _TS_ASSERT_STACKED_ERRORS(__FILE__, __LINE__, expected)
 Checks that the stackable XM_LOG has the expected errors.
 

Functions

void xms::ttByPassMessages (int a_defaultChoice)
 Bypass the ui elements and just set return value. More...
 
bool xms::ttSkippingMessages ()
 Has ttByPassMessages been called without calling ttClearSkippingMessages. More...
 
int xms::ttByPassDefault ()
 Get the default choice when skipping messages. More...
 
void xms::ttClearSkippingMessages ()
 Turn off skipping ui elements.
 
ETestMessagingState & xms::ttTestMessagingState ()
 Get the batch mode singleton. More...
 
void xms::ttCheckXmLogForEachTest (bool a_setting)
 Set check of XM_LOG before and after each test. More...
 
bool xms::ttCheckXmLogForEachTest ()
 Turn on check of XM_LOG before and after each test. More...
 
template<class _T , class _U , class _V >
bool xms::ttEqualWithinTolerance (_T A, _U B, _V tolerance)
 Tolerance function to match CxxTest::delta for older CxxTest. Could be replaced by CxxTest::doAssertDelta when newer CxxTest is used by XMS builds. More...
 
void xms::ttAssertStackedErrors (const char *a_file, int a_line, const std::string &a_expected)
 CXX Test assert that the stackable XM_LOG has the expected errors. More...
 
void xms::ttGetTestFilePaths (const std::string &a_path, const std::string &a_fileBase, const std::string &a_extension, std::string &a_baseFilePath, std::string &a_outFilePath)
 Get testing base and output file using the compiled for architecture. Checks for appended "MacOsX" for Mac OS X and "64" for 64-bit builds. For example with Mac OS 64-bit build looks for test_baseMacOsX.vtu then if not found test_base64.vtu, then if neither found then uses test_base.vtu. More...
 
void xms::ttTextFilesEqual (const std::string &a_srcFile, unsigned a_line, const std::string &a_file1, const std::string &a_file2)
 Returns true if the two files are equal. More...
 
bool xms::ttTextFilesEqual (const std::string &a_file1, const std::string &a_file2, std::string &a_message)
 Returns true if the two files are equal. More...
 
void xms::ttStreamsEqual (const std::string &a_src, unsigned int a_line, std::istream &a_strm1, std::istream &a_strm2)
 Returns true if the two streams are equal. More...
 
bool xms::ttEqualPointsXYZ (const Pt3d &a_pt1, const Pt3d &a_pt2, double a_tolerance)
 Returns true if the points are equal to within tolerance. More...
 
bool xms::ttEqualPointsXYZ (double a_x1, double a_y1, double a_z1, double a_x2, double a_y2, double a_z2, double a_tolerance)
 Returns true if the points are equal to within tolerance. More...
 
bool xms::ttEqualPointsXY (const Pt2d &a_pt1, const Pt2d &a_pt2, double a_tolerance)
 
bool xms::ttEqualPointsXY (const Pt3d &a_pt1, const Pt3d &a_pt2, double a_tolerance)
 
bool xms::ttEqualPointsXY (double a_x1, double a_y1, double a_x2, double a_y2, double a_tolerance)
 Returns true if the points are equal to within tolerance. More...
 
template<typename T , typename U >
bool xms::ttAssertDeltaVec (const char *f, unsigned l, const std::vector< T > &a, const std::vector< T > &b, U delta)
 Template function returning true or false to help debug tests. More...
 
template<typename T , typename U >
bool xms::ttAssertDeltaVec2D (const char *f, unsigned l, const std::vector< std::vector< T >> &a, const std::vector< std::vector< T >> &b, U delta)
 Template function returning true or false to help debug tests. More...
 
template<class T >
void xms::ttAssertEqualsAVec (const char *a_file, int a_line, const T *a_expected, size_t a_expectedLength, const std::vector< T > &a_actual)
 Function for TS_ASSERT_EQUALS_AVEC. More...
 
template<typename T >
bool xms::ttAssertEqualsVec2D (const char *f, unsigned l, const std::vector< std::vector< T >> &a, const std::vector< std::vector< T >> &b)
 Template function returning true or false to help debug tests. More...
 
template<class Pt >
void xms::ttAssertDeltaPt3d (const char *a_file, int a_line, const Pt &a_pt1, const Pt &a_pt2, double a_delta)
 Assert two points are equal. More...
 
template<class Pt >
void xms::ttAssertDeltaPt2d (const char *a_file, int a_line, const Pt &a_pt1, const Pt &a_pt2, double a_delta)
 Assert two points are equal. More...
 
template<class Pt1 , class Pt2 >
void xms::ttAssertDeltaVecPt3d (const char *a_file, int a_line, const Pt1 &a_pts1, const Pt2 &a_pts2, double a_delta)
 Assert two points are equal. More...
 
template<class Pt1 , class Pt2 >
void xms::ttAssertDeltaVecPt2d (const char *a_file, int a_line, const Pt1 &a_pts1, const Pt2 &a_pts2, double a_delta)
 Assert two points are equal. More...
 

Detailed Description

Definition in file TestTools.h.

Macro Definition Documentation

◆ _TS_ASSERT_EQUALS_VEC

#define _TS_ASSERT_EQUALS_VEC (   f,
  l,
  a,
 
)
Value:
{ \
if (a.size() != b.size()) \
{ \
std::stringstream msg; \
msg << "Incorrect size Expecting size: " << a.size() << " Found size: " << b.size(); \
_TS_FAIL(f, l, msg.str().c_str()); \
} \
else \
{ \
for (size_t iUnique = 0; iUnique < a.size(); ++iUnique) \
{ \
if (a[iUnique] != b[iUnique]) \
{ \
std::stringstream msg; \
msg << "Incorrect value at position : " << iUnique << " Expecting: " << a[iUnique] \
<< " Found: " << b[iUnique]; \
_TS_FAIL(f, l, msg.str().c_str()); \
} \
} \
} \
\
}

Used to compare to vectors and give useful output information.

Definition at line 145 of file TestTools.h.

Referenced by xms::ttAssertEqualsAVec().

◆ _TS_ASSERT_STACKED_ERRORS

#define _TS_ASSERT_STACKED_ERRORS (   f,
  l,
  expected 
)    ::xms::ttAssertStackedErrors(f, l, expected)
See also
TS_ASSERT_STACKED_ERRORS

Definition at line 190 of file TestTools.h.

◆ _TS_REQUIRE_NOT_NULL

#define _TS_REQUIRE_NOT_NULL (   f,
  l,
  pointer 
)
Value:
if (pointer == NULL) \
{ \
_TS_FAIL(f, l, "Unexpected NULL pointer."); \
return; \
}

Fails if pointer is null.

Definition at line 176 of file TestTools.h.

◆ TS_ASSERT_DELTA_VEC_MP2

#define TS_ASSERT_DELTA_VEC_MP2 (   a,
  b,
  delta 
)    _TS_ASSERT_DELTA_VECPT2D(__FILE__, __LINE__, a, b, delta)

Tests if two point vectors are equal within delta and gives useful output.

Deprecated:

Definition at line 104 of file TestTools.h.

◆ TS_ASSERT_DELTA_VEC_MP3

#define TS_ASSERT_DELTA_VEC_MP3 (   a,
  b,
  delta 
)    _TS_ASSERT_DELTA_VECPT3D(__FILE__, __LINE__, a, b, delta)

Tests if two point vectors are equal within delta and gives useful output.

Deprecated:

Definition at line 86 of file TestTools.h.

Function Documentation

◆ ttAssertDeltaPt2d()

template<class Pt >
void xms::ttAssertDeltaPt2d ( const char *  a_file,
int  a_line,
const Pt &  a_pt1,
const Pt &  a_pt2,
double  a_delta 
)

Assert two points are equal.

Template function returning true or false to help debug tests.

Parameters
a_filefile.
a_lineline.
a_pt1First point.
a_pt2Second point.
a_deltaTolerance.

Definition at line 468 of file TestTools.h.

References xms::ttAssertDeltaPt2d(), and xms::ttEqualPointsXY().

Referenced by xms::ttAssertDeltaPt2d().

◆ ttAssertDeltaPt3d()

template<class Pt >
void xms::ttAssertDeltaPt3d ( const char *  a_file,
int  a_line,
const Pt &  a_pt1,
const Pt &  a_pt2,
double  a_delta 
)

Assert two points are equal.

Template function returning true or false to help debug tests.

Parameters
a_filefile.
a_lineline.
a_pt1First point.
a_pt2Second point.
a_deltaTolerance.

Definition at line 445 of file TestTools.h.

References xms::ttAssertDeltaPt3d(), and xms::ttEqualPointsXYZ().

Referenced by xms::ttAssertDeltaPt3d().

◆ ttAssertDeltaVec()

template<typename T , typename U >
bool xms::ttAssertDeltaVec ( const char *  f,
unsigned  l,
const std::vector< T > &  a,
const std::vector< T > &  b,
delta 
)

Template function returning true or false to help debug tests.

Parameters
ffile.
lline.
aVector 1.
bVector 2.
deltaA delta.
Returns
true if a and b are equal within delta.

Definition at line 281 of file TestTools.h.

References xms::ttAssertDeltaVec(), and xms::ttEqualWithinTolerance().

Referenced by xms::ttAssertDeltaVec().

◆ ttAssertDeltaVec2D()

template<typename T , typename U >
bool xms::ttAssertDeltaVec2D ( const char *  f,
unsigned  l,
const std::vector< std::vector< T >> &  a,
const std::vector< std::vector< T >> &  b,
delta 
)

Template function returning true or false to help debug tests.

Parameters
ffile.
lline.
aVector 1.
bVector 2.
deltaA delta.
Returns
true if a and b are equal within delta.

Definition at line 322 of file TestTools.h.

References xms::ttAssertDeltaVec2D(), and xms::ttEqualWithinTolerance().

Referenced by xms::ttAssertDeltaVec2D().

◆ ttAssertDeltaVecPt2d()

template<class Pt1 , class Pt2 >
void xms::ttAssertDeltaVecPt2d ( const char *  a_file,
int  a_line,
const Pt1 &  a_pts1,
const Pt2 a_pts2,
double  a_delta 
)

Assert two points are equal.

Template function returning true or false to help debug tests.

Parameters
a_filefile.
a_lineline.
a_pts1First vector of points.
a_pts2Second vector of points.
a_deltaTolerance.

Definition at line 528 of file TestTools.h.

References xms::Pt2< T >::at(), xms::ttAssertDeltaVecPt2d(), and xms::ttEqualPointsXY().

Referenced by xms::ttAssertDeltaVecPt2d().

◆ ttAssertDeltaVecPt3d()

template<class Pt1 , class Pt2 >
void xms::ttAssertDeltaVecPt3d ( const char *  a_file,
int  a_line,
const Pt1 &  a_pts1,
const Pt2 a_pts2,
double  a_delta 
)

Assert two points are equal.

Template function returning true or false to help debug tests.

Parameters
a_filefile.
a_lineline.
a_pts1First vector of points.
a_pts2Second vector of points.
a_deltaTolerance.

Definition at line 491 of file TestTools.h.

References xms::Pt2< T >::at(), xms::ttAssertDeltaVecPt3d(), and xms::ttEqualPointsXYZ().

Referenced by xms::ttAssertDeltaVecPt3d().

◆ ttAssertEqualsAVec()

template<class T >
void xms::ttAssertEqualsAVec ( const char *  a_file,
int  a_line,
const T *  a_expected,
size_t  a_expectedLength,
const std::vector< T > &  a_actual 
)

Function for TS_ASSERT_EQUALS_AVEC.

Parameters
a_filefile.
a_lineline.
a_expectedAn array.
a_expectedLengthExpected length of the vector.
a_actualThe vector to check.

Definition at line 375 of file TestTools.h.

References _TS_ASSERT_EQUALS_VEC, and xms::ttAssertEqualsAVec().

Referenced by xms::ttAssertEqualsAVec().

◆ ttAssertEqualsVec2D()

template<typename T >
bool xms::ttAssertEqualsVec2D ( const char *  f,
unsigned  l,
const std::vector< std::vector< T >> &  a,
const std::vector< std::vector< T >> &  b 
)

Template function returning true or false to help debug tests.

Parameters
ffile.
lline.
aVector 1.
bVector 2.
Returns
true if a and b are equal.

Definition at line 393 of file TestTools.h.

References xms::ttAssertEqualsVec2D().

Referenced by xms::ttAssertEqualsVec2D().

◆ ttAssertStackedErrors()

void xms::ttAssertStackedErrors ( const char *  a_file,
int  a_line,
const std::string &  a_expected 
)

CXX Test assert that the stackable XM_LOG has the expected errors.

Parameters
a_fileFile.
a_lineLine.
a_expectedstring

Definition at line 257 of file TestTools.cpp.

References xms::XmLog::GetAndClearStackStr(), xms::Singleton< XmLog >::Instance(), xms::ttAssertStackedErrors(), and xms::ttCheckXmLogForEachTest().

Referenced by xms::ttAssertStackedErrors(), and xms::ttEqualWithinTolerance().

◆ ttByPassDefault()

int xms::ttByPassDefault ( )

Get the default choice when skipping messages.

Returns
The default choice.

Definition at line 214 of file TestTools.cpp.

References xms::ETestMessagingState::GetDefault(), xms::ttByPassDefault(), and xms::ttTestMessagingState().

Referenced by xms::ttByPassDefault().

◆ ttByPassMessages()

void xms::ttByPassMessages ( int  a_defaultChoice)

Bypass the ui elements and just set return value.

Parameters
a_defaultChoiceThe option to use automatically when the user would otherwise be prompted for input.

Definition at line 196 of file TestTools.cpp.

References xms::ETestMessagingState::SetDefault(), xms::ETestMessagingState::SetSkipping(), xms::ttByPassMessages(), and xms::ttTestMessagingState().

Referenced by xms::ttByPassMessages().

◆ ttCheckXmLogForEachTest() [1/2]

void xms::ttCheckXmLogForEachTest ( bool  a_setting)

Set check of XM_LOG before and after each test.

Parameters
a_settingtrue to check.

Definition at line 239 of file TestTools.cpp.

References xms::ttCheckXmLogForEachTest().

Referenced by xms::ttAssertStackedErrors(), and xms::ttCheckXmLogForEachTest().

◆ ttCheckXmLogForEachTest() [2/2]

bool xms::ttCheckXmLogForEachTest ( )

Turn on check of XM_LOG before and after each test.

Returns
true if currently checking.

Definition at line 247 of file TestTools.cpp.

References xms::ttCheckXmLogForEachTest().

◆ ttEqualPointsXY() [1/3]

bool xms::ttEqualPointsXY ( double  a_x1,
double  a_y1,
double  a_x2,
double  a_y2,
double  a_tolerance 
)

Returns true if the points are equal to within tolerance.

Parameters
a_x1x of point 1.
a_y1y of point 1.
a_x2x of point 2.
a_y2y of point 2.
a_tolerancea_tolerance.
Returns
true if equal.

Definition at line 478 of file TestTools.cpp.

References xms::ttEqualPointsXY().

Referenced by xms::ttEqualPointsXY(), and xms::ttEqualWithinTolerance().

◆ ttEqualPointsXY() [2/3]

bool xms::ttEqualPointsXY ( const Pt2d a_pt1,
const Pt2d a_pt2,
double  a_tolerance 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
a_pt1Point 1.
a_pt2Point 2.
a_tolerancetolerance.
Returns
true if equal within tolerance.

Definition at line 496 of file TestTools.cpp.

References xms::ttEqualPointsXY(), xms::Pt2< T >::x, and xms::Pt2< T >::y.

◆ ttEqualPointsXY() [3/3]

bool xms::ttEqualPointsXY ( const Pt3d a_pt1,
const Pt3d a_pt2,
double  a_tolerance 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
a_pt1Point 1.
a_pt2Point 2.
a_tolerancetolerance.
Returns
true if equal within tolerance.

Definition at line 507 of file TestTools.cpp.

References xms::ttEqualPointsXY(), xms::Pt3< T >::x, and xms::Pt3< T >::y.

Referenced by xms::ttAssertDeltaPt2d(), and xms::ttAssertDeltaVecPt2d().

◆ ttEqualPointsXYZ() [1/2]

bool xms::ttEqualPointsXYZ ( const Pt3d a_pt1,
const Pt3d a_pt2,
double  a_tolerance 
)

Returns true if the points are equal to within tolerance.

Parameters
a_pt1Point 1.
a_pt2Point 2.
a_tolerancetolerance.
Returns
true if equal within tolerance.

Definition at line 441 of file TestTools.cpp.

References xms::ttEqualPointsXYZ(), xms::Pt3< T >::x, xms::Pt3< T >::y, and xms::Pt3< T >::z.

Referenced by xms::ttEqualPointsXYZ(), and xms::ttEqualWithinTolerance().

◆ ttEqualPointsXYZ() [2/2]

bool xms::ttEqualPointsXYZ ( double  a_x1,
double  a_y1,
double  a_z1,
double  a_x2,
double  a_y2,
double  a_z2,
double  a_tolerance 
)

Returns true if the points are equal to within tolerance.

Parameters
a_x1x of point 1.
a_y1y of point 1.
a_z1z of point 1.
a_x2x of point 2.
a_y2y of point 2.
a_z2z of point 2.
a_tolerancetolerance.
Returns
true if equal.

Definition at line 456 of file TestTools.cpp.

References xms::ttEqualPointsXYZ().

Referenced by xms::ttAssertDeltaPt3d(), and xms::ttAssertDeltaVecPt3d().

◆ ttEqualWithinTolerance()

template<class _T , class _U , class _V >
bool xms::ttEqualWithinTolerance ( _T  A,
_U  B,
_V  tolerance 
)

Tolerance function to match CxxTest::delta for older CxxTest. Could be replaced by CxxTest::doAssertDelta when newer CxxTest is used by XMS builds.

Parameters
Alhs.
Brhs.
tolerancetolerance
Returns
true if fabs(A - B) <= tolerance

Definition at line 237 of file TestTools.h.

References xms::ttAssertStackedErrors(), xms::ttEqualPointsXY(), xms::ttEqualPointsXYZ(), xms::ttEqualWithinTolerance(), xms::ttGetTestFilePaths(), xms::ttStreamsEqual(), and xms::ttTextFilesEqual().

Referenced by xms::ttAssertDeltaVec(), xms::ttAssertDeltaVec2D(), and xms::ttEqualWithinTolerance().

◆ ttGetTestFilePaths()

void xms::ttGetTestFilePaths ( const std::string &  a_path,
const std::string &  a_fileBase,
const std::string &  a_extension,
std::string &  a_baseFilePath,
std::string &  a_outFilePath 
)

Get testing base and output file using the compiled for architecture. Checks for appended "MacOsX" for Mac OS X and "64" for 64-bit builds. For example with Mac OS 64-bit build looks for test_baseMacOsX.vtu then if not found test_base64.vtu, then if neither found then uses test_base.vtu.

Parameters
[in]a_pathPath to the file.
[in]a_fileBaseFile name without extension.
[in]a_extensionFile extension.
[out]a_baseFilePathPath to base file.
[out]a_outFilePathPath to output file.

Definition at line 277 of file TestTools.cpp.

References xms::ttGetTestFilePaths().

Referenced by xms::ttEqualWithinTolerance(), and xms::ttGetTestFilePaths().

◆ ttSkippingMessages()

bool xms::ttSkippingMessages ( )

Has ttByPassMessages been called without calling ttClearSkippingMessages.

Returns
true if we are skipping messages.

Definition at line 206 of file TestTools.cpp.

References xms::ETestMessagingState::GetSkipping(), xms::ttSkippingMessages(), and xms::ttTestMessagingState().

Referenced by xms::ttSkippingMessages().

◆ ttStreamsEqual()

void xms::ttStreamsEqual ( const std::string &  a_src,
unsigned int  a_line,
std::istream &  a_strm1,
std::istream &  a_strm2 
)

Returns true if the two streams are equal.

Parameters
[in]a_srcSource code file where this is called from.
[in]a_lineLine in source code file where this is called from.
[in]a_strm1First stream.
[in]a_strm2Second stream.

Definition at line 395 of file TestTools.cpp.

References xms::ttStreamsEqual().

Referenced by xms::ttEqualWithinTolerance(), and xms::ttStreamsEqual().

◆ ttTestMessagingState()

ETestMessagingState & xms::ttTestMessagingState ( )

Get the batch mode singleton.

Returns
Reference to ETestMessagingState

Definition at line 230 of file TestTools.cpp.

References xms::ttTestMessagingState().

Referenced by xms::ttByPassDefault(), xms::ttByPassMessages(), xms::ttClearSkippingMessages(), xms::ttSkippingMessages(), and xms::ttTestMessagingState().

◆ ttTextFilesEqual() [1/2]

bool xms::ttTextFilesEqual ( const std::string &  a_file1,
const std::string &  a_file2,
std::string &  a_message 
)

Returns true if the two files are equal.

Parameters
[in]a_file1Path to first file.
[in]a_file2Path to second file.
[out]a_messageError message if the files aren't equal.
Returns
true if files are equal, else false.

Definition at line 324 of file TestTools.cpp.

References xms::ttTextFilesEqual().

Referenced by xms::ttEqualWithinTolerance(), and xms::ttTextFilesEqual().

◆ ttTextFilesEqual() [2/2]

void xms::ttTextFilesEqual ( const std::string &  a_srcFile,
unsigned  a_line,
const std::string &  a_file1,
const std::string &  a_file2 
)

Returns true if the two files are equal.

Parameters
[in]a_srcFileSource code file where this is called from.
[in]a_lineLine in source code file where this is called from.
[in]a_file1Path to first file.
[in]a_file2Path to second file.

Definition at line 379 of file TestTools.cpp.

References xms::ttTextFilesEqual().