ROSE  0.11.145.0
Classes | Public Types | Public Member Functions | List of all members
Rose::BinaryAnalysis::InstructionSemantics::TestSemantics< SValuePtr, RegisterStatePtr, MemoryStatePtr, StatePtr, RiscOperatorsPtr > Class Template Reference

Description

template<class SValuePtr, class RegisterStatePtr, class MemoryStatePtr, class StatePtr, class RiscOperatorsPtr>
class Rose::BinaryAnalysis::InstructionSemantics::TestSemantics< SValuePtr, RegisterStatePtr, MemoryStatePtr, StatePtr, RiscOperatorsPtr >

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 Types

typedef SValuePtr::Pointee SValue
 
typedef RegisterStatePtr::element_type RegisterState
 
typedef MemoryStatePtr::element_type MemoryState
 
typedef StatePtr::element_type State
 
typedef RiscOperatorsPtr::element_type RiscOperators
 

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)
 

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