зеркало из https://github.com/microsoft/TestWinRT.git
Creates values to support Rust/WinRT testing (#30)
This commit is contained in:
Родитель
9bbec93e04
Коммит
8ed923a289
|
@ -197,9 +197,11 @@ namespace TestComponent
|
|||
// Returns an implementation of ITests for independently driven testing.
|
||||
static ITests MakeTests();
|
||||
|
||||
// Creates empty collections to support Rust/WinRT testing.
|
||||
// Creates values to support Rust/WinRT testing.
|
||||
static Windows.Foundation.Collections.IVector<Int32> CreateInt32Vector();
|
||||
static Windows.Foundation.Collections.IVector<String> CreateStringVector();
|
||||
static Windows.Foundation.Collections.IVector<Windows.Foundation.IStringable> CreateStringableVector();
|
||||
static Windows.Foundation.TimeSpan CreateTimeSpan(UInt32 milliseconds);
|
||||
static Windows.Foundation.IAsyncAction CreateAsyncAction(UInt32 milliseconds);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
|
||||
<metadata minClientVersion="2.5">
|
||||
<id>KennyKerr.Windows.TestWinRT</id>
|
||||
<version>1.0.13</version>
|
||||
<version>1.0.14</version>
|
||||
<title>TestWinRT</title>
|
||||
<authors>Microsoft</authors>
|
||||
<owners>Microsoft</owners>
|
||||
|
|
|
@ -691,4 +691,14 @@ namespace winrt::TestComponent::implementation
|
|||
{
|
||||
return single_threaded_vector<IStringable>();
|
||||
}
|
||||
|
||||
TimeSpan TestRunner::CreateTimeSpan(uint32_t milliseconds)
|
||||
{
|
||||
return std::chrono::milliseconds(milliseconds);
|
||||
}
|
||||
|
||||
IAsyncAction TestRunner::CreateAsyncAction(uint32_t milliseconds)
|
||||
{
|
||||
co_await resume_after(CreateTimeSpan(milliseconds));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,8 @@ namespace winrt::TestComponent::implementation
|
|||
static Windows::Foundation::Collections::IVector<int32_t> CreateInt32Vector();
|
||||
static Windows::Foundation::Collections::IVector<hstring> CreateStringVector();
|
||||
static Windows::Foundation::Collections::IVector<Windows::Foundation::IStringable> CreateStringableVector();
|
||||
static Windows::Foundation::TimeSpan CreateTimeSpan(uint32_t milliseconds);
|
||||
static Windows::Foundation::IAsyncAction CreateAsyncAction(uint32_t milliseconds);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче