Menu
Logged-In As
ACCOUNTNot Logged In
Create a utility library (LIBBU) API unit test ... for vlb.cBRL-CAD
Status: ClosedTime to complete:
48 hrs
Mentors: Sean
There are more than 300 library functions 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.
This task involves implementing a new unit test for any of LIBBU'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/bu.h
- src/libbu/vlb.c
- src/libbu/tests/*.c
Code:
- src/libbu/tests/bu_vlb.c
- src/libbu/tests/CMakeLists.txt
Uploaded Work
File name/URL | File size | Date submitted | |
---|---|---|---|
test_bu_vlb.patch | 5.4 KB | January 03 2013 04:56 UTC | |
test_bu_vlb.patch | 6.6 KB | January 03 2013 08:23 UTC | |
test_bu_vlb.patch | 8.1 KB | January 04 2013 00:42 UTC | |
test_bu_vlb.patch | 8.8 KB | January 04 2013 07:58 UTC |
I would like to work on this task.
This task has been assigned to Arjun Govindjee. You have 48 hours to complete this task, good luck!
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.
Melange has detected that the final deadline has passed and it has reopened the task.
I would like to work on this task.
Sorry, I forgot I had claimed this task and I've been busy that past 2 days. I am almost done, just working out one segfault issue. I should be done in the next 10 minutes actually.
This task has been assigned to Arjun Govindjee. You have 48 hours to complete this task, good luck!
The work on this task is ready to be reviewed.
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.
Only noticed a few issues on quick inspection:
The work on this task is ready to be reviewed.
I read the whole HACKING file and I noticed a few other things I could fix in my code, so I fixed those too. Hopefully in the future I will be more successful at doing things right the first time.
At the moment it's the same as in vlb.c but you can't be sure that this is true in the future too. Any idea how to solve this? (Maybe with a bu_vlb_capacity() function?)
And why isn't one memset sufficient (line 73 74)?
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.
The bu_vlb_capacity() function is an excellent idea, and I would have done something similar before, but I didn't think that as a unit test developer I should be modifying the code that I was writing a test for. However, it would appear that to prevent my unit test from containing bad code, I should just go ahead and do it.
Also with regard to the double memset, I first wrote all 1s to the bytes and then I set it back to all 0s, because bu_vlb_init, bu_vlb_initialize both use calloc, which zeroes the memory. I figured that just in case the calloc ever actually becomes essential to the operations of vlb (in the future), I should set the buffer back to 0s.
If you think that is a little overcautious/ridiculous (since vlb probably never will require zeroed memory to operate properly), I can remove it.
The work on this task is ready to be reviewed.
Hello !
The test looks great so far, but ther are some issues we need to address:
bu_vlb.c:81:2: error: too few arguments to function ‘bu_vlb_capacity’
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.
Thats weird, not sure how that happened (I forgot to test it before I uploaded it), but everything is fine now.
Also I already have comments explaining things? I suppose I could add a few more.
The work on this task is ready to be reviewed.
Now it looks good.
Thanks for your effort!
If you wish, please leave your name so we can credit you in our authorship.
Congratulations, this task has been completed successfully.
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!