LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I unit test a VIs with a first call node

I'm trying to use unit test framework to unit test a vi where I've wired a First Call? to a case structure. I'd like to test both the first call case and the nonfirst call case. When I run two test cases, both test cases execute the first call case. I'm using UTF 1.0 

CLED (2016)
0 Kudos
Message 1 of 5
(2,900 Views)

You could create just a single test case and call your VI under test two times (and use some data flow or flat sequence to enforce which call executs first).  Another thought is that maybe you want to put all of your logic into a subVI that takes a "First Call" Boolean as an input, so that the logic is more testable -- then you could put this logic in a wrapper that actually has the First Call? primitive.

Message 2 of 5
(2,879 Views)

Good suggestions. Thanks.

CLED (2016)
0 Kudos
Message 3 of 5
(2,840 Views)

You're welcome.  BTW, I'm not sure how easy my advice is to implement using NI's UTF, since we use VI Tester at JKI (since it's our product).

0 Kudos
Message 4 of 5
(2,830 Views)

Another option recommended to me was to use a conditional disable and put a control in the debug case. That way there's no wrapper required. Of course, then you have to trust the first call node works predictably.

CLED (2016)
0 Kudos
Message 5 of 5
(2,801 Views)