From 4f13ebef5d6711ac121b9c41e2fbbe2cd3b6da0e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 29 Sep 2004 06:31:14 +0000 Subject: r2744: ben elliston taught me about gcov today, which allows you to measure the % coverage in terms of lines of code of a test suite. I thought a good first place to start with gcov was the talloc test suite. When I started the test suite covered about 60% of all lines of code in talloc.c, and now it covers about 99%. The only lines not covered are talloc corruption errors, as that would cause smb_panic() to fire. It will be interesting to try gcov on the main Samba test suite for smbd. We won't achieve 100% coverage, but it would be nice to get to 90% or more. I also modified the talloc.c sources to be able to be build standalone, using: gcc -c -D_STANDALONE_ -Iinlcude lib/talloc.c that should make it much easier to re-use talloc in other projects (This used to be commit 8d4dc99b82efdf24b6811851c7bdd4af5a4c52c9) --- talloc_guide.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'talloc_guide.txt') diff --git a/talloc_guide.txt b/talloc_guide.txt index 7d727c5cb2..745426730c 100644 --- a/talloc_guide.txt +++ b/talloc_guide.txt @@ -125,7 +125,9 @@ After creating a reference you can free it in one of the following ways: - you can talloc_free() a parent of the original pointer. That will - destroy the reference and make the pointer a child of "context". + destroy the reference and make the pointer a child of the + "context" argument from the most recently called + talloc_reference() on the pointer. - you can talloc_free() the pointer itself. That will destroy the most recently established reference to the pointer and leave the -- cgit