Go to the documentation of this file.
33 #include "gtest/gtest.h"
43 throw testing::AssertionException(
result);
69 Fail(
"A successful assertion wrongfully threw.");
76 Fail(
"A failed non-fatal assertion wrongfully threw.");
82 }
catch(
const testing::AssertionException& e) {
83 if (strstr(e.what(),
"Expected failure") !=
nullptr)
throw;
86 "A failed assertion did throw an exception of the right type, "
87 "but the message is incorrect. Instead of containing \"Expected "
88 "failure\", it is:\n");
91 Fail(
"A failed assertion threw the wrong type of exception.");
93 Fail(
"A failed assertion should've thrown but didn't.");
102 int main(
int argc,
char** argv) {
109 Fail(
"Expected failure instead.");
113 Fail(
"Should have continued with other tests, but did not.");
TestEventListeners & listeners()
_Use_decl_annotations_ int __cdecl printf(const char *_Format,...)
void Append(TestEventListener *listener)
int kTestForContinuingTest
void OnTestPartResult(const testing::TestPartResult &result) override
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
void Fail(const char *msg)
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
static UnitTest * GetInstance()
int main(int argc, char **argv)
static void AssertFalse()
#define ASSERT_EQ(val1, val2)
grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:54