Chaste Commit::baa90ac2819b962188b7562f2326be23c47859a7
|
#include <CommandLineArgumentsMocker.hpp>
Public Member Functions | |
CommandLineArgumentsMocker (std::string newArguments) | |
~CommandLineArgumentsMocker () | |
Private Attributes | |
int | mNumArgs |
char ** | mpArgs |
int * | mpNumOldArgs |
char *** | mpOldArgs |
This is a little helper wrapper for CommandLineArguments that allows a test to replace ALL of the command line arguments by calling the constructor.
It is useful for allowing more tests on code that reads CommandLineArguments without resorting to acceptance tests of executables.
Definition at line 48 of file CommandLineArgumentsMocker.hpp.
CommandLineArgumentsMocker::CommandLineArgumentsMocker | ( | std::string | newArguments | ) |
Only available constructor. This replaces all of the command line arguments that were being used (but remembers them).
newArguments | a string of command line arguments to put into the singleton CommandLineArguments class. |
Definition at line 42 of file CommandLineArgumentsMocker.cpp.
References CommandLineArguments::Instance(), mNumArgs, mpArgs, mpNumOldArgs, mpOldArgs, CommandLineArguments::p_argc, and CommandLineArguments::p_argv.
CommandLineArgumentsMocker::~CommandLineArgumentsMocker | ( | ) |
Destructor.
Cleans up memory and restores the original CommandLineArguments.
Definition at line 73 of file CommandLineArgumentsMocker.cpp.
References CommandLineArguments::Instance(), mNumArgs, mpArgs, mpNumOldArgs, mpOldArgs, CommandLineArguments::p_argc, and CommandLineArguments::p_argv.
|
private |
The new number of arguments
Definition at line 69 of file CommandLineArgumentsMocker.hpp.
Referenced by CommandLineArgumentsMocker(), and ~CommandLineArgumentsMocker().
|
private |
The new arguments
Definition at line 71 of file CommandLineArgumentsMocker.hpp.
Referenced by CommandLineArgumentsMocker(), and ~CommandLineArgumentsMocker().
|
private |
The location of the old number of arguments
Definition at line 74 of file CommandLineArgumentsMocker.hpp.
Referenced by CommandLineArgumentsMocker(), and ~CommandLineArgumentsMocker().
|
private |
The location of the old arguments
Definition at line 76 of file CommandLineArgumentsMocker.hpp.
Referenced by CommandLineArgumentsMocker(), and ~CommandLineArgumentsMocker().