tesseract v5.3.3.20231005
gtest_repeat_test.cc File Reference
#include <stdlib.h>
#include <iostream>
#include "gtest/gtest.h"
#include "src/gtest-internal-inl.h"

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";\
}\
GTEST_API_ bool IsTrue(bool condition)
Definition: gtest.cc:6238

Definition at line 54 of file gtest_repeat_test.cc.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 208 of file gtest_repeat_test.cc.

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