示例#1
0
void LedTests::copyConstructor() {
    QFETCH(Position, position);
    QFETCH(int, number);

    Led* led = new Led(iAnimation,
                  *iAnimation,
                  number,
                  position,
                  NULL);

    Led* copyLed = new Led(*led);

    QCOMPARE(copyLed->position(), led->position());
    QCOMPARE(copyLed->number(), led->number());

    // TODO add axis tests
}
示例#2
0
void LedTests::constructor() {
    QFETCH(Position, position);
    QFETCH(int, number);
    QFETCH(QString, error);

    try {
        Led* led = new Led(iAnimation,
                      *iAnimation,
                      number,
                      position,
                      NULL);

        QCOMPARE(led->position(), position);
        QCOMPARE(led->number(), number);

    } catch(IllegalArgumentException& e){
        QCOMPARE(e.errorMessage(), error);

        return;
    }
}