jdk/test/java/util/zip/TestCRC32C.java
author sherman
Fri, 21 Nov 2014 09:28:53 -0800
changeset 27737 0a3fb0529425
child 40684 2e37c119dc2a
permissions -rw-r--r--
6321472: Add CRC-32C API Summary: to add CRC-32C api and implementation Reviewed-by: sherman Contributed-by: staffan.friberg@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
27737
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
     1
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
     2
import java.util.zip.CRC32C;
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
     3
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
     4
/*
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
     5
 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
     6
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
     7
 *
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
     8
 * This code is free software; you can redistribute it and/or modify it
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
     9
 * under the terms of the GNU General Public License version 2 only, as
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
    10
 * published by the Free Software Foundation.
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
    11
 *
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
    12
 * This code is distributed in the hope that it will be useful, but WITHOUT
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
    13
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
    14
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
    15
 * version 2 for more details (a copy is included in the LICENSE file that
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
    16
 * accompanied this code).
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
    17
 *
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
    18
 * You should have received a copy of the GNU General Public License version
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
    19
 * 2 along with this work; if not, write to the Free Software Foundation,
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
    20
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
    21
 *
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
    22
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
    23
 * or visit www.oracle.com if you need additional information or have any
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
    24
 * questions.
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
    25
 */
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
    26
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
    27
/**
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
    28
 * @test @summary Check that CRC-32C returns the expected CRC value for the
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
    29
 * string 123456789
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
    30
 * http://reveng.sourceforge.net/crc-catalogue/all.htm#crc.cat.crc-32c
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
    31
 * @build ChecksumBase
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
    32
 * @run main TestCRC32C
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
    33
 */
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
    34
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
    35
public class TestCRC32C {
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
    36
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
    37
    public static void main(String[] args) {
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
    38
        ChecksumBase.testAll(new CRC32C(), 0xE3069283L);
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
    39
    }
0a3fb0529425 6321472: Add CRC-32C API
sherman
parents:
diff changeset
    40
}