1 #include "platformtest.h"
2 #include "../../src/dataobjects/platform.h"
3 #include "../../src/dataobjects/emufrontfile.h"
5 Q_DECLARE_METATYPE(EmuFrontFile)
6 Q_DECLARE_METATYPE(Platform)
8 void PlatformTest::initTestCase()
10 qDebug() << "Initializing PlatformTest.";
11 EmuFrontFile *efile = new EmuFrontFile(1, "zzz.png", "2hxxxx", 2, 1);
14 void PlatformTest::cleanupTestCase()
16 qDebug() << "Cleaning up PlatformTest.";
20 void PlatformTest::equals_data()
22 QTest::addColumn<Platform>("platform1");
23 QTest::addColumn<Platform>("platform2");
24 QTest::newRow("id and name")
25 << Platform(1, "test", efile)
26 << Platform(1, "test", efile);
27 QTest::newRow("id, name and filename")
28 << Platform(2, "test", efile)
29 << Platform(2, "test", efile);
32 void PlatformTest::equals()
34 QFETCH(Platform, platform1);
35 QFETCH(Platform, platform2);
36 QVERIFY(platform1 == platform2);
39 /* Platforms are equal if the following fields match:
43 void PlatformTest::notEquals()
45 Platform p1(1, "testa", efile);
46 Platform p2(1, "test", efile);
47 // This should return true