MCPcopy Create free account
hub / github.com/KDE/kwin / testOperatorMultiplyAssign

Method testOperatorMultiplyAssign

autotests/test_window_paint_data.cpp:97–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97void TestWindowPaintData::testOperatorMultiplyAssign()
98{
99 WindowPaintData data;
100 // without anything set, it's 1.0 on all axis
101 QCOMPARE(data.xScale(), 1.0);
102 QCOMPARE(data.yScale(), 1.0);
103 QCOMPARE(data.zScale(), 1.0);
104 // multiplying by a factor should set all components
105 data *= 2.0;
106 QCOMPARE(data.xScale(), 2.0);
107 QCOMPARE(data.yScale(), 2.0);
108 QCOMPARE(data.zScale(), 2.0);
109 // multiplying by a vector2D should set x and y components
110 data *= QVector2D(2.0, 3.0);
111 QCOMPARE(data.xScale(), 4.0);
112 QCOMPARE(data.yScale(), 6.0);
113 QCOMPARE(data.zScale(), 2.0);
114 // multiplying by a vector3d should set all components
115 data *= QVector3D(0.5, 1.5, 2.0);
116 QCOMPARE(data.xScale(), 2.0);
117 QCOMPARE(data.yScale(), 9.0);
118 QCOMPARE(data.zScale(), 4.0);
119}
120
121void TestWindowPaintData::testOperatorPlus()
122{

Callers

nothing calls this directly

Calls 4

xScaleMethod · 0.80
yScaleMethod · 0.80
zScaleMethod · 0.80
QVector3DClass · 0.50

Tested by

no test coverage detected