@@ -299,7 +299,7 @@ TEST_F(RenderedTargetTest, DeinitClone)
299299 ASSERT_EQ (mouseArea.draggedSprite (), nullptr );
300300}
301301
302- TEST_F (RenderedTargetTest, HullPoints )
302+ TEST_F (RenderedTargetTest, CpuRendering )
303303{
304304 EngineMock engine;
305305 Sprite sprite;
@@ -392,6 +392,28 @@ TEST_F(RenderedTargetTest, HullPoints)
392392 ASSERT_TRUE (target.containsScratchPoint (-224.5 , 162 )); // [3, 3]
393393 ASSERT_FALSE (target.containsScratchPoint (-224.2 , 161.5 )); // [3.3, 3.5]
394394
395+ // Test colorAtScratchPoint()
396+ ASSERT_EQ (target.colorAtScratchPoint (-227.5 , 165 ), 0 ); // [0, 0]
397+ ASSERT_EQ (target.colorAtScratchPoint (-226.5 , 165 ), 0 ); // [1, 0]
398+ ASSERT_EQ (target.colorAtScratchPoint (-225.5 , 165 ), 0 ); // [2, 0]
399+ ASSERT_EQ (target.colorAtScratchPoint (-224.5 , 165 ), 0 ); // [3, 0]
400+
401+ ASSERT_EQ (target.colorAtScratchPoint (-227.5 , 164 ), 0 ); // [0, 1]
402+ ASSERT_EQ (target.colorAtScratchPoint (-226.5 , 164 ), 4278190335 ); // [1, 1]
403+ ASSERT_EQ (target.colorAtScratchPoint (-226.1 , 163.75 ), 4278255615 ); // [1.4, 1.25]
404+ ASSERT_EQ (target.colorAtScratchPoint (-225.5 , 164 ), 4294902015 ); // [2, 1]
405+ ASSERT_EQ (target.colorAtScratchPoint (-224.5 , 164 ), 4294934656 ); // [3, 1]
406+
407+ ASSERT_EQ (target.colorAtScratchPoint (-226.5 , 163 ), 4278190208 ); // [1, 2]
408+ ASSERT_EQ (target.colorAtScratchPoint (-225.5 , 163 ), 0 ); // [2, 2]
409+ ASSERT_EQ (target.colorAtScratchPoint (-224.5 , 163 ), 2505545047 ); // [3, 2]
410+ ASSERT_EQ (target.colorAtScratchPoint (-224 , 162.9 ), 9764864 ); // [3.5, 2.1]
411+
412+ ASSERT_EQ (target.colorAtScratchPoint (-226.5 , 162 ), 4286578816 ); // [1, 3]
413+ ASSERT_EQ (target.colorAtScratchPoint (-225.5 , 162 ), 4286611711 ); // [2, 3]
414+ ASSERT_EQ (target.colorAtScratchPoint (-224.5 , 162 ), 4286611456 ); // [3, 3]
415+ ASSERT_EQ (target.colorAtScratchPoint (-224.2 , 161.5 ), 0 ); // [3.3, 3.5]
416+
395417 // Cleanup
396418 context.doneCurrent ();
397419}
0 commit comments