File tree Expand file tree Collapse file tree 3 files changed +8
-12
lines changed Expand file tree Collapse file tree 3 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ std::string ModSecurityTest<T>::header() {
46
46
}
47
47
48
48
template <class T >
49
- bool ModSecurityTest<T>::load_test_json(std::string file) {
49
+ bool ModSecurityTest<T>::load_test_json(const std::string & file) {
50
50
char errbuf[1024 ];
51
51
yajl_val node;
52
52
@@ -76,13 +76,12 @@ bool ModSecurityTest<T>::load_test_json(std::string file) {
76
76
u->filename = file;
77
77
78
78
if (this ->count (u->filename + " :" + u->name ) == 0 ) {
79
- std::vector<T *> *vector = new std::vector<T *>;
80
- vector ->push_back (u);
79
+ auto vec = new std::vector<T *>;
80
+ vec ->push_back (u);
81
81
std::string filename (u->filename + " :" + u->name );
82
- std::pair<std::string, std::vector<T*>*> a (filename, vector);
83
- this ->insert (a);
82
+ this ->insert ({filename, vec});
84
83
} else {
85
- std::vector<T *> * vec = this ->at (u->filename + " :" + u->name );
84
+ auto vec = this ->at (u->filename + " :" + u->name );
86
85
vec->push_back (u);
87
86
}
88
87
}
@@ -95,7 +94,7 @@ bool ModSecurityTest<T>::load_test_json(std::string file) {
95
94
96
95
template <class T >
97
96
std::pair<std::string, std::vector<T *>>*
98
- ModSecurityTest<T>::load_tests(std::string path) {
97
+ ModSecurityTest<T>::load_tests(const std::string & path) {
99
98
DIR *dir;
100
99
struct dirent *ent;
101
100
struct stat buffer;
Original file line number Diff line number Diff line change @@ -39,8 +39,8 @@ template <class T> class ModSecurityTest :
39
39
std::string header ();
40
40
void cmd_options (int , char **);
41
41
std::pair<std::string, std::vector<T *>>* load_tests ();
42
- std::pair<std::string, std::vector<T *>>* load_tests (std::string path);
43
- bool load_test_json (std::string);
42
+ std::pair<std::string, std::vector<T *>>* load_tests (const std::string & path);
43
+ bool load_test_json (const std::string &file );
44
44
45
45
std::string target;
46
46
bool verbose = false ;
Original file line number Diff line number Diff line change @@ -43,7 +43,6 @@ functionStatic:src/engine/lua.h:70
43
43
functionStatic:src/engine/lua.h:71
44
44
functionConst:src/utils/geo_lookup.h:49
45
45
useInitializationList:src/operators/rbl.h:69
46
- constStatement:test/common/modsecurity_test.cc:82
47
46
functionStatic:src/operators/geo_lookup.h:35
48
47
duplicateBreak:src/operators/validate_utf8_encoding.cc
49
48
syntaxError:src/transaction.cc:62
@@ -55,8 +54,6 @@ rethrowNoCurrentException:src/rule_with_actions.cc:127
55
54
ctunullpointer:src/rule_with_actions.cc:244
56
55
ctunullpointer:src/rule_with_operator.cc:135
57
56
ctunullpointer:src/rule_with_operator.cc:95
58
- passedByValue:test/common/modsecurity_test.cc:49
59
- passedByValue:test/common/modsecurity_test.cc:98
60
57
unreadVariable:src/rule_with_operator.cc:219
61
58
62
59
uninitvar:src/operators/verify_cpf.cc:77
You can’t perform that action at this time.
0 commit comments