Let’s say I am writing custom JUCE components and I’d like to unit-test them. For example, I have a component that just draws a rectangle filled with a colour.
Now I’d like to write a unit test checking that it indeed draws a rectangle filled with a colour. How would I do this? Is there a way I can mock juce::Graphics and substitute it with a class that checks what’s being drawn by the component in paint()?
EDIT: or did you mean, how to compare the image with the expected image?
I am not aware of that kind of image processing being available in JUCE. Would be a nice addition though…
The interesting figures would be probably the RMS of pixels, number of not equal pixels…