tcunit / TcUnit

An unit testing framework for Beckhoff's TwinCAT 3
Other
271 stars 74 forks source link

Page fault when TotalAsserts equals 0 in FB_AssertResultStatic.AddAssertResult #167

Closed supermedde closed 2 years ago

supermedde commented 3 years ago

pagefault

sagatowski commented 3 years ago

Which version of TcUnit did you run? Which version of TwinCAT? How did you create this issue? Do you have an example project that recreates the problem and that you can post here?

supermedde commented 3 years ago

It occurred running version 1.2.1.0 of de TcUnit library in TwinCAT version 4024.22. I created this issue by calling an instance that inherits from FB_TestSuite every single cycle. I am aware one should not do that. But doing that resulted in TotalAsserts in FB_AssertResultStatic.AddAssertResult being incremented until it tried to access an array index out of bounds. Attached you will find an archive of the plc project that will enable one to reproduce the issue. Untitled1.zip

sagatowski commented 3 years ago

Why aren't you simply calling TcUnit.RUN()? (the proper way)?

sagatowski commented 2 years ago

I'll close this issue. From what I can see, all that needs to be done is to call TcUnit.RUN(). If you find there is still a bug in TcUnit, please re-open it.