ROSE
0.11.137.0
|
Provides functions for testing binary instruction semantics.
Most instruction semantics errors occur in two situations: an author of a subclass instantiates an incorrect SValue type, or a subclass fails to implement a virtual allocator (either due to the subclass author not implementing it, or due the the super class author adding new methods or changing method signatures). This test harness attempts to catch most of those kinds of changes.
To use this test harness, instantiate a RiscOperators object and call the TestSemantics<>::test() method. A BaseSemantics::Exception is thrown if an error is detected.
The template arguments for TestSemantics should be the smart pointer types of the classes used to build the RiscOperators that's passed to the test() method.
Definition at line 28 of file TestSemantics.h.
#include <Rose/BinaryAnalysis/InstructionSemantics/TestSemantics.h>
Classes | |
class | Exception |
class | MemoryStateSubclass |
class | RegisterStateSubclass |
class | RiscOperatorsSubclass |
class | StateSubclass |
class | SValueSubclass |
Public Member Functions | |
void | require (bool assertion, const std::string &what_failed) |
template<typename Pointer > | |
void | nonnull (const Pointer &x, const std::string &what_failed) |
template<class ToPtr , class FromPtr > | |
void | check_type (const FromPtr &x, const std::string &what_failed) |
void | check_sval_type (const BaseSemantics::SValuePtr &x, const std::string &what_failed) |
void | test (const BaseSemantics::RiscOperatorsPtr &ops) |
void | test (const BaseSemantics::SValuePtr &protoval, const BaseSemantics::StatePtr &state, const BaseSemantics::RiscOperatorsPtr &ops) |