47 if (arguments.size() > 1) {
52 if (arguments.size() > 0) {
72 return "Runs one step of the emulation.";
78 return "Runs one step (or multiple single-steps) in the emulation.\n" 80 "See also: continue (to continue without single-stepping)\n";
89 static void Test_StepCommand_Affect_RunState()
92 vector<string> dummyArguments;
99 cmd->
Execute(gxemul, dummyArguments);
105 static void Test_StepCommand_GoodArgs()
108 vector<string> arguments;
111 arguments.push_back(
"42");
114 cmd->
Execute(gxemul, arguments));
117 static void Test_StepCommand_BadArgs_TooMany()
120 vector<string> arguments;
123 arguments.push_back(
"42");
124 arguments.push_back(
"43");
127 !cmd->
Execute(gxemul, arguments));
130 static void Test_StepCommand_BadArgs_Zero()
133 vector<string> arguments;
136 arguments.push_back(
"0");
139 !cmd->
Execute(gxemul, arguments));
142 static void Test_StepCommand_BadArgs_Negative()
145 vector<string> arguments;
148 arguments.push_back(
"-42");
151 !cmd->
Execute(gxemul, arguments));
156 UNITTEST(Test_StepCommand_Affect_RunState);
157 UNITTEST(Test_StepCommand_GoodArgs);
158 UNITTEST(Test_StepCommand_BadArgs_TooMany);
159 UNITTEST(Test_StepCommand_BadArgs_Zero);
160 UNITTEST(Test_StepCommand_BadArgs_Negative);
void SetRunState(RunState newState)
Sets the RunState.
virtual void ShowDebugMessage(const string &msg)=0
Shows a debug message.
RunState GetRunState() const
Gets the current RunState.
virtual string GetShortDescription() const
Returns a short (one-line) description of the command.
A Command which sets the RunState to SingleStepping.
void SetNrOfSingleStepsInARow(uint64_t steps)
Sets the nr of single-steps to perform in a row.
#define UNITTESTS(class)
Helper for unit test case execution.
virtual bool Execute(GXemul &gxemul, const vector< string > &arguments)=0
Executes the command on a given GXemul instance.
StepCommand()
Constructs a StepCommand.
virtual bool Execute(GXemul &gxemul, const vector< string > &arguments)
Executes the command on a given GXemul instance.
A Command is a named function, executed by the CommandInterpreter.
static void Assert(const string &strFailMessage, bool condition)
Asserts that a boolean condition is correct.
UI * GetUI()
Gets a pointer to the GXemul instance' active UI.
virtual string GetLongDescription() const
Returns a long description/help message for the command.
#define UNITTEST(functionname)
Helper for unit test case execution.