Test decode function