X-Git-Url: https://git.teslayout.com/public/public/public/?p=anna.git;a=blobdiff_plain;f=source%2Ftesting%2FTestCondition.cpp;h=6f0bba0d899882916e5bfd1b82ae91abe8ce4b70;hp=fcb3c089651b017ae79af19d0ed2ff3a5229cb98;hb=2e2f6d4e2ffe1c8b86c812807f0e501ab78f56f9;hpb=88cd8ffad493971ae4704ed007d8430c1d3fd7eb diff --git a/source/testing/TestCondition.cpp b/source/testing/TestCondition.cpp index fcb3c08..6f0bba0 100644 --- a/source/testing/TestCondition.cpp +++ b/source/testing/TestCondition.cpp @@ -10,7 +10,7 @@ #include // Project -#include +#include #include #include @@ -28,19 +28,19 @@ using namespace anna::testing; -const char* TestCondition::asText(const Type::_v type) +const char* TestDiameterCondition::asText(const Type::_v type) throw() { static const char* text [] = { "RegexpXml", "RegexpHex", "Fields" }; return text [type]; } -bool TestCondition::exists() const throw() { +bool TestDiameterCondition::exists() const throw() { if (a_type != Type::Fields) return (getRegexp() != ""); return (a_code != "" || a_bitR != "" || a_hopByHop != "" || a_applicationId != "" || a_sessionId != "" || a_resultCode != "" || a_msisdn != "" || a_imsi != "" || a_serviceContextId != ""); } -bool TestCondition::comply(const anna::DataBlock &message) const throw() { +bool TestDiameterCondition::comply(const anna::DataBlock &message) const throw() { if (a_type == Type::RegexpXml) { anna::diameter::codec::Message codecMsg; @@ -55,7 +55,7 @@ bool TestCondition::comply(const anna::DataBlock &message) const throw() { std::string msgString = codecMsg.asXMLString(); msgString.erase(std::remove(msgString.begin(), msgString.end(), '\n'), msgString.end()); - return re.isLike(msgString); + return re.isLike(msgString); } else if (a_type == Type::RegexpHex) { anna::RegularExpression re(getRegexp()); @@ -147,9 +147,9 @@ bool TestCondition::comply(const anna::DataBlock &message) const throw() { return true; } -anna::xml::Node* TestCondition::asXML(anna::xml::Node* parent) const +anna::xml::Node* TestDiameterCondition::asXML(anna::xml::Node* parent) const throw() { - anna::xml::Node* result = parent->createChild("TestCondition"); + anna::xml::Node* result = parent->createChild("TestDiameterCondition"); if (!exists()) return result; if (a_type == Type::RegexpXml) {