Hi,

tannousmarc has left the following comment at Create an utility library (LIBBU) API unit test for bomb.c http://www.google-melange.com/gci/task/view/google/gci2014/6449379632218112:


About


Looked into the bombs.c file, the two functions I came up with that required testing were :

- bu_exit, which should exit the program and return the status sent as a parameter to it.

- bu_bomb, which I tested by seeing if it gets to the end and does not create an infinite lop.

The bu_bomb test was easy to implement, however when I tried returning bu_exit's status, I got an error while compiling because _exit literally kills the process.

After consultation with the mentors over IRC ( Erik, maths, mihai, and andrei ) they suggested creating another process, a child process that would exit, and a parent process that would get its return status. Was a really neat trick, spent a few hours looking into functions and the whole idea behind it, seemed really really nice, I loved it.

Attached is the diff file, please ignore modifications outside of bu_bomb and cmakelists.txt, as these were done for other tasks and not commited to the latest version.

Regards,

Marc


Greetings,
The Google Open Source Programs Team


---
You are receiving this message because you are subscribed to Create an utility library (LIBBU) API unit test for bomb.c. To stop receiving these messages, go to: http://www.google-melange.com/gci/task/view/google/gci2014/6449379632218112.

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Tracker mailing list
brlcad-tracker@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-tracker

Reply via email to