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

api/java_awt/Color/ICC_ProfileRGB/index.html#SetDataTest, GetTesttestCase2 fails

    XMLWordPrintable

Details

    • 2d
    • x86
    • linux

    Description

      JDK: openJDK6 b03 (pass on b02)
      JCK: JCK6a + alt01
      Platform: Ubuntu Linux

      The following tests fails with similar reports

      -----------------------------------------------------------------
      api/java_awt/Color/ICC_ProfileRGB/index.html#SetDataTesttestCase1

      testCase1: Failed. Case#1: ICC_ProfileRGB.setData(int,byte[]): new ICC_ProfileRGB() with data ICC_ProfileRGB.icSigAToB0Tag = {0...9} setData('ICC_ProfileRGB.icSigAToB0Tag,{0...9}) returned {109...-1}. It should have returned {0...9}. : Failed *** 1 out of 1 test cases failed. ***

      Code extract:
          public Status testCase1() throws IOException {
              TestStatus status = new TestStatus(fVerbose);
              String apiTested = "ICC_ProfileRGB.setData(int,byte[]): ";
              String msg = apiTested;
              try {
                  // test case ...
                  ICC_ProfileRGB profile = (ICC_ProfileRGB)ICC_ProfileRGB.getInstance(
                      GetProfile.loadProfileBytes(parentdirurl, "profile1.dat"));
                  byte[] headData = new byte[10];
                  for(int i = 0;i < headData.length;i++)
                      headData[i] = (byte)i;
                  profile.setData(ICC_ProfileRGB.icSigAToB0Tag, headData);
                  byte[] data = profile.getData(ICC_ProfileRGB.icSigAToB0Tag);
                  boolean result = true;
                  
                  //loop through the data arrays to make sure they match
                  for(int i = 0;i < data.length;i++) {
                      if(data[i] != headData[i]) {
                          result = false;
                          break;
                      }
                  }
                  msg = apiTested;
                  if(!result)
                      msg += "new ICC_ProfileRGB() with data ICC_ProfileRGB.icSigAT"+
                          "oB0Tag = {0...9} " + "setData('ICC_ProfileRGB.icSigAToB0"+
                          "Tag,{0...9}) " + "returned {" + data[0] + "..." +
                          data[data.length - 1] + "}" + ". It should have returned"+
                          " " + "{0...9}" + ".\n";
                  status.addTestCase(result, msg);
              }
              catch(IllegalArgumentException exception) {
                  status.addTestCase(false, msg + " got Throwable: " + exception.
                      getMessage());
              }
              return status.computeStatus();
          }

      -------------------------------------------------------------

      api/java_awt/Color/ICC_ProfileRGB/index.html#GetTesttestCase2

      testCase2: Failed. Case#1: ICC_ProfileRGB.getData(int): new ICC_ProfileRGB() with data 'AToB0' = {0...9} getData(ICC_ProfileRGB.icSigAToB0Tag) returned {109...-1}. It should have returned {0...9}. : Failed *** 1 out of 1 test cases failed. ***

      Code extract:

          public Status testCase2() throws IOException {
              TestStatus status = new TestStatus(fVerbose);
              String apiTested = "ICC_ProfileRGB.setData(int,byte[]): ";
              String msg = apiTested;
              try {
                  // test case ...
                  ICC_ProfileRGB profile = (ICC_ProfileRGB)ICC_ProfileRGB.getInstance(
                      GetProfile.loadProfileBytes(parentdirurl, "profile1.dat"));
                  byte[] headData = null;
                  for(int i = 0;i < headData.length;i++)
                      headData[i] = (byte)i;
                  profile.setData(ICC_ProfileRGB.icSigAToB0Tag, headData);
                  byte[] data = profile.getData(ICC_ProfileRGB.icSigAToB0Tag);
                  boolean result = true;
                  
                  //loop through the data arrays to make sure they match
                  for(int i = 0;i < data.length;i++) {
                      if(data[i] != headData[i]) {
                          result = false;
                          break;
                      }
                  }
                  msg = apiTested;
                  status.addTestCase(result, msg);
              }
              catch(NullPointerException e1) {
                  status.addTestCase(true, msg + " got Throwable: NullPointerExcept"+
                      "ion" + e1.getMessage());
              }
              return status.computeStatus();
          }

      Attachments

        Issue Links

          Activity

            People

              darcy Joe Darcy
              dbessono Dmitry Bessonov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: