#44 See also Ticket #43 TEST_FINISHED_NAMED sets finished flag and immediately clears it

v1.1.0.0
pending
aliazzz
None
2020-06-30
2020-06-03
maoravni
No

FB_TestSuite.SetTestFinished should be:

IF NumberOfTests > 0 THEN
FOR IteratorCounter := 1 TO NumberOfTests BY 1 DO
IF Tests[IteratorCounter].GetName() = TestName THEN
Tests[IteratorCounter].SetFinished();
SetTestFinished := TRUE;
RETURN;
END_IF
SetTestFinished := FALSE;
END_FOR
END_IF

if not for the return, the method resets the flag immediately after setting it. It might also clear other set flags.

Discussion

  • maoravni

    maoravni - 2020-06-30

    I just downloaded RC5. The RETURN statement I suggested adding in the first post was not found in the SetTestFinished method, so I still encounter the same behavior.

    After re-adding the RETURN statement everything works as expected.

    So the ticket is not solved.

     
    👍
    1
  • aliazzz

    aliazzz - 2020-06-03

    Hi,

    Thank you for your effort in this matter.
    In which CfUnit version have you found this omission?

    Would you mind switching to RC4 and confirm if this omission is in there also? RC4 can be found in the trunk, but must be compiled!) It is not the binary version (RC3) sorry for this.

    If you would kindly supply this information, so we can check this issue upstream also.

    With kind regards,

    The CfUnit Team

     
    • maoravni

      maoravni - 2020-06-03

      I don't have SVN, so I used the library in the snapshot, which is 1.0.9.93.

      I also looked in the online code repository, and didn't see the return line.

      The reason I debugged this code in the first place was I used TEST_FINISHED_NAMED to solve the issue I had with parallel multi-cycle tests, and I got an error:
      Failed to find test 'XXXX'.

      When I stepped through the function I saw that when the test was found, the method called
      SetTestFinished := TRUE;
      exited the IF block and then
      SetTestFinished := FALSE;

       
  • aliazzz

    aliazzz - 2020-06-03

    Hi,

    Thank you for bringing this to our attention! It really helps bringing the CfUnit Unit Testing framework to maturity.

    Would you be so kind and send a .projectarchive of your fixed project and fixed CfUnit library?
    I will use them in my testing procedure;

    I'll reproduce your issue using your project and the original RC3 candidate,
    Then I'll reproduce your issue using your project and the original RC4 candidate.
    Afterwards I'll use your suggestion to patch a preliminary RC5 to verify the correct working on the CfUnit verifier and the timed test.
    If the verification of the CfUnit verifier and the TimedTest work as intended, I'll release the patched RC5 binary which will contain this fix in the trunk both binary and as SVN.

    Please update your CfUnit framework to the latest version when it shall be made available.

    With kind regards,

    The CfUnit team

    PS.
    Tip: SVN can downloaded for free and used for free in combination with cForge without a license as the cForge realm is whitelisted by 3S in the SVN plugin

     
  • aliazzz

    aliazzz - 2020-06-03
    • labels: --> See also ticket 42
    • assigned_to: aliazzz
    • Milestone: testresult report --> v1.1.0.0
     
  • aliazzz

    aliazzz - 2020-06-03
    • labels: See also ticket 42 --> See also Ticket #43
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -12,3 +12,5 @@
     END_IF
    
     if not for the return, the method resets the flag immediately after setting it. It might also clear other set flags.
    +
    +
    
     
  • aliazzz

    aliazzz - 2020-06-03
    • summary: TEST_FINISHED_NAMED sets finished flag and immediately clears it --> See also Ticket #43 TEST_FINISHED_NAMED sets finished flag and immediately clears it
     
  • maoravni

    maoravni - 2020-06-03

    Attached CfUnit project archive

     
  • aliazzz

    aliazzz - 2020-06-08
    • labels: See also Ticket #43 -->
    • status: open --> closed
     
  • aliazzz

    aliazzz - 2020-06-08
    • status: closed --> open
     
  • aliazzz

    aliazzz - 2020-06-08
    • status: open --> pending
     
  • aliazzz

    aliazzz - 2020-06-16

    RC5 in the trunk is tested and fixes this issue

     
  • aliazzz

    aliazzz - 2020-06-22

    Hi,

    Would you please provide feedback whether the solution has helped?

    Thank you.

     
  • aliazzz

    aliazzz - 2020-06-30

    Thank you for the feedback.
    Sorry to hear your problem with named tests still persists, so we will recheck this: To be continued.

    PS.
    You can add RETURN in your own copy of the code for now as a quick workaround. Hope this helps you in the mean time.

     
  • aliazzz

    aliazzz - 2020-06-30

    Fixed this issue in RC5.1 for download now

     

Log in to post a comment.