Example #1
0
void LedTests::addTimeAxis() {
    iAnimation->addTimeAxis(0, 100, 100, kPriorityLow, false);

    Led* led = new Led(iAnimation,
                       *iAnimation,
                       1,
                       Position(0,0),
                       NULL);

    led->addTimeAxis();

    QVERIFY(led->timeAxis() != NULL);
}
Example #2
0
void LedTests::addValueAxis() {
    QFETCH(int, numValueAxes);
    QFETCH(bool, addTimeAxis);
    QFETCH(int, currentFrameNum);

    Led* led = new Led(iAnimation,
                       *iAnimation,
                       1,
                       Position(0,0),
                       NULL);

    /*if(addTimeAxis) {
        led->addTimeAxis();
    }*/



    if(addTimeAxis) {
        iAnimation->addTimeAxis(0, 100, 100, kPriorityLow, false);
        //iAnimation->timeAxis()->setCurrentFrame(currentFrameNum);
    }

    for(int i = 0; i < numValueAxes; i++) {
        iAnimation->addValueAxis(-10, 10, 0, kPriorityLow, false);
    }

    for(int i = 0; i < numValueAxes; i++) {
        //led->addValueAxis(i);

        QCOMPARE(led->axisAt(i).axis().lowValue(), iAnimation->axisAt(i).lowValue());
        QCOMPARE(led->axisAt(i).axis().highValue(), iAnimation->axisAt(i).highValue());
        QCOMPARE(led->axisAt(i).axis().zeroValue(), iAnimation->axisAt(i).zeroValue());
        QCOMPARE(led->axisAt(i).axis().priority(), iAnimation->axisAt(i).priority());
        QCOMPARE(led->axisAt(i).axis().isOpaque(), iAnimation->axisAt(i).isOpaque());

        if(addTimeAxis) {
            ValueAxisData& axis = led->axisAt(i);

            QCOMPARE(static_cast<const LinkedValue&>(axis.frameAt(axis.axis().zeroValue()).value()).colour(),
                    static_cast<const ColourValue&>(led->timeAxis()->currentFrame().value()).colour());
        }
    }
}