Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mitsuba::TestCase Class Reference

Base class of all testcases. More...

#include <mitsuba/render/testcase.h>

+ Inheritance diagram for mitsuba::TestCase:

Public Member Functions

virtual void init ()
 
virtual void shutdown ()
 
int getExecuted () const
 Return the number of executed testcases. More...
 
int getSucceeded () const
 Return the number of successfully executed testcases. More...
 
virtual const ClassgetClass () const
 Retrieve this object's class. More...
 
- Public Member Functions inherited from mitsuba::Utility
virtual int run (int argc, char **argv)=0
 
- Public Member Functions inherited from Object
 Object ()
 Construct a new object. More...
 
int getRefCount () const
 Return the current reference count. More...
 
void incRef () const
 Increase the reference count of the object by one. More...
 
void decRef (bool autoDeallocate=true) const
 Decrease the reference count of the object and possibly deallocate it. More...
 
virtual std::string toString () const
 Return a human-readable string representation of the object's contents. More...
 

Static Public Attributes

static Classm_theClass
 
- Static Public Attributes inherited from mitsuba::Utility
static Classm_theClass
 
- Static Public Attributes inherited from Object
static Classm_theClass
 Pointer to the object's class descriptor. More...
 

Protected Member Functions

virtual ~TestCase ()
 Virtual destructor. More...
 
void assertEqualsImpl (int actual, int expected, Float epsilon, const char *file, int line)
 Asserts that the two integer values are equal. More...
 
void assertEqualsImpl (Float actual, Float expected, Float epsilon, const char *file, int line)
 Asserts that the two floating point values are equal. More...
 
void assertEqualsImpl (const Spectrum &actual, const Spectrum &expected, Float epsilon, const char *file, int line)
 Asserts that the two spectral power distributions are equal. More...
 
void assertEqualsImpl (const Vector2 &actual, const Vector2 &expected, Float epsilon, const char *file, int line)
 Asserts that the two 2D vectors are equal. More...
 
void assertEqualsImpl (const Vector &actual, const Vector &expected, Float epsilon, const char *file, int line)
 Asserts that the two 3D vectors are equal. More...
 
void assertEqualsImpl (const Vector4 &actual, const Vector4 &expected, Float epsilon, const char *file, int line)
 Asserts that the two 4D vectors are equal. More...
 
void assertEqualsImpl (const Point2 &actual, const Point2 &expected, Float epsilon, const char *file, int line)
 Asserts that the two 2D points are equal. More...
 
void assertEqualsImpl (const Point &actual, const Point &expected, Float epsilon, const char *file, int line)
 Asserts that the two 3D points are equal. More...
 
template<int M, int N>
void assertEqualsImpl (const Matrix< M, N, Float > &actual, const Matrix< M, N, Float > &expected, Float epsilon, const char *file, int line)
 Asserts that the two 4x4 matrices are equal. More...
 
void assertTrueImpl (bool condition, const char *expr, const char *file, int line)
 Asserts that a condition is true. More...
 
void assertFalseImpl (bool condition, const char *expr, const char *file, int line)
 Asserts that a condition is false. More...
 
void failAndContinueImpl (const std::string &msg, const char *file, int line)
 Note a failure and continue. More...
 
void succeed ()
 Increase the number of succeeded tests. More...
 
- Protected Member Functions inherited from mitsuba::Utility
virtual ~Utility ()
 Virtual destructor. More...
 
ref< SceneloadScene (const fs::path &fname, const ParameterMap &params=ParameterMap())
 Load a scene from an external file. More...
 
ref< SceneloadSceneFromString (const std::string &content, const ParameterMap &params=ParameterMap())
 Load a scene from a string. More...
 
- Protected Member Functions inherited from Object
virtual ~Object ()
 Virtual private deconstructor. (Will only be called by ref) More...
 

Protected Attributes

int m_executed
 
int m_succeeded
 

Additional Inherited Members

- Static Public Member Functions inherited from Object
static void staticInitialization ()
 Initializes the built-in reference count debugger (if enabled) More...
 
static void staticShutdown ()
 Free the memory taken by staticInitialization() More...
 
- Protected Types inherited from mitsuba::Utility
typedef std::map< std::string,
std::string,
SimpleStringOrdering
ParameterMap
 

Detailed Description

Base class of all testcases.

Implementations of this interface can be executed using the 'mtsutil' command. The execution order is as follows: after initializaiton using init(), any tests declared using the MTS_DECLARE_TEST() macro are executed. Finally, the shutdown() method is called. See the files in 'mitsuba/src/tests' for examples.

Constructor & Destructor Documentation

virtual mitsuba::TestCase::~TestCase ( )
inlineprotectedvirtual

Virtual destructor.

Member Function Documentation

void mitsuba::TestCase::assertEqualsImpl ( int  actual,
int  expected,
Float  epsilon,
const char *  file,
int  line 
)
protected

Asserts that the two integer values are equal.

void mitsuba::TestCase::assertEqualsImpl ( Float  actual,
Float  expected,
Float  epsilon,
const char *  file,
int  line 
)
protected

Asserts that the two floating point values are equal.

void mitsuba::TestCase::assertEqualsImpl ( const Spectrum actual,
const Spectrum expected,
Float  epsilon,
const char *  file,
int  line 
)
protected

Asserts that the two spectral power distributions are equal.

void mitsuba::TestCase::assertEqualsImpl ( const Vector2 actual,
const Vector2 expected,
Float  epsilon,
const char *  file,
int  line 
)
protected

Asserts that the two 2D vectors are equal.

void mitsuba::TestCase::assertEqualsImpl ( const Vector actual,
const Vector expected,
Float  epsilon,
const char *  file,
int  line 
)
protected

Asserts that the two 3D vectors are equal.

void mitsuba::TestCase::assertEqualsImpl ( const Vector4 actual,
const Vector4 expected,
Float  epsilon,
const char *  file,
int  line 
)
protected

Asserts that the two 4D vectors are equal.

void mitsuba::TestCase::assertEqualsImpl ( const Point2 actual,
const Point2 expected,
Float  epsilon,
const char *  file,
int  line 
)
protected

Asserts that the two 2D points are equal.

void mitsuba::TestCase::assertEqualsImpl ( const Point actual,
const Point expected,
Float  epsilon,
const char *  file,
int  line 
)
protected

Asserts that the two 3D points are equal.

template<int M, int N>
void mitsuba::TestCase::assertEqualsImpl ( const Matrix< M, N, Float > &  actual,
const Matrix< M, N, Float > &  expected,
Float  epsilon,
const char *  file,
int  line 
)
inlineprotected

Asserts that the two 4x4 matrices are equal.

void mitsuba::TestCase::assertFalseImpl ( bool  condition,
const char *  expr,
const char *  file,
int  line 
)
protected

Asserts that a condition is false.

void mitsuba::TestCase::assertTrueImpl ( bool  condition,
const char *  expr,
const char *  file,
int  line 
)
protected

Asserts that a condition is true.

void mitsuba::TestCase::failAndContinueImpl ( const std::string &  msg,
const char *  file,
int  line 
)
protected

Note a failure and continue.

virtual const Class* mitsuba::TestCase::getClass ( ) const
virtual

Retrieve this object's class.

Reimplemented from mitsuba::Utility.

int mitsuba::TestCase::getExecuted ( ) const
inline

Return the number of executed testcases.

int mitsuba::TestCase::getSucceeded ( ) const
inline

Return the number of successfully executed testcases.

virtual void mitsuba::TestCase::init ( )
virtual

Perform any required initializations. The default implementation simply returns

virtual void mitsuba::TestCase::shutdown ( )
virtual

Execute any required shutdown code. The default implementation simply returns

void mitsuba::TestCase::succeed ( )
protected

Increase the number of succeeded tests.

Member Data Documentation

int mitsuba::TestCase::m_executed
protected
int mitsuba::TestCase::m_succeeded
protected
Class* mitsuba::TestCase::m_theClass
static

The documentation for this class was generated from the following file: