Skip to content

Commit ea4340a

Browse files
committed
Fix touching color test
1 parent ab3d2a2 commit ea4340a

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

test/renderedtarget/renderedtarget_test.cpp

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,12 +1168,12 @@ TEST_F(RenderedTargetTest, TouchingColor)
11681168
EXPECT_CALL(target2, stageModel()).WillRepeatedly(Return(nullptr));
11691169
EXPECT_CALL(penLayer, getBounds()).WillRepeatedly(ReturnRef(penBounds));
11701170

1171-
static const Value color1 = 4286611711; // "purple"
1172-
static const Value color2 = 596083443; // close to color1 and transparent
1173-
static const Value color3 = "#808000"; // "olive" (4286611456)
1171+
static const QRgb color1 = 4286611711; // "purple"
1172+
static const QRgb color2 = 596083443; // close to color1 and transparent
1173+
static const Value color3 = "#808000"; // "olive" (4286611456)
11741174
static const QRgb color3Int = 4286611456;
1175-
static const Value color4 = 2505545047; // transparent "hippie green"
1176-
static const Value color5 = 4287417025; // color1 + color4
1175+
static const QRgb color4 = 2505545047; // transparent "hippie green"
1176+
static const QRgb color5 = 4287417025; // color1 + color4
11771177

11781178
EXPECT_CALL(stageTarget, getFastBounds()).WillOnce(Return(Rect(2, 1, 6, -5)));
11791179
EXPECT_CALL(target1, getFastBounds()).WillOnce(Return(Rect(2, 1, 6, -5)));
@@ -1184,19 +1184,19 @@ TEST_F(RenderedTargetTest, TouchingColor)
11841184
EXPECT_CALL(target2, colorAtScratchPoint(1, -2)).WillOnce(Return(color3Int));
11851185
EXPECT_CALL(target2, colorAtScratchPoint(3, -2)).WillOnce(Return(color3Int));
11861186
EXPECT_CALL(target2, colorAtScratchPoint(1, -1)).WillOnce(Return(color3Int));
1187-
EXPECT_CALL(target2, colorAtScratchPoint(2, -1)).WillOnce(Return(color4.toInt()));
1187+
EXPECT_CALL(target2, colorAtScratchPoint(2, -1)).WillOnce(Return(color4));
11881188
EXPECT_CALL(target1, colorAtScratchPoint(2, -1)).WillOnce(Return(color3Int));
1189-
EXPECT_CALL(target2, colorAtScratchPoint(3, -1)).WillOnce(Return(color4.toInt()));
1190-
EXPECT_CALL(target1, colorAtScratchPoint(3, -1)).WillOnce(Return(color4.toInt()));
1191-
EXPECT_CALL(penLayer, colorAtScratchPoint(3, -1)).WillOnce(Return(color4.toInt()));
1192-
EXPECT_CALL(stageTarget, colorAtScratchPoint(3, -1)).WillOnce(Return(color4.toInt()));
1189+
EXPECT_CALL(target2, colorAtScratchPoint(3, -1)).WillOnce(Return(color4));
1190+
EXPECT_CALL(target1, colorAtScratchPoint(3, -1)).WillOnce(Return(color4));
1191+
EXPECT_CALL(penLayer, colorAtScratchPoint(3, -1)).WillOnce(Return(color4));
1192+
EXPECT_CALL(stageTarget, colorAtScratchPoint(3, -1)).WillOnce(Return(color4));
11931193
ASSERT_FALSE(target.touchingColor(color1));
11941194

11951195
EXPECT_CALL(stageTarget, getFastBounds()).WillOnce(Return(Rect(2, 1, 6, -5)));
11961196
EXPECT_CALL(target1, getFastBounds()).WillOnce(Return(Rect(2, 1, 6, -5)));
11971197
EXPECT_CALL(target2, getFastBounds()).WillOnce(Return(Rect(-5, -1, 1, -8)));
11981198
EXPECT_CALL(target2, colorAtScratchPoint(1, -3)).WillOnce(Return(color3Int));
1199-
EXPECT_CALL(target2, colorAtScratchPoint(2, -3)).WillOnce(Return(color1.toInt()));
1199+
EXPECT_CALL(target2, colorAtScratchPoint(2, -3)).WillOnce(Return(color1));
12001200
ASSERT_TRUE(target.touchingColor(color1));
12011201

12021202
EXPECT_CALL(stageTarget, getFastBounds()).WillOnce(Return(Rect(5, 1, 6, -5)));
@@ -1207,7 +1207,7 @@ TEST_F(RenderedTargetTest, TouchingColor)
12071207
EXPECT_CALL(target2, colorAtScratchPoint(3, -3)).WillOnce(Return(color3Int));
12081208
EXPECT_CALL(target2, colorAtScratchPoint(1, -2)).WillOnce(Return(color3Int));
12091209
EXPECT_CALL(target2, colorAtScratchPoint(3, -2)).WillOnce(Return(color3Int));
1210-
EXPECT_CALL(target2, colorAtScratchPoint(1, -1)).WillOnce(Return(color4.toInt()));
1210+
EXPECT_CALL(target2, colorAtScratchPoint(1, -1)).WillOnce(Return(color4));
12111211
EXPECT_CALL(target1, colorAtScratchPoint(1, -1)).WillOnce(Return(color3Int));
12121212
EXPECT_CALL(target2, colorAtScratchPoint(2, -1)).WillOnce(Return(color3Int));
12131213
EXPECT_CALL(target2, colorAtScratchPoint(3, -1)).WillOnce(Return(color3Int));
@@ -1223,7 +1223,7 @@ TEST_F(RenderedTargetTest, TouchingColor)
12231223
EXPECT_CALL(target2, colorAtScratchPoint(3, -2)).WillOnce(Return(color3Int));
12241224
EXPECT_CALL(target2, colorAtScratchPoint(1, -1)).WillOnce(Return(color3Int));
12251225
EXPECT_CALL(target2, colorAtScratchPoint(2, -1)).WillOnce(Return(color3Int));
1226-
EXPECT_CALL(target2, colorAtScratchPoint(3, -1)).WillOnce(Return(color1.toInt()));
1226+
EXPECT_CALL(target2, colorAtScratchPoint(3, -1)).WillOnce(Return(color1));
12271227
ASSERT_TRUE(target.touchingColor(color2));
12281228

12291229
EXPECT_CALL(stageTarget, getFastBounds()).WillOnce(Return(Rect(2, 1, 6, -5)));
@@ -1236,15 +1236,15 @@ TEST_F(RenderedTargetTest, TouchingColor)
12361236
EXPECT_CALL(target2, colorAtScratchPoint(3, -2)).WillOnce(Return(color3Int));
12371237
EXPECT_CALL(target2, colorAtScratchPoint(1, -1)).WillOnce(Return(color3Int));
12381238
EXPECT_CALL(target2, colorAtScratchPoint(2, -1)).WillOnce(Return(color3Int));
1239-
EXPECT_CALL(target2, colorAtScratchPoint(3, -1)).WillOnce(Return(color4.toInt()));
1240-
EXPECT_CALL(target1, colorAtScratchPoint(3, -1)).WillOnce(Return(color1.toInt()));
1239+
EXPECT_CALL(target2, colorAtScratchPoint(3, -1)).WillOnce(Return(color4));
1240+
EXPECT_CALL(target1, colorAtScratchPoint(3, -1)).WillOnce(Return(color1));
12411241
ASSERT_FALSE(target.touchingColor(color1));
12421242

12431243
EXPECT_CALL(stageTarget, getFastBounds()).WillOnce(Return(Rect(2, 1, 6, -5)));
12441244
EXPECT_CALL(target1, getFastBounds()).WillOnce(Return(Rect(2, 1, 6, -5)));
12451245
EXPECT_CALL(target2, getFastBounds()).WillOnce(Return(Rect(-5, -6, 2, -8)));
1246-
EXPECT_CALL(target2, colorAtScratchPoint(1, -3)).WillOnce(Return(color4.toInt()));
1247-
EXPECT_CALL(target1, colorAtScratchPoint(1, -3)).WillOnce(Return(color1.toInt()));
1246+
EXPECT_CALL(target2, colorAtScratchPoint(1, -3)).WillOnce(Return(color4));
1247+
EXPECT_CALL(target1, colorAtScratchPoint(1, -3)).WillOnce(Return(color1));
12481248
ASSERT_TRUE(target.touchingColor(color5));
12491249

12501250
EXPECT_CALL(stageTarget, getFastBounds()).WillOnce(Return(Rect(5, 1, 6, -5)));
@@ -1260,8 +1260,8 @@ TEST_F(RenderedTargetTest, TouchingColor)
12601260
EXPECT_CALL(stageTarget, getFastBounds()).WillOnce(Return(Rect(2, 1, 6, -5)));
12611261
EXPECT_CALL(target1, getFastBounds()).WillOnce(Return(Rect(2, 1, 6, -5)));
12621262
EXPECT_CALL(target2, getFastBounds()).WillOnce(Return(Rect(-5, -6, 2, -8)));
1263-
EXPECT_CALL(target2, colorAtScratchPoint(3, -3)).WillOnce(Return(color4.toInt()));
1264-
EXPECT_CALL(target1, colorAtScratchPoint(3, -3)).WillOnce(Return(color1.toInt()));
1263+
EXPECT_CALL(target2, colorAtScratchPoint(3, -3)).WillOnce(Return(color4));
1264+
EXPECT_CALL(target1, colorAtScratchPoint(3, -3)).WillOnce(Return(color1));
12651265
ASSERT_TRUE(target.touchingColor(color5, color3));
12661266

12671267
EXPECT_CALL(stageTarget, getFastBounds()).WillOnce(Return(Rect(5, 1, 6, -5)));
@@ -1278,8 +1278,8 @@ TEST_F(RenderedTargetTest, TouchingColor)
12781278
EXPECT_CALL(stageTarget, getFastBounds()).WillOnce(Return(Rect(2, 1, 6, -5)));
12791279
EXPECT_CALL(target1, getFastBounds()).WillOnce(Return(Rect(2, 1, 6, -5)));
12801280
EXPECT_CALL(target2, getFastBounds()).WillOnce(Return(Rect(-5, -6, 2, -8)));
1281-
EXPECT_CALL(target2, colorAtScratchPoint(3, -3)).WillOnce(Return(color4.toInt()));
1282-
EXPECT_CALL(target1, colorAtScratchPoint(3, -3)).WillOnce(Return(color1.toInt()));
1281+
EXPECT_CALL(target2, colorAtScratchPoint(3, -3)).WillOnce(Return(color4));
1282+
EXPECT_CALL(target1, colorAtScratchPoint(3, -3)).WillOnce(Return(color1));
12831283
ASSERT_TRUE(target.touchingColor(color5, color3));
12841284
ASSERT_EQ(target.graphicEffects().at(ShaderManager::Effect::Ghost), 100);
12851285

0 commit comments

Comments
 (0)