Skip to content

Commit 0915101

Browse files
ids1024cmeissl
authored andcommitted
Add unit test to check for Send/Sync impls
1 parent d8bd950 commit 0915101

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

pixman/src/lib.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,20 @@ pub fn sample_ceil_y(y: impl Into<Fixed>, bpp: i32) -> Fixed {
163163
pub fn sample_floor_y(y: impl Into<Fixed>, bpp: i32) -> Fixed {
164164
Fixed::from_raw(unsafe { ffi::pixman_sample_floor_y(y.into().into_raw(), bpp) })
165165
}
166+
167+
#[cfg(all(test, feature = "sync"))]
168+
mod test {
169+
use super::*;
170+
171+
fn is_send_and_sync<T: Send + Sync>() {}
172+
173+
#[test]
174+
fn test_send_sync() {
175+
is_send_and_sync::<Image<'static, 'static>>();
176+
is_send_and_sync::<ImageRef>();
177+
is_send_and_sync::<LinearGradient>();
178+
is_send_and_sync::<RadialGradient>();
179+
is_send_and_sync::<ConicalGradient>();
180+
is_send_and_sync::<Solid>();
181+
}
182+
}

0 commit comments

Comments
 (0)