Playing around with qtestlibs data driven testing (Added MediaTypeTest
[emufront] / testing / EmuFrontTesting / mediatypetest.cpp
1 #include "mediatypetest.h"
2
3 void MediaTypeTest::equals_data()
4 {
5     qDebug() << "equals_data() starting.";
6     QTest::addColumn<MediaType>("mt1");
7     QTest::addColumn<MediaType>("mt2");
8
9     qDebug() << "Adding row 1 with id and name parameters.";
10
11     QTest::newRow("id and name")
12         << MediaType(1, "Cartridge")
13         << MediaType(1, "Cartridge");
14
15     qDebug() << "Adding row 2 with id, name and EmuFrontFile object";
16
17     QTest::newRow("id, name and EmuFrontFile object")
18         << MediaType(2, "Disk", new EmuFrontFile(1, "test", "000", 1, 1))
19         << MediaType(2, "Disk", new EmuFrontFile(1, "test", "000", 1, 1));
20
21     qDebug() << "equals_data() finishing.";
22 }
23
24 void MediaTypeTest::equals()
25 {
26     qDebug() << "Entering equals";
27     QFETCH(MediaType, mt1);
28     QFETCH(MediaType, mt2);
29     QVERIFY(mt1 == mt2);
30     qDebug() << "Leaving equals";
31 }