I want to run a few unit tests on my OpenGL application. Which cause me a few issue in the past (OpenGL draw difference between 2 computers) but now I know what I can and cannot do.
Here's a little test I wrote to check the rendering:
QImage display(grabFrameBuffer());
QImage wanted(PATH_TO_RESSOURCES + "/file_010.bmp");
int Qimage_width = display.width();
int Qimage_height = display.height();
for(int i = 1; i < Qimage_width; i++) {
for(int j = 1; j < Qimage_height; j++) {
if(QColor(display.pixel(i, j)).name() != QColor(wanted.pixel(i, j)).name()) {
qDebug() << "different pixel detected" << i << j;
}
}
}
QVERIFY(wanted == display);
The QVERIFY() fails but the message "different pixel detected" << i << j
is never shown.
If I compare the files with Photoshop (see photo.stackexchange), I can't find any different pixel. I'm kind of lost.
Edit : I'm using Qt 5.2 and if I change manually one pixel on file_010.bmp the error message "different pixel detected" << i << j
is displayed.