Storing and outputting test patterns