Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
233 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
#include "common.h" | ||
|
||
// Prior to C++/WinRT 2.0 this would cause issues since we're not including wil/cppwinrt.h in this translation unit. | ||
// However, since we're going to link into the same executable as 'CppWinRTTests.cpp', the 'winrt_to_hresult_handler' | ||
// global function pointer should be set, so these should all run successfully | ||
|
||
#include <winrt/base.h> | ||
#include <wil/result.h> | ||
|
||
TEST_CASE("CppWinRTTests::CppWinRT20Test", "[cppwinrt]") | ||
{ | ||
auto test = [](HRESULT hr) | ||
{ | ||
try | ||
{ | ||
THROW_HR(hr); | ||
} | ||
catch (...) | ||
{ | ||
REQUIRE(hr == winrt::to_hresult()); | ||
} | ||
}; | ||
|
||
test(E_OUTOFMEMORY); | ||
test(E_INVALIDARG); | ||
test(E_UNEXPECTED); | ||
} |
Oops, something went wrong.