Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
53 lines (44 loc) · 1.74 KB

File metadata and controls

53 lines (44 loc) · 1.74 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// PythonScript.Tests.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <gtest/gtest.h>
#include "ReplaceEntry.h"
#include "Replacer.h"
#include <list>
static void runReplace()
{
NppPythonScript::Replacer<NppPythonScript::Utf8CharTraits> replacer;
std::list<NppPythonScript::ReplaceEntry*> entries;
bool moreEntries = replacer.startReplace("aaabbbaaabb", 12, 0, 0, "(b+)", "x$1x", NppPythonScript::python_re_flag_normal, entries);
ASSERT_EQ(2u, entries.size());
for (auto ptr : entries)
{
delete ptr;
}
entries.clear();
}
int main(int argc, char* argv[])
{
#ifdef _DEBUG
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
_CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE );
_CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDOUT );
_CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE );
_CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDOUT );
_CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE );
_CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDOUT );
_CrtMemState state;
_CrtMemCheckpoint(&state);
#endif
::testing::InitGoogleTest(&argc, argv);
int result = RUN_ALL_TESTS();
// This function call is used to check if we've created memory leaks using startReplace
// Gtest creates various static objects, so it can be a bit tricky to identify leaks with Gtest running
// It's left commented out as it normally serves no purpose. If it looks like there's leaks, then remove the
// test code above, and uncomment this runReplace() call to try to identify the source of the leak.
// runReplace();
#ifdef _DEBUG
_CrtMemDumpAllObjectsSince(&state);
#endif
return result;
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.