aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/unit/UnitTester.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2018-03-26 14:33:28 +1100
committerNeil <nyamatongwe@gmail.com>2018-03-26 14:33:28 +1100
commite0cfc0864c3ce887cac4214c5e6c5f539bea3e40 (patch)
tree1fc0de3a81c6daf29704ee487d974044a6074c52 /test/unit/UnitTester.cxx
parent31ac7bbd3f37432ad1cf9b9a875f8425e2b4afae (diff)
downloadscintilla-mirror-e0cfc0864c3ce887cac4214c5e6c5f539bea3e40.tar.gz
Update Catch from 1.0 build 47 to 2.0.1 and modify UnitTester.cpp to suit.
Use #define for Catch to report memory leaks after main as the previous call to _CrtDumpMemoryLeaks was too early and listed a static allocation as a leak.
Diffstat (limited to 'test/unit/UnitTester.cxx')
-rw-r--r--test/unit/UnitTester.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/unit/UnitTester.cxx b/test/unit/UnitTester.cxx
index 829a322fc..048abf24e 100644
--- a/test/unit/UnitTester.cxx
+++ b/test/unit/UnitTester.cxx
@@ -1,11 +1,16 @@
// UnitTester.cpp : Defines the entry point for the console application.
//
+// Catch uses std::uncaught_exception which is deprecated in C++17.
+// This define silences a warning from Visual C++.
+#define _SILENCE_CXX17_UNCAUGHT_EXCEPTION_DEPRECATION_WARNING
+
#include <cstdio>
#include <cstdarg>
#include "Platform.h"
+#define CATCH_CONFIG_WINDOWS_CRTDBG
#define CATCH_CONFIG_RUNNER
#include "catch.hpp"
@@ -29,10 +34,8 @@ void Platform::DebugPrintf(const char *format, ...) {
}
-int main(int argc, char* const argv[]) {
+int main(int argc, char* argv[]) {
const int result = Catch::Session().run(argc, argv);
- _CrtDumpMemoryLeaks();
-
return result;
}