Create a numerics library (LIBBN) API unit test ... for vert_tree.cBRL-CAD
Status: ClosedTime to complete: 48 hrs Mentors: SeanTags: unit test, API, C, Tcl, Python, Ruby

There are more than 300 library functions in our core LIBBN library. As a core library used by nearly every one of BRL-CAD's tools, testing those functions for correct behavior is important.

This task involves implementing a new unit test for any of LIBBN's source files that do not already have a unit test defined. The test should run all of the public functions and be hooked into our build system (if written in C). We have lots of existing unit tests to follow as an example.

You can implement this task in any language you like, but you'll have to bind all of the functions you test.

References:

  • include/bn.h
  • src/libbn/vert_tree.c
  • src/libbu/tests/*.c
  • src/libbn/tests/*.c

Code:

  • src/libbn/tests/bn_vert_tree.c
  • src/libbn/tests/CMakeLists.txt
Uploaded Work
File name/URLFile sizeDate submitted
vert_test.patch12.0 KBJanuary 02 2013 15:48 UTC
vert_test_2.patch19.6 KBJanuary 04 2013 15:49 UTC
vert_test_2_1.patch19.6 KBJanuary 04 2013 15:56 UTC
vert_test_2_2.patch19.6 KBJanuary 04 2013 15:58 UTC
vert_test_2_3.patch19.6 KBJanuary 04 2013 16:01 UTC
Comments
Silvrouson December 29 2012 14:35 UTCTask Claimed

I would like to work on this task.

Harmanpreet Singh on December 29 2012 15:16 UTCTask Assigned

This task has been assigned to Silvrous. You have 48 hours to complete this task, good luck!

Melange on December 31 2012 15:16 UTCInitial Deadline passed

Melange has detected that the initial deadline has passed and it has set the task status to ActionNeeded. The student has 24 hours to submit the work before the task is reopened and sent back to the pool for other students to claim.

Erik on January 1 2013 13:31 UTCDeadline extended

The deadline of the task has been extended with 1 days and 0 hours.

Erik on January 2 2013 14:47 UTCDeadline extended

The deadline of the task has been extended with 0 days and 2 hours.

Silvrouson January 2 2013 15:48 UTCReady for review

The work on this task is ready to be reviewed.

Melange on January 2 2013 18:19 UTCNo more Work can be submitted

Melange has detected that the deadline has passed and no more work can be submitted. The submitted work should be reviewed.

Sean on January 3 2013 05:40 UTCfew issues

The patch looks good, but I did notice a few issues:



  • file header (first line) does not match the actual file name.

  • should use BN_TOL_DIST instead of the hard-coded 0.005 constant unless there's a paricular reason.  if there is a reason, that should be documented with a comment.

  • should make sure ac val when you access av[], otherwise it'll crash just by running the test and expecting a usage statement.

  • you should document the expected usage in the source file and (more briefly) in the CMakeLists.txt file.


Nice inclusion of typo fixes in the related file. :)


Apologies on the delay .. Happy New Year!


 

Sean on January 3 2013 05:40 UTCTask Needs More Work

One of the mentors has sent this task back for more work. Talk to the mentor(s) assigned to this task to satisfy the requirements needed to complete this task, submit your work again and mark the task as complete once you re-submit your work.

Sean on January 3 2013 05:40 UTCDeadline extended

The deadline of the task has been extended with 2 days and 0 hours.

Silvrouson January 4 2013 15:49 UTCReady for review

The work on this task is ready to be reviewed.

Silvrouson January 4 2013 15:52 UTCpossible bug?


Tests 6,10 and 11 fail, but I'm certain the return result should be what I specified in the test. Is it possible that there is a bug in the Add_vert_and_norm() function?

Silvrouson January 4 2013 16:02 UTCformatting

There were a couple of formatting errors, the latest patch (2_3) is be the corect one.


 

Melange on January 5 2013 10:29 UTCNo more Work can be submitted

Melange has detected that the deadline has passed and no more work can be submitted. The submitted work should be reviewed.

Sean on January 5 2013 16:44 UTCTask Closed

Congratulations, this task has been completed successfully.

Sean on January 5 2013 16:47 UTCIt's entirely possible

It's entirely possible that there's a bug in the Vert_test interface.  Frankly, I'm a little dubious of some of our other new unit tests because they didn't encounter (or report) a bug.  It'll take some work to investigate whether you found a bug but it's good work either way.  Thanks for your efforts!