Code example for CRC32

Methods: getValue, reset, update

0
        crc.reset();
        assertEquals("reset failed to reset the checksum value to zero", 0, crc
                .getValue());
    } 
 
    /** 
     * @tests java.util.zip.CRC32#reset() 
     */ 
    @TestTargetNew( 
        level = TestLevel.COMPLETE, 
        notes = "", 
        method = "reset", 
        args = {} 
    ) 
    public void test_reset() { 
        // test methods of java.util.zip.crc32.reset() 
        CRC32 crc = new CRC32();
        crc.update(1);
        // System.out.print("value of crc"+crc.getValue()); 
        // Ran JDK and discovered that the value of the CRC should be 
        // 2768625435 
        assertEquals(
                "update(int) failed to update the checksum to the correct value ", 
                2768625435L, crc.getValue());
        crc.reset();
        assertEquals("reset failed to reset the checksum value to zero", 0, crc
                .getValue());
 
    } 
 
    /** 
     * @tests java.util.zip.CRC32#update(int) 
     */