Create a numerics library (LIBBN) API unit test ... for poly.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/poly.c
  • src/libbu/tests/*.c
  • src/libbn/tests/*.c

Code:

  • src/libbn/tests/bu_poly.c
  • src/libbn/tests/CMakeLists.txt
Uploaded Work
File name/URLFile sizeDate submitted
PolyUnitTest.patch2.4 KBDecember 22 2012 05:14 UTC
PolyUnitTestFinal.patch11.3 KBDecember 22 2012 20:14 UTC
PolyUnitTestReformat.patch11.3 KBDecember 24 2012 05:17 UTC
PolyUnitTestFinalFormat.patch11.1 KBDecember 25 2012 22:19 UTC
ReReFomatted.patch11.1 KBDecember 27 2012 15:23 UTC
FinalFormat.patch11.1 KBDecember 27 2012 15:43 UTC
Comments
Gmercer015on December 18 2012 01:23 UTCTask Claimed

I would like to work on this task.

Sean on December 18 2012 02:22 UTCTask Assigned

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

Gmercer015on December 19 2012 21:08 UTCRequest for more time

Could i have my task's time extended? I've been a little caught up lately and would really enjoy being able to finish this task. Thank you

Sean on December 19 2012 21:09 UTCDeadline extended

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

Gmercer015on December 21 2012 04:37 UTCVery close to finishing task

I almost have the task completed, i just need another days time however to completely finish. Only things left are to impliment one more function test and changing around some calls, thank you very much if you can extend the time.

Sean on December 21 2012 05:46 UTCDeadline extended

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

Gmercer015on December 22 2012 05:14 UTCReady for review

The work on this task is ready to be reviewed.

Erik on December 22 2012 13:20 UTCC file not included in patch

Only the CMakeFile.txt changes are in the patch. If you're using subversion to generate the patch, make sure you do an "svn add" to the new file before creating a diff. Please verify the patch is coherent and complete by visually inspecting it before uploading.

Erik on December 22 2012 13:20 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.

Melange on December 22 2012 18:40 UTCTask Reopened

Melange has detected that the final deadline has passed and it has reopened the task.

Gmercer015on December 22 2012 18:40 UTCTask Claimed

I would like to work on this task.

Daniel Rossberg on December 22 2012 19:24 UTCTask Assigned

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

Gmercer015on December 22 2012 20:14 UTCReady for review

The work on this task is ready to be reviewed.

Sean on December 23 2012 06:41 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 December 23 2012 06:46 UTClooking pretty good

The test is looking pretty good but it does not match our source code conventions.  See the top-level HACKING file or other source files for examples.  At a glance, there are numerous indentation and brace placement errors.  Indents should be 4spcs, 1tab, 1tab+4spcs, 2tabs, etc.  Braces are on same line as statement except for functions.  Spaces around built-in keywords (e.g., if, for, etc) aren't right.  Copyright date is wrong.  And you introduce an undocumented hard-coded constant. It needs to be documented in detail or (better, use one of our existing constants like the one used by our ZERO() or EQUAL() macros, which you also should be using.


 

Gmercer015on December 24 2012 05:17 UTCReady for review

The work on this task is ready to be reviewed.

Gmercer015on December 24 2012 05:19 UTCIn the case this task needs more work

Could i receive a time extension by the reviewer in the event that my task is sent back for more work? The pervious submission my task was reviewed but the time was not extended and i almost lost the task when it went up for claiming. I would be happy to continue working on the task until it fits the requirements of the project, thank you very much.

Sean on December 24 2012 16:38 UTCSure

Extensions are no problem.  It look like indentations and else statement placements are still wrong, though.  Please recheck the style described in HACKING and my earlier comment.  Looks almost right, but still significant style errors.

Sean on December 24 2012 16:38 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 December 24 2012 16:38 UTCDeadline extended

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

Sean on December 24 2012 17:15 UTCDeadline extended

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

Gmercer015on December 25 2012 22:20 UTCReady for review

The work on this task is ready to be reviewed.

Sean on December 26 2012 18: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 December 26 2012 18:40 UTCDeadline extended

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

Sean on December 26 2012 18:43 UTCindentation

What did you do to change the indentation?  It looks the same to me.  You fixed the else statements, but that pointed out a different usability issue.  If an 'else' statement requires brackets, you should put them on the 'if' statement too even if it's a one-liner that doesn't technically need it.


Not good:


if (whatever)


    printf("hello");


else {


    printf("hello");


    printf("hello2");


}


 


Good:


if (whatever {


    printf("hello");


} else {


    printf("hello");


    printf("hello");


}


 


Still, don't overlook the indentation style.  4spcs, 1tab, tab+4spcs, 2tabs, etc.


 

Gmercer015on December 27 2012 04:13 UTCThanks!

I appreciate you working me through this formatting issue, i've had some conflicting tips for writing the if-else statements. I will look over the spacing of the code and reformat the if-else statements to what you specified.

Gmercer015on December 27 2012 15:23 UTCReady for review

The work on this task is ready to be reviewed.

Gmercer015on December 27 2012 15:25 UTCModified last existing patch

I'm not completely sure if that was the right thing to do, but i modified the last patch as i am away on vacation and don't have access to a linux enviroment or development tools(win8 platform). I hope the patch still works as expected, i re worked the statements and checked spacing for the entire program.

Andrei Popescu on December 27 2012 15:46 UTCTask Closed

Congratulations, this task has been completed successfully.

Sean on December 28 2012 07:48 UTCindentation

Note that the indentation is still wrong.  You used spaces for indentation and our style calls for mixed spaces and tabs. (4spc, 1tab, 1tab+4spcs, 2tabs, etc).  You've put good effort, but please take note of the this detail in any future patches.

Sean on January 14 2013 15:06 UTCthank you

As GCI comes to a close, we wanted to take the time to say THANK YOU for all your efforts.  This comment interface closes after GCI is over, so you're encouraged to join our mailing list where we'll be announcing contributions from GCI participants like yourelf over the upcoming months: 


https://lists.sourceforge.net/lists/listinfo/brlcad-news


If you've provided your full name, we'll be sure to credit you in our authorship documentation and you'll see your name in a future announcement.  If you contact us at devs@brlcad.org or via IRC, we'll even let you know when your work is integrated and follow up with updates.  You're welcome and encouraged to contact us any time, especially if you have a question about how to continue participating in Open Source after GCI is over, but even if just to keep in touch.  Note that ongoing participation in Open Source is one of the most impressive skills to have on your resumé.  Take care, be well, and thank you again!