File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -619,12 +619,14 @@ WINRT_EXPORT namespace winrt
619619 }
620620
621621 template <typename T>
622- void check_bool (T result WINRT_IMPL_SOURCE_LOCATION_ARGS)
622+ T check_bool (T result WINRT_IMPL_SOURCE_LOCATION_ARGS)
623623 {
624624 if (!result)
625625 {
626626 winrt::throw_last_error (WINRT_IMPL_SOURCE_LOCATION_FORWARD_SINGLE_PARAM);
627627 }
628+
629+ return result;
628630 }
629631
630632 template <typename T>
Original file line number Diff line number Diff line change @@ -200,6 +200,8 @@ TEST_CASE("Errors")
200200 SetLastError (ERROR_CANCELLED);
201201 REQUIRE_THROWS_AS (check_bool (static_cast <BOOL>(false )), hresult_canceled);
202202
203+ REQUIRE (check_bool (true ) == true );
204+
203205 // Support for Win32 errors.
204206 check_win32 (ERROR_SUCCESS);
205207 REQUIRE_THROWS_AS (check_win32 (ERROR_CANCELLED), hresult_canceled);
You can’t perform that action at this time.
0 commit comments