Code cosmetics: reduce the amount of cppcheck warnings

This commit is contained in:
Felipe Zimmerle
2015-08-12 15:22:00 -03:00
parent 21400ba454
commit d5fe21ce3c
24 changed files with 49 additions and 56 deletions

View File

@@ -45,7 +45,6 @@ std::string ModSecurityTest<T>::header() {
template <class T>
bool ModSecurityTest<T>::load_test_json(std::string file) {
std::vector<yajl_val> tests;
char errbuf[1024];
yajl_val node;
@@ -128,9 +127,8 @@ std::pair<std::string, std::vector<T *>>* ModSecurityTest<T>::load_tests() {
template <class T>
void ModSecurityTest<T>::cmd_options(int argc, char **argv) {
int option_char;
#if HAS_GETOPT
int option_char;
GetOpt getopt(argc, argv, "hvct:");
while ((option_char = getopt()) != EOF) {

View File

@@ -58,13 +58,12 @@ void print_help() {
void perform_unit_test(UnitTest *t, ModSecurityTestResults<UnitTest>* res) {
const char *error = NULL;
int ret = 0;
if (t->type == "op") {
Operator *op = Operator::instantiate("\"@" + t->name + \
" " + t->param + "\"");
op->init(&error);
ret = op->evaluate(NULL, t->input);
int ret = op->evaluate(NULL, t->input);
if (ret != t->ret) {
t->obtained = ret;
res->push_back(t);