Fix any failing unit test #2BRL-CAD
Status: ClosedTime to complete: 100 hrs Mentors: Popescu Andrei, Mihai NeacsuTags: c, validation, code, testing, verification

We have a lot of unit tests. These tests help ensure proper functionality. Sometimes we add new tests and either 1) the test itself has an error or 2) the test exposes an error in our implementation. We have a few right now that report an error and someone needs to figure out if it's because of reason #1 or reason #2, and then fix the error so the test succeeds.

We will keep adding more tasks like this until there are no more failures. There are also tasks for adding more unit tests.

This task involves compiling BRL-CAD, running "make test", and fixing any of the failing unit tests properly. Your fix should repair all of the issues in any given file.

You'll want to first build BRL-CAD from a source tree checkout (see http://brlcad.org/wiki/Compiling) either directly from our repository or using the provided virutal machine (see http://brlcad.org/wiki/Deuces for setup instructions). Compile BRL-CAD, then run our unit tests ("make test" on unix, or select the "test" target on other platforms).

Make sure any changes you make compile cleanly and fix the error.

Submit a summary analysis / description of what the error you fixed was, why it was failing, and what you did to fix it.

Submit your changes as a patch file (you can run "svn diff my_changes.patch").

References:
  • http://brlcad.org/wiki/Compiling
  • http://brlcad.org/wiki/Deuces
Modify:
  • The tests are all in subdirectories, so you can find them easily:
  • src/libbu/tests
  • src/libbn/tests
  • src/librt/tests
  • etc... fix one that is failing.
Uploaded Work
File name/URLFile sizeDate submitted
task-20-fix-bn-vec-ae-tests.diff518 bytesDecember 09 2014 01:12 UTC
Comments
Andromeda Galaxyon December 9 2014 01:02 UTCTask Claimed

I would like to work on this task.

Mihai Neacsu on December 9 2014 01:11 UTCTask Assigned

This task has been assigned to Andromeda Galaxy. You have 100 hours to complete this task, good luck!

Andromeda Galaxyon December 9 2014 01:12 UTCReady for review

The work on this task is ready to be reviewed.

Sean on December 9 2014 06:53 UTCdescription?

Andromeda, can you describe what the error was and what this change to bn_vec_ae is doing (mathematically)?  Obviously you changed it from being fabs(sin(el)) to the (MUCH more expensive...) form of sqrt(1-sin(el)*sin(el)), but what was the flaw in the prior and/or improvement in the latter?


 

Sean on December 9 2014 06:53 UTCTask Closed

Congratulations, this task has been completed successfully.

Andromeda Galaxyon December 9 2014 06:56 UTCMathematical error

That term effectively needs to be the distance from the origin to the area directly below the point at the tip of the vector; the previous form set it to the height of that point, instead of the distance from the center.

Andromeda Galaxyon December 9 2014 06:59 UTCLess expensive mathematically computation

I just realized that sqrt(1-sin^2(z)) = fabs(cos(z)), before committing I'll change it and check that the tests still pass.