mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Adds support for jsDecode transformation
This commit is contained in:
@@ -35,9 +35,16 @@ std::string UnitTest::print() {
|
||||
i << " \"name\": \"" << this->name << "\"" << std::endl;
|
||||
i << " \"input\": \"" << this->input << "\"" << std::endl;
|
||||
i << " \"param\": \"" << this->param << "\"" << std::endl;
|
||||
i << " \"output\": \"" << this->output << "\"" << std::endl;
|
||||
i << "}" << std::endl;
|
||||
i << "Expecting: " << this->ret << " - operator returned: ";
|
||||
i << this->obtained << std::endl;
|
||||
if (this->ret != this->obtained) {
|
||||
i << "Expecting: " << this->ret << " - operator returned: ";
|
||||
i << this->obtained << std::endl;
|
||||
}
|
||||
if (this->output != this->obtainedOutput) {
|
||||
i << "Expecting: " << this->output << " - operator returned: ";
|
||||
i << this->obtainedOutput << std::endl;
|
||||
}
|
||||
|
||||
return i.str();
|
||||
}
|
||||
@@ -62,6 +69,8 @@ UnitTest *UnitTest::from_yajl_node(yajl_val &node) {
|
||||
u->type = YAJL_GET_STRING(val);
|
||||
} else if (strcmp(key, "ret") == 0) {
|
||||
u->ret = YAJL_GET_INTEGER(val);
|
||||
} else if (strcmp(key, "output") == 0) {
|
||||
u->output = YAJL_GET_STRING(val);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user