45
45
QTest::addColumn<QPoint>("p2");
46
46
QTest::addColumn<double>("result");
48
QTest::newRow("empty") << QPoint() << QPoint() << 0.0;
49
QTest::newRow("invalid") << QPoint(-1,-3) << QPoint(2,2) << 0.0;
50
QTest::newRow("p1=p2") << QPoint(10,10) << QPoint(10,10) << 0.0;
51
QTest::newRow("p1.x=p2.x") << QPoint(10,10) << QPoint(200,10) << 0.0;
52
QTest::newRow("p1.y=p2.y") << QPoint(10,10) << QPoint(10,200) << 90.0;
53
QTest::newRow("-45 degrees") << QPoint(10,10) << QPoint(20,20) << -45.0;
54
QTest::newRow("45 degrees") << QPoint(10,20) << QPoint(20,10) << 45.0;
55
QTest::newRow("28.82 degrees") << QPoint(0,241) << QPoint(438,0) << 28.82;
56
QTest::newRow("-28.82 degrees") << QPoint(0,0) << QPoint(438,241) << -28.82;
48
QTest::newRow("empty")
53
QTest::newRow("invalid")
58
QTest::newRow("p1=p2")
63
QTest::newRow("p1.x=p2.x")
68
QTest::newRow("p1.y=p2.y")
73
QTest::newRow("-45 degrees")
78
QTest::newRow("45 degrees")
83
QTest::newRow("28.82 degrees")
88
QTest::newRow("-28.82 degrees")
58
93
// point layout shouldn't matter
61
QTest::newRow("layout1") << p1 << p2 << 45.0;
62
QTest::newRow("layout2") << p2 << p1 << 45.0;
97
QTest::newRow("layout1")
102
QTest::newRow("layout2")
65
108
void FreeRotationTest::testCalculateAngle()