diff options
author | Lutz Mueller <lutz@users.sourceforge.net> | 2001-11-18 14:02:41 +0000 |
---|---|---|
committer | Lutz Mueller <lutz@users.sourceforge.net> | 2001-11-18 14:02:41 +0000 |
commit | 0212f6501debcfa9331820722df745269037f714 (patch) | |
tree | d1468d1ea4e543f77e8d43f8bb1fcdd9b0bee6ce /tests/test-gphoto2.c | |
parent | f0cd88526b847f66dde50dd42d08032784034133 (diff) | |
download | libgphoto2-0212f6501debcfa9331820722df745269037f714.tar.gz |
2001-11-18 Lutz M�ller <urc8@rz.uni-karlsruhe.de>
Patch from Ole Aamot <Ole.Aamot@nr.no>:
* tests: Use mcheck.h (useful when searching for mem-leaks).
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@3096 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'tests/test-gphoto2.c')
-rw-r--r-- | tests/test-gphoto2.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test-gphoto2.c b/tests/test-gphoto2.c index f3d3accaf..d74ae47b0 100644 --- a/tests/test-gphoto2.c +++ b/tests/test-gphoto2.c @@ -1,6 +1,9 @@ #include <gphoto2-camera.h> #include <stdio.h> +#ifdef _GNU_SOURCE +#include <mcheck.h> +#endif #define CHECK(f) {int res = f; if (res < 0) {printf ("ERROR: %s\n", gp_result_as_string (res)); return (1);}} @@ -13,6 +16,10 @@ main (int argc, char *argv []) CameraAbilities abilities; int m; +#ifdef _GNU_SOURCE + mtrace(); +#endif + /* * You'll probably want to access your camera. You will first have * to create a camera (that is, allocating the memory). @@ -54,5 +61,15 @@ main (int argc, char *argv []) printf ("Unrefing camera...\n"); CHECK (gp_camera_unref (camera)); +#ifdef _GNU_SOURCE + muntrace(); +#endif + return (0); } + +/* + * Local variables: + * compile-command: "gcc -pedantic -Wstrict-prototypes -O2 -g test-gphoto2.c -o test-gphoto2 `gphoto2-config --cflags --libs` && export MALLOC_TRACE=test-gphoto2.log && ./test-gphoto2 && mtrace ./test-gphoto2 test-gphoto2.log" + * End: + */ |