The test is changed to check the output according to the number of available code segments. Reviewed-by: kvn