Jump to content

Strange VI Tester Failure (Object not carried from setUp to test method)


Daklu

Recommended Posts

I ran across a problem in a project where, after creating and initializing the class under test in the setUp VI, unbundling it in the test VI returns a default object rather than the one I instantiated.

setUp.vi

Capture.PNG.741e85a381e319a7d0ef3e5fb445f83d.PNG

 

testCount.vi

Capture.PNG.e2ac12e4eab595da7b883fdc2a39e5ae.PNG

 

I've attached a project with the class under test (ListImp) and two test cases.  Both test cases have (as near as I can tell) identical setUp code and identical code in the test method (testCount).  However, one test passes while the other test fails.  Any idea what's causing this?

[Edit - The about box reports "version 3.0.1.294 (Feb 11 2019)".]

[Edit 2 - Another piece of potentially relevant information is the Test_ListImp..._2 test class was brought forward from an older version of VI Tester.  I don't know what version, but according to my repository it was sometime before Feb. 2013.  The other test class (the one that passed) was created with the current version of VI Tester.] 

Capture.PNG.f4462ebacda0c08e87070338b0e57aa4.PNG

VI Tester Error.zip

Edited by Daklu
  • Like 1
Link to comment
Share on other sites

BTW, (and not related to this thread in any way whatsoever...) I cloned the repo to see if I could implement the changes for Issue #40 .

Package 3.0.2 is available on VIPM.  Should that branch be merged into master or do you have other plans?  (I'm wondering if I should branch from master or 95c579a.)

Capture.thumb.PNG.626ba6c17eaf973dc2607761a93706ee.PNG

Edited by Daklu
Link to comment
Share on other sites

  • 2 months later...

Possibly related, I can't close then reopen a file within a test method.

It feels like the tearDown VI is using the reference created in the setUp VI, without considering that the object being unbundled in tthe tearDown.vi might have been changed by test_CloseOpen.vi

It may be this just isn't allowed, but if so, perhaps it could be more widely documented?

A simple example is attached. It's written with LabVIEW 2019, but I can backsave if needed (not sure if the issue depends on the version though).

The VI Tester version is 3.0.1.294 (Feb 12 2019) according to the About page from the Runner. VI Package manager tells me I've installed the latest version, "v3.0.2.294-1", which mentions a fix for issue #39 in the change list. I'm therefore not exactly sure which version I have, and if I should reinstall things to check for a fix, but I'd guess initially that perhaps I have the latest version and the About page wasn't automatically updated?

Edit: This may not have been the best thread to post to, but continuing to edit here to hopefully reduce the number of emails I may trigger. The issue described here: [FIXED in 3.0] DOM reference is lost when passed from Setup to test VI seems fairly similar in spirit. However, unlike in that case (as far as I could tell from reading), I don't actually open the reference in the Test Suite's new - I only populate a Path control (which I don't change). The reference is opened first in MyTestCase:setUp.vi, and closed in MyTestCase:tearDown.vi (which is where I hit the Error 1), and also closed+reopened (so a new reference, but the same path) in MyTestCase:test_CloseOpen.vi.

When I receive the Error 1 in tearDown calling the object to close the reference, probing the reference shows a seemingly valid reference, which matches the value probing the Open.vi gives during the test.

References-JKI_VI_Tester.zip

Edited by cbutcher
additional information and related link, then 2nd edit for version clarification and #39 reference.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.