<div class="gmail_quote">On Tue, Dec 22, 2009 at 4:54 PM, Bill Lorensen <span dir="ltr"><<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
You can do whatever you want to in a test as long as it is portable.<br>
<div><div></div><div class="h5"><br>
On Tue, Dec 22, 2009 at 4:45 PM, David Doria <<a href="mailto:daviddoria%2Bvtk@gmail.com">daviddoria+vtk@gmail.com</a>> wrote:<br>
>  Tue, Dec 22, 2009 at 4:39 PM, David Cole <<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>> wrote:<br>
>><br>
>> On Tue, Dec 22, 2009 at 4:34 PM, David Doria <<a href="mailto:daviddoria%2Bvtk@gmail.com">daviddoria+vtk@gmail.com</a>><br>
>> wrote:<br>
>>><br>
>>> On Tue, Dec 22, 2009 at 4:21 PM, Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>><br>
>>> wrote:<br>
>>>><br>
>>>> 1) I would modify the current test for triangle.<br>
>>>> 2) When you add the TestPolygon test, check vtkPolygon's coverage to<br>
>>>> see if you can exercise some uncovered code. There are 193 uncovered<br>
>>>> lines of code:<br>
>>>><br>
>>>> <a href="http://www.cdash.org/CDash/viewCoverageFile.php?buildid=498540&fileid=10908473" target="_blank">http://www.cdash.org/CDash/viewCoverageFile.php?buildid=498540&fileid=10908473</a><br>
>>>><br>
>>>> Bill<br>
>>><br>
>>> Ok, I'll add more polygon tests. I've never looked at these coverage<br>
>>> files - I'm assuming that the red 000000 means that line is not tested? Can<br>
>>> you figure out where the line is tested by the number? e.g.<br>
>>><br>
>>> 00037579   void vtkPolygon::ComputeNormal(vtkPoints *p, double *n)<br>
>>><br>
>>> How would you turn 00037579 into a file name?<br>
>><br>
>> The number preceding each line is supposed to be the number of times that<br>
>> line was called. To find callers, grep for the function name, once you find<br>
>> a candidate, set a breakpoint on the line and run a test in the debugger to<br>
>> verify that you can stop there...<br>
>><br>
><br>
> A couple more things...<br>
> 1) Can/should tests use smart pointers?<br>
> 2) Can this function be placed somewhere so it doesn't need to be copied<br>
> into many of the tests?<br>
> // Perform a fuzzy compare of floats/doubles<br>
> template<class A><br>
> bool fuzzyCompare(A a, A b) {<br>
>   return fabs(a - b) < vtkstd::numeric_limits<A>::epsilon();<br>
> }<br>
> Thanks,<br>
><br>
> David<br>
</div></div><div><div></div><div class="h5"></div></div></blockquote></div><br><div>I have written tests for several of the vtkPolygon functions (2 versions of ComputeNormal and IntersectPolygonWithPolygon). Some were very awkward - taking double* input rather than vtkPoints - maybe I will wrap these into </div>
<div><br></div><div>polygon->ComputeNormal(normal);</div><div>and </div><div>polygon->IntersectWithPolygon(polygon2);</div><div><br></div><div>Anyone have a problem with this?</div><div><br></div><div>Is there a way I can verify the coverage increase before committing these? Or should I just look at the dashboard coverage the next day?</div>
<div><br clear="all">Thanks,<br><br>David</div>