diff --git a/src/sys.rs b/src/sys.rs index fdb3312..d97d586 100644 --- a/src/sys.rs +++ b/src/sys.rs @@ -595,69 +595,7 @@ pub struct SReceiveCallbackDataC { #[doc = "!< source write clock"] pub clock: ::std::os::raw::c_longlong, } -#[test] -fn bindgen_test_layout_SReceiveCallbackDataC() { - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(SReceiveCallbackDataC)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(SReceiveCallbackDataC)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).buf as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(SReceiveCallbackDataC), - "::", - stringify!(buf) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).size as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(SReceiveCallbackDataC), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).id as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(SReceiveCallbackDataC), - "::", - stringify!(id) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).time as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(SReceiveCallbackDataC), - "::", - stringify!(time) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).clock as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(SReceiveCallbackDataC), - "::", - stringify!(clock) - ) - ); -} + impl Default for SReceiveCallbackDataC { fn default() -> Self { unsafe { ::std::mem::zeroed() } @@ -691,49 +629,7 @@ pub struct SPubEventCallbackDataC { #[doc = "!< event clock"] pub clock: ::std::os::raw::c_longlong, } -#[test] -fn bindgen_test_layout_SPubEventCallbackDataC() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(SPubEventCallbackDataC)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(SPubEventCallbackDataC)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(SPubEventCallbackDataC), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).time as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(SPubEventCallbackDataC), - "::", - stringify!(time) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).clock as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(SPubEventCallbackDataC), - "::", - stringify!(clock) - ) - ); -} + impl Default for SPubEventCallbackDataC { fn default() -> Self { unsafe { ::std::mem::zeroed() } @@ -750,49 +646,7 @@ pub struct SSubEventCallbackDataC { #[doc = "!< event clock"] pub clock: ::std::os::raw::c_longlong, } -#[test] -fn bindgen_test_layout_SSubEventCallbackDataC() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(SSubEventCallbackDataC)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(SSubEventCallbackDataC)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(SSubEventCallbackDataC), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).time as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(SSubEventCallbackDataC), - "::", - stringify!(time) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).clock as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(SSubEventCallbackDataC), - "::", - stringify!(clock) - ) - ); -} + impl Default for SSubEventCallbackDataC { fn default() -> Self { unsafe { ::std::mem::zeroed() } @@ -851,49 +705,7 @@ pub struct SWriterQOSC { #[doc = "< qos reliability mode"] pub reliability: eQOSPolicy_ReliabilityC, } -#[test] -fn bindgen_test_layout_SWriterQOSC() { - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(SWriterQOSC)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(SWriterQOSC)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).history_kind as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(SWriterQOSC), - "::", - stringify!(history_kind) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).history_kind_depth as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(SWriterQOSC), - "::", - stringify!(history_kind_depth) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reliability as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(SWriterQOSC), - "::", - stringify!(reliability) - ) - ); -} + impl Default for SWriterQOSC { fn default() -> Self { unsafe { ::std::mem::zeroed() } @@ -910,49 +722,7 @@ pub struct SReaderQOSC { #[doc = "< qos reliability mode"] pub reliability: eQOSPolicy_ReliabilityC, } -#[test] -fn bindgen_test_layout_SReaderQOSC() { - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(SReaderQOSC)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(SReaderQOSC)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).history_kind as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(SReaderQOSC), - "::", - stringify!(history_kind) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).history_kind_depth as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(SReaderQOSC), - "::", - stringify!(history_kind_depth) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reliability as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(SReaderQOSC), - "::", - stringify!(reliability) - ) - ); -} + impl Default for SReaderQOSC { fn default() -> Self { unsafe { ::std::mem::zeroed() } @@ -1210,79 +980,7 @@ pub struct SServiceInfoC { #[doc = "!< service call state"] pub call_state: eCallState, } -#[test] -fn bindgen_test_layout_SServiceInfoC() { - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(SServiceInfoC)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(SServiceInfoC)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).host_name as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(SServiceInfoC), - "::", - stringify!(host_name) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).service_name as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(SServiceInfoC), - "::", - stringify!(service_name) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).method_name as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(SServiceInfoC), - "::", - stringify!(method_name) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).error_msg as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(SServiceInfoC), - "::", - stringify!(error_msg) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ret_state as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(SServiceInfoC), - "::", - stringify!(ret_state) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).call_state as *const _ as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(SServiceInfoC), - "::", - stringify!(call_state) - ) - ); -} + impl Default for SServiceInfoC { fn default() -> Self { unsafe { ::std::mem::zeroed() } @@ -1868,3 +1566,321 @@ extern "C" { topic_desc_len_: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } + + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn bindgen_test_layout_SReceiveCallbackDataC() { + assert_eq!( + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(SReceiveCallbackDataC)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(SReceiveCallbackDataC)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).buf as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(SReceiveCallbackDataC), + "::", + stringify!(buf) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).size as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(SReceiveCallbackDataC), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).id as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(SReceiveCallbackDataC), + "::", + stringify!(id) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).time as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(SReceiveCallbackDataC), + "::", + stringify!(time) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).clock as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(SReceiveCallbackDataC), + "::", + stringify!(clock) + ) + ); + } + + #[test] + fn bindgen_test_layout_SServiceInfoC() { + assert_eq!( + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(SServiceInfoC)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(SServiceInfoC)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).host_name as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(SServiceInfoC), + "::", + stringify!(host_name) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).service_name as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(SServiceInfoC), + "::", + stringify!(service_name) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).method_name as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(SServiceInfoC), + "::", + stringify!(method_name) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).error_msg as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(SServiceInfoC), + "::", + stringify!(error_msg) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ret_state as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(SServiceInfoC), + "::", + stringify!(ret_state) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).call_state as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(SServiceInfoC), + "::", + stringify!(call_state) + ) + ); + } + + #[test] + fn bindgen_test_layout_SReaderQOSC() { + assert_eq!( + ::std::mem::size_of::(), + 12usize, + concat!("Size of: ", stringify!(SReaderQOSC)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(SReaderQOSC)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).history_kind as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(SReaderQOSC), + "::", + stringify!(history_kind) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).history_kind_depth as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(SReaderQOSC), + "::", + stringify!(history_kind_depth) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reliability as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(SReaderQOSC), + "::", + stringify!(reliability) + ) + ); + } + #[test] + fn bindgen_test_layout_SWriterQOSC() { + assert_eq!( + ::std::mem::size_of::(), + 12usize, + concat!("Size of: ", stringify!(SWriterQOSC)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(SWriterQOSC)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).history_kind as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(SWriterQOSC), + "::", + stringify!(history_kind) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).history_kind_depth as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(SWriterQOSC), + "::", + stringify!(history_kind_depth) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reliability as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(SWriterQOSC), + "::", + stringify!(reliability) + ) + ); + } + + #[test] + fn bindgen_test_layout_SSubEventCallbackDataC() { + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(SSubEventCallbackDataC)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(SSubEventCallbackDataC)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(SSubEventCallbackDataC), + "::", + stringify!(type_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).time as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(SSubEventCallbackDataC), + "::", + stringify!(time) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).clock as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(SSubEventCallbackDataC), + "::", + stringify!(clock) + ) + ); + } + #[test] + fn bindgen_test_layout_SPubEventCallbackDataC() { + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(SPubEventCallbackDataC)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(SPubEventCallbackDataC)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(SPubEventCallbackDataC), + "::", + stringify!(type_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).time as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(SPubEventCallbackDataC), + "::", + stringify!(time) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).clock as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(SPubEventCallbackDataC), + "::", + stringify!(clock) + ) + ); + } +} \ No newline at end of file