It looks like this part of the test is redundant -- the following loop tries to allocate each level with illegal values. This is OK though.