예제 #1
0
void test_ImageOverlay::split_ShouldReturnExpectedResults_data()
{
    QList<ImageOverlay> overlays = ImageOverlayTestHelper::createImageOverlays();
    QList< QList<ImageOverlay> > overlaysSubOverlays = ImageOverlayTestHelper::createSubOverlays();

    QTest::addColumn<ImageOverlay>("overlay");
    QTest::addColumn< QList<ImageOverlay> >("subOverlays");

    ImageOverlay overlay;

    QTest::newRow("invalid overlay") << overlay << QList<ImageOverlay>();

    overlay.setRows(128);
    overlay.setColumns(128);
    overlay.setData(new unsigned char[128 * 128]);
    memset(overlay.getData(), 0, 128 * 128 * sizeof(unsigned char));
    QTest::newRow("empty overlay") << overlay << QList<ImageOverlay>();

    QTest::newRow("overlay #1") << overlays[0] << overlaysSubOverlays[0];
    // overlays[1] és per quan no optimitzem per potències de 2
    //QTest::newRow("overlay #2") << overlays[1] << overlaysSubOverlays[1];
    QTest::newRow("overlay #3") << overlays[2] << overlaysSubOverlays[2];
    QTest::newRow("overlay #4") << overlays[3] << overlaysSubOverlays[3];
    // overlays[4] és per quan sí optimitzem per potències de 2
    QTest::newRow("overlay #5") << overlays[4] << overlaysSubOverlays[4];
}
예제 #2
0
void test_ImageOverlay::ImageOverlay_InitializesClassAsExpected()
{
    ImageOverlay overlay;
    QCOMPARE(overlay.getRows(), 0);
    QCOMPARE(overlay.getColumns(), 0);
    QCOMPARE(overlay.getXOrigin(), 1);
    QCOMPARE(overlay.getYOrigin(), 1);
    unsigned char *nullUCharPointer = 0;
    QCOMPARE(overlay.getData(), nullUCharPointer);
}