1 #include "platformtest.h"
4 void PlatformTest::init()
8 void PlatformTest::initTestCase()
12 void PlatformTest::cleanup()
16 void PlatformTest::cleanupTestCase()
20 /*void PlatformTest::equals_data()
22 qDebug() << "Arranging data for equals.";
24 QTest::addColumn<Platform>("platform1");
25 QTest::addColumn<Platform>("platform2");
26 qDebug() << "Done columns";
27 efA = new EmuFrontFile(1, "a", "qa", 1, 2);
28 efB = new EmuFrontFile(2, "b", "qaa", 2, 3);
29 qDebug() << "efA" << efA->getName();
30 qDebug() << "efB" << efB->getName();
32 QTest::newRow("id and name")
33 << Platform(1, "test", efA)
34 << Platform(1, "test", efB);
36 qDebug() << "Done first row";
37 efA = new EmuFrontFile(1, "a", "qa", 1, 2);
38 efB = new EmuFrontFile(2, "b", "qaa", 2, 3);
39 qDebug() << "efA" << efA->getName();
40 qDebug() << "efB" << efB->getName();
42 QTest::newRow("id, name and filename")
43 << Platform(2, "test", efA)
44 << Platform(2, "test", efB);
45 qDebug() << "Done 2nd row";
48 void PlatformTest::equals()
50 qDebug() << "Entering equals";
51 QFETCH(Platform, platform1);
52 QFETCH(Platform, platform2);
53 QVERIFY(platform1 == platform2);
54 qDebug() << "Leaving equals";
57 void PlatformTest::equals2()
59 qDebug() << "Starting equals2 test, creating EmuFrontFile objects to heap.";
60 EmuFrontFile *efA = new EmuFrontFile(1, "efA", "qa", 1, 2);
61 EmuFrontFile *efB = new EmuFrontFile(2, "efB", "qaa", 2, 3);
62 qDebug() << "Creating Platform test objects p1 and p2";
67 qDebug() << efB->getName();
69 qDebug() << "Creating Platform test objects p5 containg member " << efA->getName();
70 Platform p5(1, "p5", efA);
72 // The following should not be done, efA dies with p5:
73 // and pointer from p6 would keep pointing to memory area where
74 // efA no longer exists:
75 //Platform p6(1, "p6", efA);
77 qDebug() << "Creating Platform test objects p6 containg member " << efB->getName();
78 Platform p6(1, "p6", efB);
80 qDebug() << "efA" << efA->getName();
81 qDebug() << "efB" << efB->getName();
83 qDebug() << "Entering QVERIFY";
86 qDebug() << "efA" << efA->getName();
87 qDebug() << "efB" << efB->getName();
91 qDebug() << "efA" << efA->getName();
92 qDebug() << "efB" << efB->getName();
94 qDebug() << "Leaving QVERIFY";
95 qDebug() << "Leaving equals2";
98 /* Platforms are equal if the following fields match:
103 void PlatformTest::notEquals()
105 Platform p1(1, "testa");
106 Platform p2(1, "test");
107 // This should return true