Class OracleEventMatcherFull
- java.lang.Object
-
- ru.ispras.microtesk.tools.oracle.matcher.OracleEventMatcherFull
-
- All Implemented Interfaces:
OracleEventMatcher
- Direct Known Subclasses:
OracleEventMatcherNotFull
public class OracleEventMatcherFull extends java.lang.Object implements OracleEventMatcher
TheOracleEventMatcherFull
class runs the program onProgramSimulator
step by step and compares the result with the events from the control trace
-
-
Field Summary
Fields Modifier and Type Field Description protected EventList
eventReader
protected java.util.Map<java.lang.String,java.lang.Long>
objIdentifiers
protected java.util.Map<java.lang.String,java.lang.Long>
objIdentifiersNew
protected ProgramSimulator
programSimulator
protected Registers
registers
-
Fields inherited from interface ru.ispras.microtesk.tools.oracle.matcher.OracleEventMatcher
FAILURE_MATCH, SUCCESSFUL_MATCH
-
-
Constructor Summary
Constructors Constructor Description OracleEventMatcherFull(EventList eventReader, ProgramSimulator programSimulator, Registers registers)
Creates the matcher that compares the output of the model with the control trace
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkEvent()
Matches the event from the simulator and the event from the trace, and returnstrue
if they match.protected boolean
checkInstruction()
protected boolean
checkProgramCounter()
protected boolean
checkRegister()
protected ConcreteEvent
getCurrentEvent()
boolean
hasNext()
Returnstrue
if the oracle has more events.boolean
isAllTraceEventsMatched()
Returnstrue
if the oracle does not contain trace events to matchvoid
nextEvent()
Moves to the next active oracle event.
-
-
-
Field Detail
-
eventReader
protected final EventList eventReader
-
programSimulator
protected final ProgramSimulator programSimulator
-
registers
protected final Registers registers
-
objIdentifiers
protected final java.util.Map<java.lang.String,java.lang.Long> objIdentifiers
-
objIdentifiersNew
protected java.util.Map<java.lang.String,java.lang.Long> objIdentifiersNew
-
-
Constructor Detail
-
OracleEventMatcherFull
public OracleEventMatcherFull(EventList eventReader, ProgramSimulator programSimulator, Registers registers)
Creates the matcher that compares the output of the model with the control trace- Parameters:
eventReader
- the trace events.programSimulator
- Gives the state of the model for comparison.registers
- the simulator registers.- Throws:
java.lang.IllegalArgumentException
- if any of the parameters equalsnull
.
-
-
Method Detail
-
nextEvent
public void nextEvent()
Description copied from interface:OracleEventMatcher
Moves to the next active oracle event.- Specified by:
nextEvent
in interfaceOracleEventMatcher
-
getCurrentEvent
protected ConcreteEvent getCurrentEvent()
-
checkEvent
public boolean checkEvent()
Description copied from interface:OracleEventMatcher
Matches the event from the simulator and the event from the trace, and returnstrue
if they match.- Specified by:
checkEvent
in interfaceOracleEventMatcher
- Returns:
- true if the event match
-
checkInstruction
protected boolean checkInstruction()
-
checkProgramCounter
protected boolean checkProgramCounter()
-
checkRegister
protected boolean checkRegister()
-
hasNext
public boolean hasNext()
Description copied from interface:OracleEventMatcher
Returnstrue
if the oracle has more events.- Specified by:
hasNext
in interfaceOracleEventMatcher
- Returns:
- true if the oracle has more events
-
isAllTraceEventsMatched
public boolean isAllTraceEventsMatched()
Description copied from interface:OracleEventMatcher
Returnstrue
if the oracle does not contain trace events to match- Specified by:
isAllTraceEventsMatched
in interfaceOracleEventMatcher
- Returns:
- true if the oracle does not contain trace events to match
-
-