1 // Copyright (c) 2016 The vulkano developers 2 // Licensed under the Apache License, Version 2.0 3 // <LICENSE-APACHE or 4 // https://www.apache.org/licenses/LICENSE-2.0> or the MIT 5 // license <LICENSE-MIT or https://opensource.org/licenses/MIT>, 6 // at your option. All files in the project carrying such 7 // notice may not be copied, modified, or distributed except 8 // according to those terms. 9 10 pub use crate::extensions::{ExtensionRestriction, ExtensionRestrictionError}; 11 12 // Generated by build.rs 13 include!(concat!(env!("OUT_DIR"), "/device_extensions.rs")); 14 15 #[cfg(test)] 16 mod tests { 17 use crate::device::DeviceExtensions; 18 use std::ffi::CString; 19 20 #[test] empty_extensions()21 fn empty_extensions() { 22 let d: Vec<CString> = (&DeviceExtensions::empty()).into(); 23 assert!(d.get(0).is_none()); 24 } 25 26 #[test] into_iter()27 fn into_iter() { 28 let extensions = DeviceExtensions { 29 khr_swapchain: true, 30 ..DeviceExtensions::empty() 31 }; 32 for (name, enabled) in extensions { 33 if name == "VK_KHR_swapchain" { 34 assert!(enabled); 35 } else { 36 assert!(!enabled); 37 } 38 } 39 } 40 } 41