-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Accurate error propagation from RoGetActivationFactory (#559)
- Loading branch information
Showing
8 changed files
with
59 additions
and
19 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
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,30 @@ | ||
#include "pch.h" | ||
|
||
using namespace winrt; | ||
using namespace Windows::Foundation; | ||
|
||
namespace | ||
{ | ||
IAsyncAction Async() | ||
{ | ||
// This is just a simple way of testing all of the ABI and projection | ||
// error propagation in one go. | ||
throw hresult_class_not_registered(L"test message"); | ||
} | ||
} | ||
TEST_CASE("hresult_class_not_registered") | ||
{ | ||
REQUIRE(hresult_class_not_registered().message() == L"Class not registered"); | ||
REQUIRE(hresult_class_not_registered().code() == REGDB_E_CLASSNOTREG); | ||
|
||
try | ||
{ | ||
Async().get(); | ||
FAIL(L"Previous line should throw"); | ||
} | ||
catch (hresult_class_not_registered const& e) | ||
{ | ||
REQUIRE(e.message() == L"test message"); | ||
REQUIRE(e.code() == REGDB_E_CLASSNOTREG); | ||
} | ||
} |
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