Derby
  1. Derby
  2. DERBY-5986

Make ArithmeticTest test DECIMAL data type

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 10.10.1.1
    • Fix Version/s: 10.10.1.1
    • Component/s: Test
    • Labels:
      None

      Description

      I noticed in the code coverage report that the DECIMAL data type has less test coverage than the other numeric data types. One way to improve it may be to make existing tests for other numeric types also test the DECIMAL type. ArithmeticTest is one such test.

      1. d5986-1a-decimal.diff
        13 kB
        Knut Anders Hatlen

        Activity

        Hide
        Knut Anders Hatlen added a comment -

        Committed revision 1406950.

        Show
        Knut Anders Hatlen added a comment - Committed revision 1406950.
        Hide
        Knut Anders Hatlen added a comment -

        Attaching a patch that makes ArithmeticTest test the DECIMAL data type.

        Most of the test cases worked on DECIMAL with no changes. What needed to be changed was:

        • Assumptions that the negative boundary for numeric data types was -positiveBoundary-1. For DECIMAL, the range of legal values is symmetric around zero.
        • Canons that asserted results were always integers. With DECIMAL, the results of divisions could have a fraction part.
        • Needed to use BigDecimal to represent and test boundary values, as the DECIMAL type supports values outside the Java long range.
        Show
        Knut Anders Hatlen added a comment - Attaching a patch that makes ArithmeticTest test the DECIMAL data type. Most of the test cases worked on DECIMAL with no changes. What needed to be changed was: Assumptions that the negative boundary for numeric data types was -positiveBoundary-1. For DECIMAL, the range of legal values is symmetric around zero. Canons that asserted results were always integers. With DECIMAL, the results of divisions could have a fraction part. Needed to use BigDecimal to represent and test boundary values, as the DECIMAL type supports values outside the Java long range.

          People

          • Assignee:
            Knut Anders Hatlen
            Reporter:
            Knut Anders Hatlen
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development