update tests

This commit is contained in:
xianjimli 2019-08-17 08:28:50 +08:00
parent 098b215a63
commit aad61096d1
2 changed files with 3 additions and 3 deletions

View File

@ -119,10 +119,10 @@ static inline ret_t fragment_frame_buffer_write_data(fragment_frame_buffer_t* ff
ret_t ret = fragment_frame_buffer_set_pixel(ffb, x, y, pixel);
ffb->cursor_x++;
assert(ffb->cursor_y < ffb->win.h);
if (ffb->cursor_x >= ffb->win.w) {
ffb->cursor_x = 0;
ffb->cursor_y++;
assert(ffb->cursor_y < ffb->win.h);
}
return ret;

View File

@ -51,7 +51,7 @@ TEST(FragmentFrameBuffer, basic) {
fragment_frame_buffer_write_data(ffb, 6);
fragment_frame_buffer_end_frame(ffb);
ASSERT_EQ(s_log, "win(4 4 3 2):01 02 03 04 05 06 ");
ASSERT_EQ(s_log, "win(4 4 6 5):01 02 03 04 05 06 ");
}
TEST(FragmentFrameBuffer, not_large_enough) {
@ -100,5 +100,5 @@ TEST(FragmentFrameBuffer, set) {
fragment_frame_buffer_end_frame(ffb);
ASSERT_EQ(s_log, "win(4 4 3 2):01 02 03 04 05 06 ");
ASSERT_EQ(s_log, "win(4 4 6 5):01 02 03 04 05 06 ");
}