#55 AssertEquals_STRING fails to display Error Severity

v1.2.0.0
accepted
None
2022-01-08
2021-12-09
jtebokkel
No

When testing a sanitizing function I loaded a STRING(255) with a string of length 255. When that string fails to be equal I'll get the test marked as failed, but the PLC log doesn't highlight the error. (See attached screen shot)

I'd expect to have a FAILED TEST log message for that test.

I presume it is because comparing two strings of length 255 breaks the messaging system.

T001_Parametrize

METHOD T001_Parametrize
VAR_INPUT
    sTestName : STRING(255);
    val : STRING(255);
    expected : STRING(255);
END_VAR
VAR
    result : STRING(255);
END_VAR

TEST(sTestName);

result := TMT.Sanitize(val);

AssertEquals_STRING(expected, result, 'unexpected sanitize result');

TEST_FINISHED();

Method calls

T001_Parametrize('T001_Parameterize:nothing to do', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris mollis lectus nisi, id suscipit felis porta sit amet. Sed tincidunt pharetra velit vitae molestie. Fusce auctor ornare posuere. Class aptent taciti sociosqu ad litora torquent per conubia id.', 
'/orem ipsum dolor sit amet, consectetur adipiscing elit. Mauris mollis lectus nisi, id suscipit felis porta sit amet. Sed tincidunt pharetra velit vitae molestie. Fusce auctor ornare posuere. Class aptent taciti sociosqu ad litora torquent per conubia id.');

T001_Parametrize(sTestName:='T001_Parametrize:quote_hello', 
             '$'hello, world!$'', 
             '$'$'hello, world!$'$'x');
1 Attachments

Discussion

  • h-hermsen

    h-hermsen - 2021-12-10

    Hi John,

    Thank you for the feedback.
    We will check into this and will use your code verify it.

    To be continued...

     
  • h-hermsen

    h-hermsen - 2021-12-10
    • status: open --> accepted
    • assigned_to: h-hermsen
     
  • h-hermsen

    h-hermsen - 2022-01-08

    Ignore my previous message. In the meanwhile I confirmed the real issue, now searching for root cause

     

Log in to post a comment.