Merge lp:~aacid/unity-2d/temp_disable_pointer_barrier_test into lp:unity-2d

Proposed by Albert Astals Cid
Status: Merged
Approved by: Michał Sawicz
Approved revision: 972
Merged at revision: 972
Proposed branch: lp:~aacid/unity-2d/temp_disable_pointer_barrier_test
Merge into: lp:unity-2d
Diff against target: 71 lines (+27/-27)
1 file modified
libunity-2d-private/tests/pointerbarriertest.cpp (+27/-27)
To merge this branch: bzr merge lp:~aacid/unity-2d/temp_disable_pointer_barrier_test
Reviewer Review Type Date Requested Status
Michał Sawicz Approve
Review via email: mp+96985@code.launchpad.net

Description of the change

[tests] Workaround x getting confused by a test by moving the test to be the last one

To post a comment you must log in.
972. By Albert Astals Cid

Workaround x getting confused by a test by moving the test to be the last one

Revision history for this message
Michał Sawicz (saviq) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libunity-2d-private/tests/pointerbarriertest.cpp'
2--- libunity-2d-private/tests/pointerbarriertest.cpp 2012-03-02 10:39:07 +0000
3+++ libunity-2d-private/tests/pointerbarriertest.cpp 2012-03-12 10:19:19 +0000
4@@ -90,33 +90,6 @@
5 QCOMPARE(triggeredSpy.count(), 0);
6 }
7
8- void testStopArea()
9- {
10- Display *display = QX11Info::display();
11- PointerBarrierWrapper barrier;
12-
13- QSignalSpy brokenSpy(&barrier, SIGNAL(broken()));
14- QSignalSpy triggeredSpy(&barrier, SIGNAL(triggered()));
15-
16- XTestFakeMotionEvent(display, -1, 50, 150, 0);
17- QCOMPARE(QCursor::pos(), QPoint(50, 150));
18-
19- barrier.setP1(QPointF(100, 0));
20- barrier.setP2(QPointF(100, 100));
21- barrier.setThreshold(6500);
22- barrier.setMaxVelocityMultiplier(2);
23- barrier.setDecayRate(1500);
24- barrier.setBreakPressure(2000);
25-
26- XTestFakeRelativeMotionEvent(display, 300, 0, 0);
27- // We are not stopped by the barrier because it's above us
28- // and are in 350, 150
29- QCOMPARE(QCursor::pos(), QPoint(350, 150));
30-
31- QCOMPARE(brokenSpy.count(), 0);
32- QCOMPARE(triggeredSpy.count(), 0);
33- }
34-
35 void testTrigger()
36 {
37 Display *display = QX11Info::display();
38@@ -305,6 +278,33 @@
39 QCOMPARE(brokenSpy.count(), 2);
40 QCOMPARE(triggeredSpy.count(), 1);
41 }
42+
43+ void testStopArea()
44+ {
45+ Display *display = QX11Info::display();
46+ PointerBarrierWrapper barrier;
47+
48+ QSignalSpy brokenSpy(&barrier, SIGNAL(broken()));
49+ QSignalSpy triggeredSpy(&barrier, SIGNAL(triggered()));
50+
51+ XTestFakeMotionEvent(display, -1, 50, 150, 0);
52+ QCOMPARE(QCursor::pos(), QPoint(50, 150));
53+
54+ barrier.setP1(QPointF(100, 0));
55+ barrier.setP2(QPointF(100, 100));
56+ barrier.setThreshold(6500);
57+ barrier.setMaxVelocityMultiplier(2);
58+ barrier.setDecayRate(1500);
59+ barrier.setBreakPressure(2000);
60+
61+ XTestFakeRelativeMotionEvent(display, 300, 0, 0);
62+ // We are not stopped by the barrier because it's above us
63+ // and are in 350, 150
64+ QCOMPARE(QCursor::pos(), QPoint(350, 150));
65+
66+ QCOMPARE(brokenSpy.count(), 0);
67+ QCOMPARE(triggeredSpy.count(), 0);
68+ }
69 };
70
71 UAPP_TEST_MAIN(PointerBarrierTest)

Subscribers

People subscribed via source and target branches