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() {
4646}
4747
4848template <class T >
49- bool ModSecurityTest<T>::load_test_json(std::string file) {
49+ bool ModSecurityTest<T>::load_test_json(const std::string & file) {
5050 char errbuf[1024 ];
5151 yajl_val node;
5252
@@ -76,13 +76,12 @@ bool ModSecurityTest<T>::load_test_json(std::string file) {
7676 u->filename = file;
7777
7878 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);
8181 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});
8483 } else {
85- std::vector<T *> * vec = this ->at (u->filename + " :" + u->name );
84+ auto vec = this ->at (u->filename + " :" + u->name );
8685 vec->push_back (u);
8786 }
8887 }
@@ -95,7 +94,7 @@ bool ModSecurityTest<T>::load_test_json(std::string file) {
9594
9695template <class T >
9796std::pair<std::string, std::vector<T *>>*
98- ModSecurityTest<T>::load_tests(std::string path) {
97+ ModSecurityTest<T>::load_tests(const std::string & path) {
9998 DIR *dir;
10099 struct dirent *ent;
101100 struct stat buffer;
Original file line number Diff line number Diff line change @@ -39,8 +39,8 @@ template <class T> class ModSecurityTest :
3939 std::string header ();
4040 void cmd_options (int , char **);
4141 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 );
4444
4545 std::string target;
4646 bool verbose = false ;
Original file line number Diff line number Diff line change @@ -43,7 +43,6 @@ functionStatic:src/engine/lua.h:70
4343functionStatic:src/engine/lua.h:71
4444functionConst:src/utils/geo_lookup.h:49
4545useInitializationList:src/operators/rbl.h:69
46- constStatement:test/common/modsecurity_test.cc:82
4746functionStatic:src/operators/geo_lookup.h:35
4847duplicateBreak:src/operators/validate_utf8_encoding.cc
4948syntaxError:src/transaction.cc:62
@@ -55,8 +54,6 @@ rethrowNoCurrentException:src/rule_with_actions.cc:127
5554ctunullpointer:src/rule_with_actions.cc:244
5655ctunullpointer:src/rule_with_operator.cc:135
5756ctunullpointer:src/rule_with_operator.cc:95
58- passedByValue:test/common/modsecurity_test.cc:49
59- passedByValue:test/common/modsecurity_test.cc:98
6057unreadVariable:src/rule_with_operator.cc:219
6158
6259uninitvar:src/operators/verify_cpf.cc:77
You can’t perform that action at this time.
0 commit comments