correct error code when tests fail