MainTestFixture is a base class for Catch fixtures for mlpack binding tests. More...

Public Member Functions

 MainTestFixture (const util::Params &paramsIn)
 Create a MainTestFixture with the given set of parameters. More...

 
 ~MainTestFixture ()
 Clean up any memory associated with the MainTestFixture. More...

 
void CleanMemory ()
 Clean any memory associated with the params object. More...

 
void ResetSettings ()
 Reset the params object to its initial state. More...

 
template
<
typename
T
>
void SetInputParam (const std::string &name, T &&value)
 Set the input parameter name to have value value. More...

 

Protected Attributes

util::Params params
 Parameters object, which the binding will be called with. More...

 
util::Params paramsClean
 Untouched "clean" parameters object, used for resetting. More...

 
util::Timers timers
 Timers object, which the binding will be called with. More...

 

Detailed Description

MainTestFixture is a base class for Catch fixtures for mlpack binding tests.

Instead of using this class directly, use the BINDING_TEST_FIXTURE() macro to correctly define a fixture once BINDING_NAME is defined in your test file. Then, you can use all the methods in this class inside the tests.

Definition at line 53 of file main_test_fixture.hpp.

Constructor & Destructor Documentation

◆ MainTestFixture()

MainTestFixture ( const util::Params &  paramsIn)
inline

Create a MainTestFixture with the given set of parameters.

Definition at line 57 of file main_test_fixture.hpp.

References TestFunctionMap::FunctionMap(), params, and paramsClean.

◆ ~MainTestFixture()

~MainTestFixture ( )
inline

Clean up any memory associated with the MainTestFixture.

Definition at line 73 of file main_test_fixture.hpp.

References CleanMemory().

Member Function Documentation

◆ CleanMemory()

void CleanMemory ( )
inline

Clean any memory associated with the params object.

Definition at line 98 of file main_test_fixture.hpp.

References mlpack::bindings::tests::CleanMemory(), and params.

Referenced by ~MainTestFixture().

◆ ResetSettings()

void ResetSettings ( )
inline

Reset the params object to its initial state.

After calling this method, it is as though no parameters at all have been set with SetInputParam(). Note that this does not clean memory associated with the current parameters! So, you may want to call ClearMemory() before calling this.

Definition at line 85 of file main_test_fixture.hpp.

References params, paramsClean, and timers.

◆ SetInputParam()

void SetInputParam ( const std::string &  name,
T &&  value 
)
inline

Set the input parameter name to have value value.

Definition at line 107 of file main_test_fixture.hpp.

References params.

Member Data Documentation

◆ params

util::Params params
protected

Parameters object, which the binding will be called with.

Definition at line 118 of file main_test_fixture.hpp.

Referenced by CleanMemory(), MainTestFixture(), ResetSettings(), and SetInputParam().

◆ paramsClean

util::Params paramsClean
protected

Untouched "clean" parameters object, used for resetting.

Definition at line 116 of file main_test_fixture.hpp.

Referenced by MainTestFixture(), and ResetSettings().

◆ timers

util::Timers timers
protected

Timers object, which the binding will be called with.

Definition at line 120 of file main_test_fixture.hpp.

Referenced by ResetSettings().


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