Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
gtest_repeat_test.cc File Reference
#include <stdlib.h>
#include <iostream>
#include "gtest/gtest.h"
#include "src/gtest-internal-inl.h"
Include dependency graph for gtest_repeat_test.cc:

Go to the source code of this file.

Namespaces

namespace  testing
 

Macros

#define GTEST_CHECK_INT_EQ_(expected, actual)
 

Functions

 testing::GTEST_DECLARE_string_ (death_test_style)
 
 testing::GTEST_DECLARE_string_ (filter)
 
 testing::GTEST_DECLARE_int32_ (repeat)
 
int main (int argc, char **argv)
 

Macro Definition Documentation

◆ GTEST_CHECK_INT_EQ_

#define GTEST_CHECK_INT_EQ_ ( expected,
actual )
Value:
do {\
const int expected_val = (expected);\
const int actual_val = (actual);\
if (::testing::internal::IsTrue(expected_val != actual_val)) {\
::std::cout << "Value of: " #actual "\n"\
<< " Actual: " << actual_val << "\n"\
<< "Expected: " #expected "\n"\
<< "Which is: " << expected_val << "\n";\
::testing::internal::posix::Abort();\
}\
GTEST_API_ bool IsTrue(bool condition)
Definition gtest.cc:5404

Definition at line 55 of file gtest_repeat_test.cc.

55#define GTEST_CHECK_INT_EQ_(expected, actual) \
56 do {\
57 const int expected_val = (expected);\
58 const int actual_val = (actual);\
59 if (::testing::internal::IsTrue(expected_val != actual_val)) {\
60 ::std::cout << "Value of: " #actual "\n"\
61 << " Actual: " << actual_val << "\n"\
62 << "Expected: " #expected "\n"\
63 << "Which is: " << expected_val << "\n";\
64 ::testing::internal::posix::Abort();\
65 }\
66 } while (::testing::internal::AlwaysFalse())

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 211 of file gtest_repeat_test.cc.

211 {
213
214 testing::AddGlobalTestEnvironment(new MyEnvironment);
215
216 TestRepeatUnspecified();
217 TestRepeat(0);
218 TestRepeat(1);
219 TestRepeat(5);
220
221 TestRepeatWithEmptyFilter(2);
222 TestRepeatWithEmptyFilter(3);
223
224 TestRepeatWithFilterForSuccessfulTests(3);
225
226 TestRepeatWithFilterForFailedTests(4);
227
228 // It would be nice to verify that the tests indeed loop forever
229 // when GTEST_FLAG(repeat) is negative, but this test will be quite
230 // complicated to write. Since this flag is for interactive
231 // debugging only and doesn't affect the normal test result, such a
232 // test would be an overkill.
233
234 printf("PASS\n");
235 return 0;
236}
char ** argv
LOGGING_API void printf(Category category, const char *format,...)
Definition Logging.cpp:30
Environment * AddGlobalTestEnvironment(Environment *env)
Definition gtest.h:1391
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
Definition gtest.cc:5787
Here is the call graph for this function: