diff --git a/wiki/GoogleTestAdvancedGuide.wiki b/wiki/GoogleTestAdvancedGuide.wiki index 82c9f0de..2fac8c5b 100644 --- a/wiki/GoogleTestAdvancedGuide.wiki +++ b/wiki/GoogleTestAdvancedGuide.wiki @@ -45,28 +45,6 @@ switch(expression) { _Availability_: Linux, Windows, Mac. -=== Windows HRESULT assertions === - -These assertions test for `HRESULT` success or failure. - -|| *Fatal assertion* || *Nonfatal assertion* || *Verifies* || -|| `ASSERT_HRESULT_SUCCEEDED(`_expression_`);` || `EXPECT_HRESULT_SUCCEEDED(`_expression_`);` || _expression_ is a success `HRESULT` || -|| `ASSERT_HRESULT_FAILED(`_expression_`);` || `EXPECT_HRESULT_FAILED(`_expression_`);` || _expression_ is a failure `HRESULT` || - -The generated output contains the human-readable error message -associated with the `HRESULT` code returned by _expression_. - -You might use them like this: - -{{{ -CComPtr shell; -ASSERT_HRESULT_SUCCEEDED(shell.CoCreateInstance(L"Shell.Application")); -CComVariant empty; -ASSERT_HRESULT_SUCCEEDED(shell->ShellExecute(CComBSTR(url), empty, empty, empty, empty)); -}}} - -_Availability_: Windows. - === Predicate Assertions === Even though Google Test has a rich set of assertions, they can never be @@ -239,6 +217,28 @@ replace `EXPECT_PRED_FORMAT2` in the above table with `ASSERT_PRED_FORMAT2`. _Availability_: Linux, Windows, Mac. +=== Windows HRESULT assertions === + +These assertions test for `HRESULT` success or failure. + +|| *Fatal assertion* || *Nonfatal assertion* || *Verifies* || +|| `ASSERT_HRESULT_SUCCEEDED(`_expression_`);` || `EXPECT_HRESULT_SUCCEEDED(`_expression_`);` || _expression_ is a success `HRESULT` || +|| `ASSERT_HRESULT_FAILED(`_expression_`);` || `EXPECT_HRESULT_FAILED(`_expression_`);` || _expression_ is a failure `HRESULT` || + +The generated output contains the human-readable error message +associated with the `HRESULT` code returned by _expression_. + +You might use them like this: + +{{{ +CComPtr shell; +ASSERT_HRESULT_SUCCEEDED(shell.CoCreateInstance(L"Shell.Application")); +CComVariant empty; +ASSERT_HRESULT_SUCCEEDED(shell->ShellExecute(CComBSTR(url), empty, empty, empty, empty)); +}}} + +_Availability_: Windows. + === Assertion Placement === You can include assertions in any C++ function's code. The one constraint is