Ensures normalization on waitfe/fc-xml operations
[anna.git] / source / testing / TestCondition.cpp
index 6f0bba0..416b893 100644 (file)
@@ -45,17 +45,7 @@ bool TestDiameterCondition::comply(const anna::DataBlock &message) const throw()
   if (a_type == Type::RegexpXml) {
     anna::diameter::codec::Message codecMsg;
     try { codecMsg.decode(message); } catch (anna::RuntimeException &ex) { ex.trace(); }
-
-    //return codecMsg.isLike(getRegexp());
-    // We will remove LF from both sides to ease regexp management:
-    std::string regexp = getRegexp();
-    regexp.erase(std::remove(regexp.begin(), regexp.end(), '\n'), regexp.end());
-    anna::RegularExpression re(regexp);
-
-    std::string msgString = codecMsg.asXMLString();
-    msgString.erase(std::remove(msgString.begin(), msgString.end(), '\n'), msgString.end());
-
-    return re.isLike(msgString);
+    return codecMsg.isLike(getRegexp());
   }
   else if (a_type == Type::RegexpHex) {
     anna::RegularExpression re(getRegexp());