Merge lp:~zeller-benjamin/ubuntu-ui-toolkit/mathutils_dont_warn into lp:ubuntu-ui-toolkit/staging

Proposed by Benjamin Zeller
Status: Merged
Approved by: Cris Dywan
Approved revision: 1734
Merged at revision: 1737
Proposed branch: lp:~zeller-benjamin/ubuntu-ui-toolkit/mathutils_dont_warn
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 78 lines (+0/-15)
2 files modified
src/Ubuntu/Components/plugin/ucmathutils.cpp (+0/-1)
tests/unit/tst_components/tst_math_utils.qml (+0/-14)
To merge this branch: bzr merge lp:~zeller-benjamin/ubuntu-ui-toolkit/mathutils_dont_warn
Reviewer Review Type Date Requested Status
Cris Dywan Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+279243@code.launchpad.net

Commit message

Fix Bug lp:1520557 "MathUtils.clamp, min value should not be bigger than the max value"

Description of the change

Fix Bug lp:1520557 "MathUtils.clamp, min value should not be bigger than the max value"

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Cris Dywan (kalikiana) wrote :

Niiiiiice.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Ubuntu/Components/plugin/ucmathutils.cpp'
2--- src/Ubuntu/Components/plugin/ucmathutils.cpp 2015-11-20 07:29:06 +0000
3+++ src/Ubuntu/Components/plugin/ucmathutils.cpp 2015-12-02 11:43:04 +0000
4@@ -40,7 +40,6 @@
5 return qBound(min, x, max);
6 } else {
7 // swap min/max if min > max
8- qWarning()<<"MathUtils.clamp, min value should not be bigger than the max value";
9 return qBound(max, x, min);
10 }
11 }
12
13=== modified file 'tests/unit/tst_components/tst_math_utils.qml'
14--- tests/unit/tst_components/tst_math_utils.qml 2015-11-20 07:38:55 +0000
15+++ tests/unit/tst_components/tst_math_utils.qml 2015-12-02 11:43:04 +0000
16@@ -89,8 +89,6 @@
17 var maxValue = 9
18 var clampValue = -7
19
20- ignoreWarning("MathUtils.clamp, min value should not be bigger than the max value")
21-
22 var clamped = MathUtils.clamp(clampValue, minValue, maxValue)
23 compare(clamped, maxValue, "clamped value not within range")
24 }
25@@ -100,8 +98,6 @@
26 var maxValue = 9
27 var clampValue = 111
28
29- ignoreWarning("MathUtils.clamp, min value should not be bigger than the max value")
30-
31 var clamped = MathUtils.clamp(clampValue, minValue, maxValue)
32 compare(clamped, minValue, "clamped value not within range")
33 }
34@@ -111,8 +107,6 @@
35 var maxValue = 9
36 var clampValue = 42
37
38- ignoreWarning("MathUtils.clamp, min value should not be bigger than the max value")
39-
40 var clamped = MathUtils.clamp(clampValue, minValue, maxValue)
41 compare(clamped, clampValue, "clamped value changed even though it shouldn't have")
42 }
43@@ -122,8 +116,6 @@
44 var maxValue = 9
45 var clampValue = 9
46
47- ignoreWarning("MathUtils.clamp, min value should not be bigger than the max value")
48-
49 var clamped = MathUtils.clamp(clampValue, minValue, maxValue)
50 compare(clamped, clampValue, "clamped value changed even though it shouldn't have")
51 }
52@@ -133,8 +125,6 @@
53 var maxValue = -42
54 var clampValue = -50
55
56- ignoreWarning("MathUtils.clamp, min value should not be bigger than the max value")
57-
58 var clamped = MathUtils.clamp(clampValue, minValue, maxValue)
59 compare(clamped, maxValue, "clamped value not within range")
60 }
61@@ -144,8 +134,6 @@
62 var maxValue = -42
63 var clampValue = 50
64
65- ignoreWarning("MathUtils.clamp, min value should not be bigger than the max value")
66-
67 var clamped = MathUtils.clamp(clampValue, minValue, maxValue)
68 compare(clamped, minValue, "clamped value not within range")
69 }
70@@ -155,8 +143,6 @@
71 var maxValue = -42
72 var clampValue = 50
73
74- ignoreWarning("MathUtils.clamp, min value should not be bigger than the max value")
75-
76 var clamped = MathUtils.clamp(clampValue, minValue, maxValue)
77 compare(clamped, minValue, "clamped value not within range")
78 }

Subscribers

People subscribed via source and target branches