46 if (m_accuracy !=
"cycle" && m_accuracy !=
"sloppy") {
64 const string& name = var.
GetName();
66 if (name ==
"accuracy") {
84 static void Test_RootComponent_CreateComponent()
90 "should NOT be possible", component.
IsNULL() ==
true);
93 static void Test_RootComponent_InitialVariables()
106 static void Test_RootComponent_AccuracyValues()
125 UNITTEST(Test_RootComponent_CreateComponent);
126 UNITTEST(Test_RootComponent_InitialVariables);
127 UNITTEST(Test_RootComponent_AccuracyValues);
virtual void ShowDebugMessage(const string &msg)=0
Shows a debug message.
StateVariable * GetVariable(const string &name)
Gets a pointer to a state variable.
static refcount_ptr< Component > CreateComponent(const string &componentNameAndOptionalArgs, GXemul *gxemul=NULL)
Creates a component given a short component name.
const string & GetName() const
Gets the name of the variable.
bool AddVariable(const string &name, T *variablePointer)
Adds a state variable of type T to the Component.
UI * GetUI()
Gets an UI reference for outputting debug messages during runtime.
A Component which is the default root node in the configuration.
#define UNITTESTS(class)
Helper for unit test case execution.
bool SetValue(const string &expression)
Set the variable's value, using a string expression.
string ToString() const
Returns the variable as a readable string.
A Component is a node in the configuration tree that makes up an emulation setup. ...
bool PreRunCheck(GXemul *gxemul)
Checks the state of this component and all its children, before starting execution.
RootComponent(GXemul *owner=NULL)
Constructs a RootComponent.
uint64_t ToInteger() const
Returns the variable as an unsignedinteger value.
StateVariables make up the persistent state of Component objects.
virtual bool CheckVariableWrite(StateVariable &var, const string &oldValue)
Checks whether a write to a variable is OK.
virtual bool CheckVariableWrite(StateVariable &var, const string &oldValue)
Checks whether a write to a variable is OK.
virtual bool PreRunCheckForComponent(GXemul *gxemul)
Checks the state of this component, before starting execution.
static void Assert(const string &strFailMessage, bool condition)
Asserts that a boolean condition is correct.
bool SetVariableValue(const string &name, const string &expression)
Sets a variable to a new value.
UI * GetUI()
Gets a pointer to the GXemul instance' active UI.
void SetOwner(GXemul *owner)
Base class for a User Interface.
#define UNITTEST(functionname)
Helper for unit test case execution.
bool IsNULL() const
Checks whether or not an object is referenced by the reference counted pointer.