Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr committed Jan 5, 2024
1 parent 11da8ac commit 623e811
Show file tree
Hide file tree
Showing 7 changed files with 156 additions and 156 deletions.
20 changes: 10 additions & 10 deletions crates/tests/component/src/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ pub mod Nested {
IThing_Vtbl,
0x5448be22_9873_5ae6_9106_f6e8455d2fdd
);
::windows_core::imp::interface_hierarchy!(
IThing,
::windows_core::IUnknown,
::windows_core::IInspectable
);
impl IThing {
pub fn Method(&self) -> ::windows_core::Result<()> {
let this = self;
Expand All @@ -24,11 +29,6 @@ pub mod Nested {
}
}
}
::windows_core::imp::interface_hierarchy!(
IThing,
::windows_core::IUnknown,
::windows_core::IInspectable
);
impl ::windows_core::RuntimeType for IThing {
const SIGNATURE: ::windows_core::imp::ConstBuffer =
::windows_core::imp::ConstBuffer::for_interface::<Self>();
Expand Down Expand Up @@ -123,6 +123,11 @@ pub struct IClass_Vtbl {
#[repr(transparent)]
#[derive(::core::cmp::PartialEq, ::core::cmp::Eq, ::core::fmt::Debug, ::core::clone::Clone)]
pub struct Class(::windows_core::IUnknown);
::windows_core::imp::interface_hierarchy!(
Class,
::windows_core::IUnknown,
::windows_core::IInspectable
);
impl Class {
pub fn new() -> ::windows_core::Result<Self> {
Self::IActivationFactory(|f| f.ActivateInstance::<Self>())
Expand Down Expand Up @@ -250,11 +255,6 @@ unsafe impl ::windows_core::Interface for Class {
impl ::windows_core::RuntimeName for Class {
const NAME: &'static str = "test_component.Class";
}
::windows_core::imp::interface_hierarchy!(
Class,
::windows_core::IUnknown,
::windows_core::IInspectable
);
unsafe impl ::core::marker::Send for Class {}
unsafe impl ::core::marker::Sync for Class {}
#[repr(transparent)]
Expand Down
20 changes: 10 additions & 10 deletions crates/tests/component_client/src/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ pub mod Nested {
IThing_Vtbl,
0x5448be22_9873_5ae6_9106_f6e8455d2fdd
);
::windows_core::imp::interface_hierarchy!(
IThing,
::windows_core::IUnknown,
::windows_core::IInspectable
);
impl IThing {
pub fn Method(&self) -> ::windows_core::Result<()> {
let this = self;
Expand All @@ -24,11 +29,6 @@ pub mod Nested {
}
}
}
::windows_core::imp::interface_hierarchy!(
IThing,
::windows_core::IUnknown,
::windows_core::IInspectable
);
impl ::windows_core::RuntimeType for IThing {
const SIGNATURE: ::windows_core::imp::ConstBuffer =
::windows_core::imp::ConstBuffer::for_interface::<Self>();
Expand Down Expand Up @@ -91,6 +91,11 @@ pub struct IClass_Vtbl {
#[repr(transparent)]
#[derive(::core::cmp::PartialEq, ::core::cmp::Eq, ::core::fmt::Debug, ::core::clone::Clone)]
pub struct Class(::windows_core::IUnknown);
::windows_core::imp::interface_hierarchy!(
Class,
::windows_core::IUnknown,
::windows_core::IInspectable
);
impl Class {
pub fn new() -> ::windows_core::Result<Self> {
Self::IActivationFactory(|f| f.ActivateInstance::<Self>())
Expand Down Expand Up @@ -218,11 +223,6 @@ unsafe impl ::windows_core::Interface for Class {
impl ::windows_core::RuntimeName for Class {
const NAME: &'static str = "test_component.Class";
}
::windows_core::imp::interface_hierarchy!(
Class,
::windows_core::IUnknown,
::windows_core::IInspectable
);
unsafe impl ::core::marker::Send for Class {}
unsafe impl ::core::marker::Sync for Class {}
#[repr(transparent)]
Expand Down
74 changes: 37 additions & 37 deletions crates/tests/riddle/src/generic_interfaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
pub struct IIterable<T>(::windows_core::IUnknown, ::core::marker::PhantomData<T>)
where
T: ::windows_core::RuntimeType + 'static;
impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::CanInto<::windows_core::IUnknown>
for IIterable<T>
{
}
impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::CanInto<::windows_core::IInspectable>
for IIterable<T>
{
}
impl<T: ::windows_core::RuntimeType + 'static> IIterable<T> {
pub fn First(&self) -> ::windows_core::Result<IIterator<T>> {
let this = self;
Expand All @@ -25,14 +33,6 @@ impl<T: ::windows_core::RuntimeType + 'static> IIterable<T> {
}
}
}
impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::CanInto<::windows_core::IUnknown>
for IIterable<T>
{
}
impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::CanInto<::windows_core::IInspectable>
for IIterable<T>
{
}
impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::RuntimeType for IIterable<T> {
const SIGNATURE: ::windows_core::imp::ConstBuffer = {
::windows_core::imp::ConstBuffer::new()
Expand Down Expand Up @@ -66,6 +66,14 @@ where
pub struct IIterator<T>(::windows_core::IUnknown, ::core::marker::PhantomData<T>)
where
T: ::windows_core::RuntimeType + 'static;
impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::CanInto<::windows_core::IUnknown>
for IIterator<T>
{
}
impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::CanInto<::windows_core::IInspectable>
for IIterator<T>
{
}
impl<T: ::windows_core::RuntimeType + 'static> IIterator<T> {
pub fn get_Current(&self) -> ::windows_core::Result<T> {
let this = self;
Expand Down Expand Up @@ -101,14 +109,6 @@ impl<T: ::windows_core::RuntimeType + 'static> IIterator<T> {
}
}
}
impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::CanInto<::windows_core::IUnknown>
for IIterator<T>
{
}
impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::CanInto<::windows_core::IInspectable>
for IIterator<T>
{
}
impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::RuntimeType for IIterator<T> {
const SIGNATURE: ::windows_core::imp::ConstBuffer = {
::windows_core::imp::ConstBuffer::new()
Expand Down Expand Up @@ -155,6 +155,14 @@ pub struct IKeyValuePair<K, V>(
where
K: ::windows_core::RuntimeType + 'static,
V: ::windows_core::RuntimeType + 'static;
impl<K: ::windows_core::RuntimeType + 'static, V: ::windows_core::RuntimeType + 'static>
::windows_core::CanInto<::windows_core::IUnknown> for IKeyValuePair<K, V>
{
}
impl<K: ::windows_core::RuntimeType + 'static, V: ::windows_core::RuntimeType + 'static>
::windows_core::CanInto<::windows_core::IInspectable> for IKeyValuePair<K, V>
{
}
impl<K: ::windows_core::RuntimeType + 'static, V: ::windows_core::RuntimeType + 'static>
IKeyValuePair<K, V>
{
Expand All @@ -181,14 +189,6 @@ impl<K: ::windows_core::RuntimeType + 'static, V: ::windows_core::RuntimeType +
}
}
}
impl<K: ::windows_core::RuntimeType + 'static, V: ::windows_core::RuntimeType + 'static>
::windows_core::CanInto<::windows_core::IUnknown> for IKeyValuePair<K, V>
{
}
impl<K: ::windows_core::RuntimeType + 'static, V: ::windows_core::RuntimeType + 'static>
::windows_core::CanInto<::windows_core::IInspectable> for IKeyValuePair<K, V>
{
}
impl<K: ::windows_core::RuntimeType + 'static, V: ::windows_core::RuntimeType + 'static>
::windows_core::RuntimeType for IKeyValuePair<K, V>
{
Expand Down Expand Up @@ -239,6 +239,19 @@ pub struct IMapView<K, V>(
where
K: ::windows_core::RuntimeType + 'static,
V: ::windows_core::RuntimeType + 'static;
impl<K: ::windows_core::RuntimeType + 'static, V: ::windows_core::RuntimeType + 'static>
::windows_core::CanInto<::windows_core::IUnknown> for IMapView<K, V>
{
}
impl<K: ::windows_core::RuntimeType + 'static, V: ::windows_core::RuntimeType + 'static>
::windows_core::CanInto<::windows_core::IInspectable> for IMapView<K, V>
{
}
impl<K: ::windows_core::RuntimeType + 'static, V: ::windows_core::RuntimeType + 'static>
::windows_core::CanInto<IIterable<IKeyValuePair<K, V>>> for IMapView<K, V>
{
const QUERY: bool = true;
}
impl<K: ::windows_core::RuntimeType + 'static, V: ::windows_core::RuntimeType + 'static>
IMapView<K, V>
{
Expand Down Expand Up @@ -301,19 +314,6 @@ impl<K: ::windows_core::RuntimeType + 'static, V: ::windows_core::RuntimeType +
}
}
}
impl<K: ::windows_core::RuntimeType + 'static, V: ::windows_core::RuntimeType + 'static>
::windows_core::CanInto<::windows_core::IUnknown> for IMapView<K, V>
{
}
impl<K: ::windows_core::RuntimeType + 'static, V: ::windows_core::RuntimeType + 'static>
::windows_core::CanInto<::windows_core::IInspectable> for IMapView<K, V>
{
}
impl<K: ::windows_core::RuntimeType + 'static, V: ::windows_core::RuntimeType + 'static>
::windows_core::CanInto<IIterable<IKeyValuePair<K, V>>> for IMapView<K, V>
{
const QUERY: bool = true;
}
impl<K: ::windows_core::RuntimeType + 'static, V: ::windows_core::RuntimeType + 'static>
::windows_core::RuntimeType for IMapView<K, V>
{
Expand Down
10 changes: 5 additions & 5 deletions crates/tests/riddle/src/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
clippy::all
)]
::windows_core::imp::com_interface!(IParams, IParams_Vtbl, 0);
::windows_core::imp::interface_hierarchy!(
IParams,
::windows_core::IUnknown,
::windows_core::IInspectable
);
impl IParams {
pub fn Nothing(&self) -> ::windows_core::Result<()> {
let this = self;
Expand Down Expand Up @@ -188,11 +193,6 @@ impl IParams {
}
}
}
::windows_core::imp::interface_hierarchy!(
IParams,
::windows_core::IUnknown,
::windows_core::IInspectable
);
impl ::windows_core::RuntimeType for IParams {
const SIGNATURE: ::windows_core::imp::ConstBuffer =
::windows_core::imp::ConstBuffer::for_interface::<Self>();
Expand Down
68 changes: 34 additions & 34 deletions crates/tests/standalone/src/b_calendar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
#[repr(transparent)]
#[derive(::core::cmp::PartialEq, ::core::cmp::Eq, ::core::fmt::Debug, ::core::clone::Clone)]
pub struct Calendar(::windows_core::IUnknown);
::windows_core::imp::interface_hierarchy!(
Calendar,
::windows_core::IUnknown,
::windows_core::IInspectable
);
impl Calendar {
pub fn new() -> ::windows_core::Result<Self> {
Self::IActivationFactory(|f| f.ActivateInstance::<Self>())
Expand Down Expand Up @@ -1274,11 +1279,6 @@ unsafe impl ::windows_core::Interface for Calendar {
impl ::windows_core::RuntimeName for Calendar {
const NAME: &'static str = "Windows.Globalization.Calendar";
}
::windows_core::imp::interface_hierarchy!(
Calendar,
::windows_core::IUnknown,
::windows_core::IInspectable
);
unsafe impl ::core::marker::Send for Calendar {}
unsafe impl ::core::marker::Sync for Calendar {}
#[repr(C)]
Expand Down Expand Up @@ -1804,6 +1804,14 @@ pub struct ICalendarFactory2_Vtbl {
pub struct IIterable<T>(::windows_core::IUnknown, ::core::marker::PhantomData<T>)
where
T: ::windows_core::RuntimeType + 'static;
impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::CanInto<::windows_core::IUnknown>
for IIterable<T>
{
}
impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::CanInto<::windows_core::IInspectable>
for IIterable<T>
{
}
impl<T: ::windows_core::RuntimeType + 'static> IIterable<T> {
pub fn First(&self) -> ::windows_core::Result<IIterator<T>> {
let this = self;
Expand All @@ -1817,14 +1825,6 @@ impl<T: ::windows_core::RuntimeType + 'static> IIterable<T> {
}
}
}
impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::CanInto<::windows_core::IUnknown>
for IIterable<T>
{
}
impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::CanInto<::windows_core::IInspectable>
for IIterable<T>
{
}
impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::RuntimeType for IIterable<T> {
const SIGNATURE: ::windows_core::imp::ConstBuffer = {
::windows_core::imp::ConstBuffer::new()
Expand Down Expand Up @@ -1872,6 +1872,14 @@ where
pub struct IIterator<T>(::windows_core::IUnknown, ::core::marker::PhantomData<T>)
where
T: ::windows_core::RuntimeType + 'static;
impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::CanInto<::windows_core::IUnknown>
for IIterator<T>
{
}
impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::CanInto<::windows_core::IInspectable>
for IIterator<T>
{
}
impl<T: ::windows_core::RuntimeType + 'static> IIterator<T> {
pub fn Current(&self) -> ::windows_core::Result<T> {
let this = self;
Expand Down Expand Up @@ -1923,14 +1931,6 @@ impl<T: ::windows_core::RuntimeType + 'static> IIterator<T> {
}
}
}
impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::CanInto<::windows_core::IUnknown>
for IIterator<T>
{
}
impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::CanInto<::windows_core::IInspectable>
for IIterator<T>
{
}
impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::RuntimeType for IIterator<T> {
const SIGNATURE: ::windows_core::imp::ConstBuffer = {
::windows_core::imp::ConstBuffer::new()
Expand Down Expand Up @@ -2015,6 +2015,19 @@ pub struct ITimeZoneOnCalendar_Vtbl {
pub struct IVectorView<T>(::windows_core::IUnknown, ::core::marker::PhantomData<T>)
where
T: ::windows_core::RuntimeType + 'static;
impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::CanInto<::windows_core::IUnknown>
for IVectorView<T>
{
}
impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::CanInto<::windows_core::IInspectable>
for IVectorView<T>
{
}
impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::CanInto<IIterable<T>>
for IVectorView<T>
{
const QUERY: bool = true;
}
impl<T: ::windows_core::RuntimeType + 'static> IVectorView<T> {
pub fn GetAt(&self, index: u32) -> ::windows_core::Result<T> {
let this = self;
Expand Down Expand Up @@ -2085,19 +2098,6 @@ impl<T: ::windows_core::RuntimeType + 'static> IVectorView<T> {
}
}
}
impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::CanInto<::windows_core::IUnknown>
for IVectorView<T>
{
}
impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::CanInto<::windows_core::IInspectable>
for IVectorView<T>
{
}
impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::CanInto<IIterable<T>>
for IVectorView<T>
{
const QUERY: bool = true;
}
impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::RuntimeType for IVectorView<T> {
const SIGNATURE: ::windows_core::imp::ConstBuffer = {
::windows_core::imp::ConstBuffer::new()
Expand Down
10 changes: 5 additions & 5 deletions crates/tests/standalone/src/b_stringable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
IStringable_Vtbl,
0x96369f54_8eb6_48f0_abce_c1b211e627c3
);
::windows_core::imp::interface_hierarchy!(
IStringable,
::windows_core::IUnknown,
::windows_core::IInspectable
);
impl IStringable {
pub fn ToString(&self) -> ::windows_core::Result<::windows_core::HSTRING> {
let this = self;
Expand All @@ -25,11 +30,6 @@ impl IStringable {
}
}
}
::windows_core::imp::interface_hierarchy!(
IStringable,
::windows_core::IUnknown,
::windows_core::IInspectable
);
impl ::windows_core::RuntimeType for IStringable {
const SIGNATURE: ::windows_core::imp::ConstBuffer =
::windows_core::imp::ConstBuffer::for_interface::<Self>();
Expand Down
Loading

0 comments on commit 623e811

Please sign in to comment.