JDK-6657599 : api/java_awt/Color/ICC_ProfileRGB/index.html#SetDataTest, GetTesttestCase2 fails
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: OpenJDK6
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2008-01-31
  • Updated: 2012-03-22
  • Resolved: 2008-09-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
OpenJDK6Resolved
Related Reports
Duplicate :  
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();
    }

Comments
EVALUATION Resolved as expected by fix for 6733501.
24-09-2008

EVALUATION Color management is a Java2D area of responsibility.
31-01-2008