1 // Tencent is pleased to support the open source community by making RapidJSON available.
2 //
3 // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
4 //
5 // Licensed under the MIT License (the "License"); you may not use this file except
6 // in compliance with the License. You may obtain a copy of the License at
7 //
8 // http://opensource.org/licenses/MIT
9 //
10 // Unless required by applicable law or agreed to in writing, software distributed
11 // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12 // CONDITIONS OF ANY KIND, either express or implied. See the License for the
13 // specific language governing permissions and limitations under the License.
14 
15 #include "unittest.h"
16 #include "rapidjson/rapidjson.h"
17 
main(int argc,char ** argv)18 int main(int argc, char **argv) {
19     ::testing::InitGoogleTest(&argc, argv);
20 
21     std::cout << "RapidJSON v" << RAPIDJSON_VERSION_STRING << std::endl;
22 
23 #if _MSC_VER
24     _CrtMemState memoryState = { 0 };
25     _CrtMemCheckpoint(&memoryState);
26     //_CrtSetBreakAlloc(X);
27     //void *testWhetherMemoryLeakDetectionWorks = malloc(1);
28 #endif
29 
30     int ret = RUN_ALL_TESTS();
31 
32 #if _MSC_VER
33     // Current gtest constantly leak 2 blocks at exit
34     _CrtMemDumpAllObjectsSince(&memoryState);
35 #endif
36     return ret;
37 }
38