~ubuntu-branches/ubuntu/vivid/digikam/vivid

« back to all changes in this revision

Viewing changes to core/tests/freerotationtest.cpp

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2012-02-14 19:29:29 UTC
  • mfrom: (1.2.38) (3.1.16 experimental)
  • Revision ID: package-import@ubuntu.com-20120214192929-cx2zia3b2nt67lvz
Tags: 4:2.5.0-1ubuntu1
* Merge from debian unstable, remaining changes:
  - keep seperate binary packages:
    + libkface1, libkface-data, libkface-dev
    + libkgeomap1, libkgeomap-data, libkgeomap-dev
    + libvkontakte1, libkvkontakte-dev
    + libmediawiki1, libmediawiki-dev
  - keep patches:
    + kubuntu_mysqld_executable_name.diff
  - don't fail on missing files in dh_install
  - install oxygen icons for kipi-plugins
  - build-depend on mysql 5.5 instead of 5.1
  - update install files
* digikam breaks/replaces kipi-plugins-common << 4:2.5.0~
* digikam-doc breaks/replaces digikam-data << 4:2.5.0~
* digikam-data breaks/replaces kipi-plugins << 4:2.5.0~
* kipi-plugins-common breaks/replaces kipi-plugins << 4:2.5.0~

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
    QTest::addColumn<QPoint>("p2");
46
46
    QTest::addColumn<double>("result");
47
47
 
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")
 
49
            << QPoint()
 
50
            << QPoint()
 
51
            << 0.0;
 
52
 
 
53
    QTest::newRow("invalid")
 
54
            << QPoint(-1, -3)
 
55
            << QPoint(2, 2)
 
56
            << 0.0;
 
57
 
 
58
    QTest::newRow("p1=p2")
 
59
            << QPoint(10, 10)
 
60
            << QPoint(10, 10)
 
61
            << 0.0;
 
62
 
 
63
    QTest::newRow("p1.x=p2.x")
 
64
            << QPoint(10, 10)
 
65
            << QPoint(200, 10)
 
66
            << 0.0;
 
67
 
 
68
    QTest::newRow("p1.y=p2.y")
 
69
            << QPoint(10, 10)
 
70
            << QPoint(10, 200)
 
71
            << 90.0;
 
72
 
 
73
    QTest::newRow("-45 degrees")
 
74
            << QPoint(10, 10)
 
75
            << QPoint(20, 20)
 
76
            << -45.0;
 
77
 
 
78
    QTest::newRow("45 degrees")
 
79
            << QPoint(10, 20)
 
80
            << QPoint(20, 10)
 
81
            << 45.0;
 
82
 
 
83
    QTest::newRow("28.82 degrees")
 
84
            << QPoint(0, 241)
 
85
            << QPoint(438, 0)
 
86
            << 28.82;
 
87
 
 
88
    QTest::newRow("-28.82 degrees")
 
89
            << QPoint(0, 0)
 
90
            << QPoint(438, 241)
 
91
            << -28.82;
57
92
 
58
93
    // point layout shouldn't matter
59
 
    QPoint p1(10,20);
60
 
    QPoint p2(20,10);
61
 
    QTest::newRow("layout1") << p1 << p2 << 45.0;
62
 
    QTest::newRow("layout2") << p2 << p1 << 45.0;
 
94
    QPoint p1(10, 20);
 
95
    QPoint p2(20, 10);
 
96
 
 
97
    QTest::newRow("layout1")
 
98
            << p1
 
99
            << p2
 
100
            << 45.0;
 
101
 
 
102
    QTest::newRow("layout2")
 
103
            << p2
 
104
            << p1
 
105
            << 45.0;
63
106
}
64
107
 
65
108
void FreeRotationTest::testCalculateAngle()