Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » Pattern "(*)(%[0-9a-fA-F]#2)*"(Pattern "(*)(%[0-9a-fA-F]#2)*" results in strange log output)
Pattern "(*)(%[0-9a-fA-F]#2)*" [message #1817051] Thu, 14 November 2019 17:24 Go to next message
Olaf Bergengruen is currently offline Olaf BergengruenFriend
Messages: 127
Registered: November 2018
Senior Member
Hi Titan-Experts,

The TTCN function below works correctly but produces hundred of strange log lines, all the same:


  /*
   * @desc      restore URL-encoded (or "percent-encoded") URL:
   *            replace all "%XY" with the the respective character corresponding to the hex code XY
   * @param     p_EncodedUrl
   * @return    charstring
   * @status    APPROVED (IMS)
   */
  function f_URL_Decoding(charstring p_EncodedUrl) return charstring
  {
    var charstring v_Url := p_EncodedUrl;
    var charstring v_Pattern := "(*)(%[0-9a-fA-F]#2)*";  /* @sic R5s151006: * at the end sic@ */
    var charstring v_PercentCodedChar;
    var charstring v_HexCode;
    var charstring v_Char;
    var integer v_Pos;
    
    while (true) {
      v_PercentCodedChar := regexp(v_Url, v_Pattern, 1);
      if (v_PercentCodedChar != "") {
        v_Pos := lengthof(regexp(v_Url, v_Pattern, 0));
        v_HexCode := substr(v_PercentCodedChar, 1, 2);
        v_Char := oct2char(hex2oct(str2hex(v_HexCode)));
        v_Url := replace(v_Url, v_Pos, 3, v_Char);
      } else {
        break;
      }
    }
    return v_Url;
  }




And the log file contains hundreds of lines like:

2019/Nov/14 00:21:01.410332 DEBUG IMS_CommonDefs.ttcn:160 regexp(): POSIX ERE equivalent of pattern "(*)(%[0-9a-fA-F]#2)*" is: "^(.*)(%[0-9A-Fa-f]{2}).*$"


What does this mean and how can I get rid of this irritating output? Again, the function works correctly.


Thanks for any hint,
Olaf @ ETSI STF160
Re: Pattern "(*)(%[0-9a-fA-F]#2)*" [message #1817092 is a reply to message #1817051] Fri, 15 November 2019 11:20 Go to previous messageGo to next message
Botond Baranyi is currently offline Botond BaranyiFriend
Messages: 55
Registered: February 2016
Member
Hi Olaf,

The predefined function 'regexp' in TITAN always logs what regular expression the TTCN-3 pattern is converted into.
It's a 'DEBUG' log event, so you can get rid of it by removing the 'DEBUG' flag from the logging options ('FileMask' or 'ConsoleMask') in the configuration file.

Best regards,
Botond Baranyi
Re: Pattern "(*)(%[0-9a-fA-F]#2)*" [message #1817121 is a reply to message #1817092] Fri, 15 November 2019 16:57 Go to previous message
Olaf Bergengruen is currently offline Olaf BergengruenFriend
Messages: 127
Registered: November 2018
Senior Member
Thanks, Botond, that was easy :-)
Olaf
Previous Topic:Eclipse Titan presence on UCAAT 2019
Next Topic:Design of Broadband Micro-Power Wireless Communication Test System Based on TTCN-3
Goto Forum:
  


Current Time: Sat Oct 05 06:52:06 GMT 2024

Powered by FUDForum. Page generated in 0.05024 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top