Create unit tests for our basic utility library (LIBBU)BRL-CAD
Status: ClosedTime to complete: 72 hrs Mentors: Daniel RossbergTags: C, unit test, utility

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

References:

  • include/bu.h
  • src/libbu/bomb.c
  • src/libbu/tests/*.c (lots of examples to follow)

Code:

  • src/libbu/tests/bomb.c
  • src/libbu/tests/CMakeLists.txt

This task involves implementing a new unit test for any of LIBBU's source files that do not already have a unit test defined (or any that do not test all functions).  The test should run at least 10 public functions if there are multiple functions defined within one of our source files.

Some files might have LOTS of functions.  You don't have to test them all!  Just test at least 10 of them and if any prove to be challenging, let us know before you invest more than an hour.  Your unit test(s) must be hooked into our build system and "should" pass.  If you find a genuine bug, let us know (we can create follow-on tasks for any you investigate and fix).  We have lots of existing unit tests to follow as an example.

Submit your new unit test and build system changes as a patch file.  Let us know about any problems or bugs encountered.

 

Uploaded Work
File name/URLFile sizeDate submitted
more_vls_tests.diff16.9 KBDecember 23 2013 18:48 UTC
more_vls_tests.diff26.0 KBDecember 23 2013 19:42 UTC
Comments
Peter Amidonon December 23 2013 15:13 UTCTask Claimed

I would like to work on this task.

Harmanpreet on December 23 2013 15:23 UTCTask Assigned

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

Peter Amidonon December 23 2013 18:48 UTCReady for review

The work on this task is ready to be reviewed.

Sean on December 23 2013 19:23 UTCsubtle style errors

Note that you have a few subtle style errors.  The return type for functions belongs on a separate line (i.e., the "static int" portion).  The multi-line comment blocks should look like:


/* These functions ...
* ... current expected value is 1.
*/

Also, your patch uses a vls pointer instead of a vls directly, you should update to the latter:


struct bu_vls vls = BU_VLS_INIT_ZERO;
... use the vls ...
bu_vls_free(vls);

 

Sean on December 23 2013 19:23 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.

Peter Amidonon December 23 2013 19:43 UTCReady for review

The work on this task is ready to be reviewed.

starseeker on December 23 2013 19:58 UTCTask Closed

Congratulations, this task has been completed successfully.