LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unit Test Framework: Bug(?) when checking output clusters values by element

I have an issue with UTF in LV2016 that might be connected to:

https://forums.ni.com/t5/LabVIEW/Problems-using-Clusters-or-Arrays-of-Clusters-with-Unit-Test/m-p/33...

 

In a complex cluster which contains other clusters and arrays of clusters one of the contained strings is a dynamically created GUID:

Cluster1 > Cluster6 > GUID-String

Cluster1 contains all sort of types including empty arrays

Cluster6 contains only three other strings and one I32

I tried to set all comparisons for all clusters to "by element" so I can disable comparison of the GUID-string because this will vary at each call. For most clusters that setting works as expected but for some not all contained elements recieve a checkbox. Sometimes it's not even possible to switch to "by element" and the settings remain in a in-between-state:

UTF LV2016 odd cluster out behaviour.png

After I replaced all empty arrays by artificially filled ones (as suggested in the linked discussion as a workaround) it was possible to set the comparisons to "by element" and ignore the GUID-string and the modified arrays.

But that means that I'm NOT comparing all the results of the VI under test that can be compared. The empty arrays are expected and correct results. That seems just wrong to me and the whole behaviour feels like a bug.

 

Is substituting empty arrays before checking them in UTF really the only solution or am I missing something?

0 Kudos
Message 1 of 3
(2,001 Views)

Did you look at the possibility of using setup/teardown VIs as I mentioned in that earlier thread as an alternate option?  Since you can put any code you want in the "teardown" VI, it can do any comparison you need and then output something simple, like a Boolean success flag that checks for True and a "Reason for failure" string that passes if it's blank.

 

It's a lot more work than filling out the normal Unit Test form but when your units get too complex it can be the only choice.

0 Kudos
Message 2 of 3
(1,967 Views)

Hi Kyle97330,

thanks for the answer.

Yes, I'm using setup and teardown VIs. The output is already the result of a teardown VI because the original VI under test returns an LV-Object. I wouldn't be able to compare anything without teardown.

But still, there are arrays of variable size involved and a zero-sized array is a legitimate result in that context.

UTF not only seems to have problems with checking whether an array in an output cluster is empty - it even seems to mess up all other parts of that output cluster if an array in that cluster is empty. And it didn't even warn about.

Of course I can (and did) write a workaround after I found the discussion but I reckon that correctly handling and checking for empty arrays is a basic enough functionality to expect from a paid toolkit. I don't ask for generic digging into object data or analyzing variants.

 

0 Kudos
Message 3 of 3
(1,960 Views)