Create unit tests for our basic utility library (LIBBU) #3BRL-CAD
Status: ClosedTime to complete: 72 hrs Mentors: starseekerTags: 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
http://sourceforge.net/p/brlcad/code/59264/n/aJanuary 03 2014 00:34 UTC
http://sourceforge.net/p/brlcad/code/59265/n/aJanuary 03 2014 11:06 UTC
Comments
Johannes Schulteon January 2 2014 20:42 UTCTask Claimed

I would like to work on this task.

starseeker on January 3 2014 00:14 UTCTask Assigned

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

Johannes Schulteon January 3 2014 00:34 UTCReady for review

The work on this task is ready to be reviewed.

Johannes Schulteon January 3 2014 00:36 UTCQuestions

When reviewing this, please also take a look at my questions under the other task : http://www.google-melange.com/gci/task/view/google/gci2013/5300578120892416

Sean on January 3 2014 03:28 UTCfew issues

Few issues:


  • Missing header and footer

  • The #include "stdio.h" isn't right, system headers are always in and should come before our headers (and should be preceded by common.h)

  • Numeric constants need to be documented (2147483647)

  • You can skip bu_vls_init(), just use BU_VLS_INIT_ZERO static initializer

  • There's the stray printf at the beginning without context or explanation


 

Sean on January 3 2014 03:28 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.

Johannes Schulteon January 3 2014 11:07 UTCReady for review

The work on this task is ready to be reviewed.

Sean on January 3 2014 14:19 UTCTask Closed

Congratulations, this task has been completed successfully.