Code example for Adler32

Methods: getValue, reset, update

0
 
    /** 
     * @tests java.util.zip.Adler32#update(int) 
     */ 
    @TestTargetNew( 
        level = TestLevel.COMPLETE, 
        notes = "", 
        method = "update", 
        args = {int.class} 
    ) 
    public void test_updateI() { 
        // test methods of java.util.zip.update(int) 
        Adler32 adl = new Adler32();
        adl.update(1);
        // The value of the adl should be 131074 
        assertEquals(
                "update(int) failed to update the checksum to the correct value ", 
                131074, adl.getValue());
 
        adl.reset();
        adl.update(Integer.MAX_VALUE);
        // System.out.print("value of adl " + adl.getValue()); 
        // The value of the adl should be 16777472 
        assertEquals(