TEST_F(UtSurfaceQueue, AddDequeueCbSuccess)
{
- tbm_surface_queue_dequeue(queue, &surface);
- tbm_surface_queue_enqueue(queue, surface);
- tbm_surface_queue_acquire(queue, &surface);
-
/* test */
- result = tbm_surface_queue_add_dequeuable_cb(queue, tbm_surface_queue_event_handler, &cb_data);
+ result = tbm_surface_queue_add_dequeue_cb(queue, tbm_surface_queue_event_handler, &cb_data);
ASSERT_EQ(TBM_SURFACE_QUEUE_ERROR_NONE, result);
cb_data = 0;
- result = tbm_surface_queue_release(queue, surface);
+ result = tbm_surface_queue_dequeue(queue, &surface);
ASSERT_EQ(TBM_SURFACE_QUEUE_ERROR_NONE, result);
ASSERT_TRUE(cb_data == 1);
}
TEST_F(UtSurfaceQueue, RemoveDequeueCbSuccess)
{
- tbm_surface_queue_dequeue(queue, &surface);
- tbm_surface_queue_enqueue(queue, surface);
- tbm_surface_queue_acquire(queue, &surface);
-
/* test */
- result = tbm_surface_queue_add_dequeuable_cb(queue, tbm_surface_queue_event_handler, &cb_data);
+ result = tbm_surface_queue_add_dequeue_cb(queue, tbm_surface_queue_event_handler, &cb_data);
ASSERT_EQ(TBM_SURFACE_QUEUE_ERROR_NONE, result);
+ cb_data = 0;
+ result = tbm_surface_queue_dequeue(queue, &surface);
+ ASSERT_EQ(TBM_SURFACE_QUEUE_ERROR_NONE, result);
+ ASSERT_TRUE(cb_data == 1);
+
result = tbm_surface_queue_remove_dequeue_cb(queue, tbm_surface_queue_event_handler, &cb_data);
ASSERT_EQ(TBM_SURFACE_QUEUE_ERROR_NONE, result);
cb_data = 0;
- result = tbm_surface_queue_release(queue, surface);
+ result = tbm_surface_queue_dequeue(queue, &surface);
ASSERT_EQ(TBM_SURFACE_QUEUE_ERROR_NONE, result);
ASSERT_TRUE(cb_data == 0);
}