jdk/test/sun/java2d/cmm/ProfileOp/ReadWriteProfileTest.java
changeset 9784 3a0ebf0b855d
parent 5506 202f599c92aa
child 19783 88ce9a76c992
equal deleted inserted replaced
9778:967402e4be8b 9784:3a0ebf0b855d
    21  * questions.
    21  * questions.
    22  */
    22  */
    23 
    23 
    24 /**
    24 /**
    25  * @test
    25  * @test
    26  * @bug 6476665 6523403 6733501
    26  * @bug 6476665 6523403 6733501 7042594
    27  * @summary Verifies reading and writing profiles and tags of the standard color
    27  * @summary Verifies reading and writing profiles and tags of the standard color
    28  * spaces
    28  * spaces
    29  * @run main ReadWriteProfileTest
    29  * @run main ReadWriteProfileTest
    30  */
    30  */
    31 import java.awt.color.ColorSpace;
    31 import java.awt.color.ColorSpace;
    92             }
    92             }
    93 
    93 
    94             for (int tagSig : tags[i].keySet()) {
    94             for (int tagSig : tags[i].keySet()) {
    95                 byte [] tagData = pf.getData(tagSig);
    95                 byte [] tagData = pf.getData(tagSig);
    96                 byte [] empty = new byte[tagData.length];
    96                 byte [] empty = new byte[tagData.length];
    97                 pf.setData(tagSig, empty);
    97                 boolean emptyDataRejected = false;
       
    98                 try {
       
    99                     pf.setData(tagSig, empty);
       
   100                 } catch (IllegalArgumentException e) {
       
   101                     emptyDataRejected = true;
       
   102                 }
       
   103                 if (!emptyDataRejected) {
       
   104                     throw new
       
   105                         RuntimeException("Test failed: empty tag data was not rejected.");
       
   106                 }
    98                 pf.setData(tagSig, tagData);
   107                 pf.setData(tagSig, tagData);
    99 
   108 
   100                 byte [] tagData1 = pf.getData(tagSig);
   109                 byte [] tagData1 = pf.getData(tagSig);
   101 
   110 
   102                 if (!Arrays.equals(tagData1, tags[i].get(tagSig)))
   111                 if (!Arrays.equals(tagData1, tags[i].get(tagSig)))