Class IfThenElseGenerator
- java.lang.Object
-
- ru.ispras.testbase.knowledge.branch.IfThenElseGenerator
-
- All Implemented Interfaces:
Generator<IntNumber,IfThenElse>
- Direct Known Subclasses:
BeqThenElseGenerator
,BeqzThenElseGenerator
,BgeThenElseGenerator
,BgeuThenElseGenerator
,BgezThenElseGenerator
,BgtThenElseGenerator
,BgtuThenElseGenerator
,BgtzThenElseGenerator
,BleThenElseGenerator
,BleuThenElseGenerator
,BlezThenElseGenerator
,BltThenElseGenerator
,BltuThenElseGenerator
,BltzThenElseGenerator
,BneThenElseGenerator
,BnezThenElseGenerator
public abstract class IfThenElseGenerator extends java.lang.Object implements Generator<IntNumber,IfThenElse>
IfThenElseGenerator
is a base class for branch instructions' test data generators.
-
-
Constructor Summary
Constructors Constructor Description IfThenElseGenerator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
check(IfThenElse situation, IntNumber[] operands)
Checks the test data against the test situation.boolean
checkElse(IntNumber[] operands)
Checks whether the operand values do not satisfy the branch condition.abstract boolean
checkThen(IntNumber[] operands)
Checks whether the operand values satisfy the branch condition.GeneratorResult<IntNumber>
generate(IfThenElse situation, IntNumber[] operands)
Generates test data for the given test situation.abstract IntNumber[]
generateElse(IntNumber[] operands)
Generates operand values that violate the branch condition.abstract IntNumber[]
generateThen(IntNumber[] operands)
Generates operand values that satisfy the branch condition.
-
-
-
Field Detail
-
FORMAT
public static final IntFormat FORMAT
Specifies the number format.
-
MIN_VALUE
public static final long MIN_VALUE
Minimal value of an operand (depends on #FORMAT).
-
MAX_VALUE
public static final long MAX_VALUE
Maximal value of an operand (depends on #FORMAT).
-
-
Method Detail
-
check
public boolean check(IfThenElse situation, IntNumber[] operands)
Description copied from interface:Generator
Checks the test data against the test situation.- Specified by:
check
in interfaceGenerator<IntNumber,IfThenElse>
- Parameters:
situation
- the test situation.operands
- the test data.- Returns:
true
if the test data correspond to the test situation;false
otherwise.
-
generate
public GeneratorResult<IntNumber> generate(IfThenElse situation, IntNumber[] operands)
Description copied from interface:Generator
Generates test data for the given test situation.- Specified by:
generate
in interfaceGenerator<IntNumber,IfThenElse>
- Parameters:
situation
- the test situation.operands
- the test data having been fixed.- Returns:
- the test data.
-
checkThen
public abstract boolean checkThen(IntNumber[] operands)
Checks whether the operand values satisfy the branch condition.- Parameters:
operands
- input values.- Returns:
true
iff satisfy.
-
checkElse
public final boolean checkElse(IntNumber[] operands)
Checks whether the operand values do not satisfy the branch condition.- Parameters:
operands
- input values.- Returns:
true
iff do not satisfy.
-
generateThen
public abstract IntNumber[] generateThen(IntNumber[] operands)
Generates operand values that satisfy the branch condition.- Parameters:
operands
- input values (null
if unknown).- Returns:
- the generated values.
-
-