From b3743ace7b420fdc2110452349be3d8d6f8510bf Mon Sep 17 00:00:00 2001 From: jabu Date: Wed, 15 Feb 2023 22:21:22 -0600 Subject: [PATCH] test dropping skins --- src/skin.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/skin.rs b/src/skin.rs index 26f6a3f..bf9d13f 100644 --- a/src/skin.rs +++ b/src/skin.rs @@ -139,3 +139,18 @@ pub struct AttachmentEntry { pub slot_index: i32, pub attachment: Attachment, } + +#[cfg(test)] +mod test { + use crate::test::TestAsset; + + use super::*; + + /// Check that dropped skins don't segfault. + #[test] + fn skin_drop() { + let (skeleton, _) = TestAsset::spineboy().instance(); + drop(skeleton.data().default_skin()); + drop(Skin::new("test")); + } +}