Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr committed Dec 12, 2024
1 parent ed18c6f commit fa58420
Show file tree
Hide file tree
Showing 35 changed files with 1,756 additions and 90 deletions.
8 changes: 4 additions & 4 deletions crates/samples/windows/bits/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fn main() -> Result<()> {
struct Callback;

impl IBackgroundCopyCallback_Impl for Callback_Impl {
fn JobTransferred(&self, job: Option<&IBackgroundCopyJob>) -> Result<()> {
fn JobTransferred(&self, job: Ref<IBackgroundCopyJob>) -> Result<()> {
let job = job.unwrap();
unsafe { job.Complete()? };
println!("done");
Expand All @@ -48,8 +48,8 @@ impl IBackgroundCopyCallback_Impl for Callback_Impl {

fn JobError(
&self,
job: Option<&IBackgroundCopyJob>,
error: Option<&IBackgroundCopyError>,
job: Ref<IBackgroundCopyJob>,
error: Ref<IBackgroundCopyError>,
) -> Result<()> {
let job = job.unwrap();
let error = error.unwrap();
Expand All @@ -60,7 +60,7 @@ impl IBackgroundCopyCallback_Impl for Callback_Impl {
std::process::exit(0);
}

fn JobModification(&self, _: Option<&IBackgroundCopyJob>, _: u32) -> Result<()> {
fn JobModification(&self, _: Ref<IBackgroundCopyJob>, _: u32) -> Result<()> {
Ok(())
}
}
Expand Down
4 changes: 2 additions & 2 deletions crates/samples/windows/core_app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct CoreAppView();

#[allow(non_snake_case)]
impl IFrameworkView_Impl for CoreAppView_Impl {
fn Initialize(&self, _: Option<&CoreApplicationView>) -> Result<()> {
fn Initialize(&self, _: Ref<CoreApplicationView>) -> Result<()> {
Ok(())
}

Expand All @@ -47,7 +47,7 @@ impl IFrameworkView_Impl for CoreAppView_Impl {
Ok(())
}

fn SetWindow(&self, _: Option<&CoreWindow>) -> Result<()> {
fn SetWindow(&self, _: Ref<CoreWindow>) -> Result<()> {
Ok(())
}
}
Expand Down
8 changes: 4 additions & 4 deletions crates/tests/bindgen/src/delegate_generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl<T: windows_core::RuntimeType + 'static> windows_core::RuntimeType for Event
impl<T: windows_core::RuntimeType + 'static> EventHandler<T> {
pub fn new<
F: FnMut(
Option<&windows_core::IInspectable>,
windows_core::Ref<'_, windows_core::IInspectable>,
&<T as windows_core::Type<T>>::Default,
) -> windows_core::Result<()>
+ Send
Expand Down Expand Up @@ -74,7 +74,7 @@ where
struct EventHandlerBox<
T,
F: FnMut(
Option<&windows_core::IInspectable>,
windows_core::Ref<'_, windows_core::IInspectable>,
&<T as windows_core::Type<T>>::Default,
) -> windows_core::Result<()>
+ Send
Expand All @@ -89,7 +89,7 @@ struct EventHandlerBox<
impl<
T: windows_core::RuntimeType + 'static,
F: FnMut(
Option<&windows_core::IInspectable>,
windows_core::Ref<'_, windows_core::IInspectable>,
&<T as windows_core::Type<T>>::Default,
) -> windows_core::Result<()>
+ Send
Expand Down Expand Up @@ -148,7 +148,7 @@ impl<
) -> windows_core::HRESULT {
let this = &mut *(this as *mut *mut core::ffi::c_void as *mut Self);
(this.invoke)(
windows_core::from_raw_borrowed(&sender),
core::mem::transmute_copy(&sender),
core::mem::transmute(&args),
)
.into()
Expand Down
1 change: 1 addition & 0 deletions crates/tests/bindgen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ pub mod interface_sys;
pub mod interface_sys_no_core;
pub mod multi;
pub mod multi_sys;
pub mod ref_params;
pub mod reference_async_action;
pub mod reference_async_action_reference_namespace;
pub mod reference_async_action_reference_type;
Expand Down
Loading

0 comments on commit fa58420

Please sign in to comment.