Based on my previous question here my new concern is how do I unit test my drawing code?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is not the ultimate answer but basically, you can test you drawing code by splitting it into small chunk functions, some of which probably have a testable results (not an image).
For the functions that work directly on rendering, there is not much choice to write them and check their output visually the first time.
Once you have a reference output, you can use it as input to your tests, and check that your functions continues to produce your reference output as your function evolves. Of course, the simpler your function, the better you can check its output and see what’s wrong.
It’s not really UnitTesting, but that’s good testing anyway.