Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8258813

[TESTBUG] Fix incorrect Vector API test output message

    XMLWordPrintable

Details

    • b04

    Description

      Some vector api tests have incorrect output messages if assertion fails.

      For example, here is part of the fail logs in VectorReshapeTests:
      ```
        test VectorReshapeTests.testCastFromByte(byte(i)): successtest VectorReshapeTests.testCastFromByte(byte(i)): success
        test VectorReshapeTests.testCastFromDouble(double(i)): successtest VectorReshapeTests.testCastFromFloat(float(i)): success
        test VectorReshapeTests.testCastFromInt(int(i)): successtest VectorReshapeTests.testCastFromLong(long(i)): success
        test VectorReshapeTests.testCastFromShort(short(i)): success
        input: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
        Failing with Species[byte, 16, S_128_BIT]->Species[double, 2, S_128_BIT] (reinterpret), partLimit=0, block=16, part=0, origin=0
        expect: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
        output: [1, 2, 3, 4, 5, 6, 7, 8, 1, 0, 0, 0, 0, 0, 0, 0]
        test VectorReshapeTests.testRebracket128(byte(i)): failure
        java.lang.AssertionError: arrays differ firstly at element [8]; expected value is <1> but was <9>.
          at org.testng.Assert.fail(Assert.java:94)
          at org.testng.Assert.assertEquals(Assert.java:774)
          at org.testng.Assert.assertEquals(Assert.java:748)
      ```
      It should be "expected value is <9> but was <1>". The arguments of Assert.assertEquals() were incorrectly swapped. This doesn't have any influence to the tests effectivity. However, the incorrect message is confusing which might mislead someone. It's better to fix them all.

      Attachments

        Issue Links

          Activity

            People

              xgong Xiaohong Gong
              xgong Xiaohong Gong
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: