main.cpp 909 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #include <gtest/gtest.h>
  2. #include "Bullet3Common/b3Logging.h"
  3. void myerrorprintf(const char* msg)
  4. {
  5. printf("%s",msg);
  6. }
  7. static bool sVerboseWarning = true;
  8. void mywarningprintf(const char* msg)
  9. {
  10. if (sVerboseWarning)
  11. {
  12. //OutputDebugStringA(msg);
  13. printf("%s",msg);
  14. }
  15. }
  16. static bool sVerbosePrintf=true;//false;
  17. void myprintf(const char* msg)
  18. {
  19. if (sVerbosePrintf)
  20. {
  21. //OutputDebugStringA(msg);
  22. printf("%s",msg);
  23. }
  24. }
  25. int gArgc=0;
  26. char** gArgv=0;
  27. int main(int argc, char **argv) {
  28. #if _MSC_VER
  29. _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
  30. //void *testWhetherMemoryLeakDetectionWorks = malloc(1);
  31. #endif
  32. ::testing::InitGoogleTest(&argc, argv);
  33. gArgc = argc;
  34. gArgv = argv;
  35. b3SetCustomPrintfFunc(myprintf);
  36. b3SetCustomWarningMessageFunc(mywarningprintf);
  37. b3SetCustomErrorMessageFunc(myerrorprintf);
  38. return RUN_ALL_TESTS();
  39. }