1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00
Commit Graph

30 Commits

Author SHA1 Message Date
Anoop C S
661b4edd03 lib/talloc: Fix CID 1291639 Missing unlock
Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-06 22:27:21 +02:00
Anoop C S
f57a235a1f lib/talloc: Fix CID 1291640 Missing unlock
Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-06 22:27:20 +02:00
Jeremy Allison
fdb16dd247 lib: talloc: tests - add test_pthread_talloc_passing() testing talloc in a pthread environment.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo <simo@samba.org>
Reviewed-by: "Stefan (metze) Metzmacher" <metze@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Mar 17 19:23:29 CET 2015 on sn-devel-104
2015-03-17 19:23:29 +01:00
Jeremy Allison
6b0cecee1b lib: talloc: Test suite for the new destructor reparent logic.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sun Mar  8 20:52:43 CET 2015 on sn-devel-104
2015-03-08 20:52:43 +01:00
Stefan Metzmacher
8fbb81923d talloc/tests: avoid some unused variable warnings
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-16 17:21:04 +02:00
Volker Lendecke
256d10f579 talloc: Test the pooled object
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-09-08 11:34:07 +02:00
Volker Lendecke
20ad6d7aa3 talloc: Allow nested pools.
Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Jeremy Allison <jra@samba.org>
2013-09-08 11:34:06 +02:00
Jeremy Allison
cbfc3efbfd Add simple limited pool tests to test_memlimit().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
2013-08-27 15:44:20 -07:00
Simo Sorce
7d7e33c624 Add tests for talloc_memlimit
Autobuild-User(master): Simo Sorce <idra@samba.org>
Autobuild-Date(master): Fri Oct  5 07:36:38 CEST 2012 on sn-devel-104
2012-10-05 07:36:38 +02:00
Rusty Russell
8893215aaf talloc: use a struct for pool headers.
This neatens the code a bit (we should do a similar thing for all the
TALLOC_CHUNK macros).

Two subtler changes:
(1) As a result of the struct, we actually pack object_count into the 
    talloc header on 32-bit platforms (since the header is 40 bytes, but
    needs to be 16-byte aligned).
(2) I avoid VALGRIND_MAKE_MEM_UNDEFINED on memmove when we resize the
    only entry in a pool; that's done later anyway.

With -O2 on my 11.04 Ubuntu 32-bit x86 laptop, the talloc_pool speed as
measured by testsuite.c actually increases 10%.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18 04:53:31 +09:30
Stefan Metzmacher
91ffcdd5a9 talloc/testsuite: fix compiler warnings
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Jan 10 13:31:33 CET 2012 on sn-devel-104
2012-01-10 13:31:33 +01:00
Stefan Metzmacher
04fd3a9d69 talloc/testsuite: remove #if _SAMBA_BUILD_==3
We don't include "includes.h" anymore...

metze
2011-10-22 09:28:26 +02:00
Andrew Tridgell
73677875b4 talloc: check block count aftter references test
Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
2011-08-04 16:17:25 +10:00
Andrew Tridgell
d004fd0b53 talloc: added test suite for talloc_free_children()
this tests the fix from Simo

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Fri Jul 29 11:30:13 CEST 2011 on sn-devel-104
2011-07-29 11:30:13 +02:00
Stefan Metzmacher
37b2130ed9 talloc: test talloc_steal out of a talloc_pool
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue May 17 09:43:01 CEST 2011 on sn-devel-104
2011-05-17 09:43:01 +02:00
Stefan Metzmacher
16cc52cf70 talloc: add memset() calls to test_pool()
This way we the pool based valgrind code.

metze
2011-05-17 08:22:25 +02:00
Stefan Metzmacher
eb0e276f3a talloc/testsuite: avoid memory leak reported by valgrind
metze

Signed-off-By: Andrew Tridgell <tridge@samba.org>

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Apr  8 10:15:41 CEST 2011 on sn-devel-104
2011-04-08 10:15:40 +02:00
Stefan Metzmacher
f9fdef870e talloc/testsuite: test more talloc_pool related things
metze

Signed-off-By: Andrew Tridgell <tridge@samba.org>
2011-04-08 09:28:10 +02:00
Andrew Tridgell
66db49e35f talloc: added a test for the use after free Rusty found 2011-01-05 06:37:07 +01:00
Brad Hards
10b1ed670f talloc: Fix warnings in test code
This should not change any behaviour - the intent is just to reduce
the "nuisance" warnings.

Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Jan  3 11:12:39 CET 2011 on sn-devel-104
2011-01-03 11:12:39 +01:00
Andrew Tridgell
45be1c7ba4 talloc: there is no ambiguity when freeing a ptr with a null parent
when a ptr has a single reference and a NULL parent, then
talloc_free(ptr) is not ambiguous, as the caller could not have done a
talloc_free(NULL) to free the memory

Pair-Programmed-With: Rusty Russell <rusty@samba.org>
2010-04-20 15:50:27 +10:00
Andrew Tridgell
08faa3a43c talloc: testsuite should use <talloc.h> not "talloc.h"
if we are using the system talloc, the testsuite needs to use the
system talloc.h
2010-03-29 21:34:29 +11:00
Andrew Tridgell
3c5d763962 talloc: fixed talloc_disable_null_tracking()
When we disable null tracking, we need to move any existing objects
that are under the null_context to be parented by the true NULL
context.

We also need a new talloc_enable_null_tracking_no_autofree() function,
as the talloc testsuite cannot cope with the moving of the autofree
context under the null_context as it wants to check exact counts of
objects under the null_context, and smbtorture has a large number of
objects in the autofree_context from .init functions
2009-09-20 13:14:40 -07:00
Stefan Metzmacher
ed384e8aac talloc/testsuite: use talloc_set_log_fn() and log to stdout
metze
2009-08-24 16:29:58 +10:00
Stefan Metzmacher
84810d7182 talloc/testsuite: report __location__ of testsuite failures
metze
2009-08-24 16:29:57 +10:00
Stefan Metzmacher
f8559b8238 talloc/testsuite: add infrastructure to test aborts
metze
2009-08-24 16:29:57 +10:00
Stefan Metzmacher
13227f83b9 talloc/testsuite: reset the globals after each subtest
metze
2009-08-24 16:29:57 +10:00
Andrew Tridgell
34d6d7cec8 fixed the talloc testsuite for the recent changes 2009-07-01 16:37:33 +10:00
Stefan Metzmacher
2019a98e46 lib/talloc: move main() out of testsuite.c
metze
2008-09-22 00:20:39 +02:00
Jelmer Vernooij
94855cd692 Move common libraries from root to lib/. 2008-09-17 14:11:12 +02:00