Test of length calculation