Changeset 3579
- Timestamp:
- Jul 26, 2009, 6:20:20 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/tests/dirty.cpp
r3567 r3579 28 28 CPPUNIT_TEST(test_put_char_dirty); 29 29 CPPUNIT_TEST(test_put_char_not_dirty); 30 CPPUNIT_TEST(test_simplify); 30 31 CPPUNIT_TEST(test_box); 31 32 CPPUNIT_TEST(test_blit); … … 173 174 } 174 175 176 void test_simplify() 177 { 178 caca_canvas_t *cv; 179 int dx, dy, dw, dh; 180 181 cv = caca_create_canvas(WIDTH, HEIGHT); 182 183 /* Check that N adjacent blits only create one dirty rectangle */ 184 caca_clear_dirty_rect_list(cv); 185 for(int i = 0; i < 10; i++) 186 { 187 caca_put_char(cv, 7 + i, 3, '-'); 188 189 CPPUNIT_ASSERT_EQUAL(1, caca_get_dirty_rect_count(cv)); 190 caca_get_dirty_rect(cv, 0, &dx, &dy, &dw, &dh); 191 CPPUNIT_ASSERT_EQUAL(7, dx); 192 CPPUNIT_ASSERT_EQUAL(3, dy); 193 CPPUNIT_ASSERT_EQUAL(1 + i, dw); 194 CPPUNIT_ASSERT_EQUAL(1, dh); 195 } 196 197 /* Check that N adjacent blits only create one dirty rectangle */ 198 caca_clear_dirty_rect_list(cv); 199 for(int j = 0; j < 10; j++) 200 { 201 caca_put_char(cv, 7, 3 + j, '|'); 202 203 CPPUNIT_ASSERT_EQUAL(1, caca_get_dirty_rect_count(cv)); 204 caca_get_dirty_rect(cv, 0, &dx, &dy, &dw, &dh); 205 CPPUNIT_ASSERT_EQUAL(7, dx); 206 CPPUNIT_ASSERT_EQUAL(3, dy); 207 CPPUNIT_ASSERT_EQUAL(1, dw); 208 CPPUNIT_ASSERT_EQUAL(1 + j, dh); 209 } 210 } 211 175 212 void test_box() 176 213 {
Note: See TracChangeset
for help on using the changeset viewer.