Class FpExceptionGenerator

    • Constructor Detail

      • FpExceptionGenerator

        public FpExceptionGenerator()
    • Method Detail

      • check

        public final boolean check​(FpException situation,
                                   FpNumber[] operands)
        Description copied from interface: Generator
        Checks the test data against the test situation.
        Specified by:
        check in interface Generator<FpNumber,​FpException>
        Parameters:
        situation - the test situation.
        operands - the test data.
        Returns:
        true if the test data correspond to the test situation; false otherwise.
      • checkNormal

        protected abstract boolean checkNormal​(FpNumber[] operands)
        Checks whether the operation does not cause exceptions.
        Parameters:
        operands - the operation operands.
        Returns:
        true if the operation does not cause exceptions; false otherwise.
      • generateNormal

        protected abstract GeneratorResult<FpNumber> generateNormal​(FpNumber[] operands)
        Tries to generate operands that do not cause exceptions.
        Parameters:
        operands - the operation operands (operand[i] == null if the i-th operation is not fixed; otherwise operand[i] contains the operand value).
        Returns:
        the operation operands.
      • checkOverflow

        protected abstract boolean checkOverflow​(FpNumber[] operands)
        Checks whether the operation causes the overflow exception.
        Parameters:
        operands - the operation operands.
        Returns:
        true if the operation causes the exception; false otherwise.
      • generateOverflow

        protected abstract GeneratorResult<FpNumber> generateOverflow​(FpNumber[] operands)
        Tries to generate operands that cause the overflow exception.
        Parameters:
        operands - the operation operands (operand[i] == null if the i-th operation is not fixed; otherwise operand[i] contains the operand value).
        Returns:
        the operation operands.
      • checkUnderflow

        protected abstract boolean checkUnderflow​(FpNumber[] operands)
      • generateUnderflow

        protected abstract GeneratorResult<FpNumber> generateUnderflow​(FpNumber[] operands)
        Tries to generate operands that cause the underflow exception.
        Parameters:
        operands - the operation operands (operand[i] == null if the i-th operation is not fixed; otherwise operand[i] contains the operand value).
        Returns:
        the operation operands.
      • checkInexact

        protected abstract boolean checkInexact​(FpNumber[] operands)
        Checks whether the operation causes the inexact exception.
        Parameters:
        operands - the operation operands.
        Returns:
        true if the operation causes the exception; false otherwise.
      • generateInexact

        protected abstract GeneratorResult<FpNumber> generateInexact​(FpNumber[] operands)
        Tries to generate operands that cause the inexact exception.
        Parameters:
        operands - the operation operands (operand[i] == null if the i-th operation is not fixed; otherwise operand[i] contains the operand value).
        Returns:
        the operation operands.