Tests for the hamming distance