it: test explicit sync
This commit is contained in:
parent
6448a14fb1
commit
3b0757ee53
22 changed files with 419 additions and 166 deletions
34
src/it/test_ifs/test_syncobj_timeline.rs
Normal file
34
src/it/test_ifs/test_syncobj_timeline.rs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
use {
|
||||
crate::{
|
||||
it::{test_error::TestError, test_object::TestObject, test_transport::TestTransport},
|
||||
wire::{wp_linux_drm_syncobj_timeline_v1::*, WpLinuxDrmSyncobjTimelineV1Id},
|
||||
},
|
||||
std::{cell::Cell, rc::Rc},
|
||||
};
|
||||
|
||||
pub struct TestSyncobjTimeline {
|
||||
pub id: WpLinuxDrmSyncobjTimelineV1Id,
|
||||
pub tran: Rc<TestTransport>,
|
||||
pub destroyed: Cell<bool>,
|
||||
}
|
||||
|
||||
impl TestSyncobjTimeline {
|
||||
pub fn destroy(&self) -> Result<(), TestError> {
|
||||
if !self.destroyed.replace(true) {
|
||||
self.tran.send(Destroy { self_id: self.id })?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for TestSyncobjTimeline {
|
||||
fn drop(&mut self) {
|
||||
let _ = self.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
test_object! {
|
||||
TestSyncobjTimeline, WpLinuxDrmSyncobjTimelineV1;
|
||||
}
|
||||
|
||||
impl TestObject for TestSyncobjTimeline {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue