[asterisk-commits] may: branch may/ooh323_qsig r376384 - in /team/may/ooh323_qsig: ./ include/as...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Nov 16 10:43:32 CST 2012
Author: may
Date: Fri Nov 16 10:43:23 2012
New Revision: 376384
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=376384
Log:
Migrate hashtest/hashtest2 to be unit tests.
Both hashtest and hashtest2 are manual testing apps that thrash hash
tables (hashtab and ao2 containers, respectively), by spinning up
several threads that randomly insert, delete, lookup and iterate over
the hash table. If the app doesn't crash, the hash table probably passes
the test. Those utils are not a part of the typical Asterisk build, so
they do not usually get compiled. This all makes them less that useful.
This patch removes those manual test programs and replaces them with
Asterisk unit test modules (test_{hashtab,astobj2}_thrash.so). It also
attempts to make the tests more deterministic.
* Rather than spinning up some number of threads that operate on the
hash table randomly, spin up four threads that concurrenly add,
remove, lookup and iterate over the hash table.
* Each thread checks the state of the hash table both during and after
execution, and indicates a test failure if things are not as expected.
* Each thread times out after 60 seconds to prevent deadlocking the unit
test run.
(closes issue ASTERISK-20505)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2189/
........
Merged revisions 376306 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 376315 from http://svn.asterisk.org/svn/asterisk/branches/10
........
Merged revisions 376339 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 376341 from http://svn.asterisk.org/svn/asterisk/trunk
Added:
team/may/ooh323_qsig/tests/test_astobj2_thrash.c
- copied unchanged from r376341, trunk/tests/test_astobj2_thrash.c
team/may/ooh323_qsig/tests/test_hashtab_thrash.c
- copied unchanged from r376341, trunk/tests/test_hashtab_thrash.c
Removed:
team/may/ooh323_qsig/utils/hashtest.c
team/may/ooh323_qsig/utils/hashtest2.c
Modified:
team/may/ooh323_qsig/ (props changed)
team/may/ooh323_qsig/include/asterisk/hashtab.h
team/may/ooh323_qsig/utils/Makefile
team/may/ooh323_qsig/utils/utils.xml
Propchange: team/may/ooh323_qsig/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.
Propchange: team/may/ooh323_qsig/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Nov 16 10:43:23 2012
@@ -1,3 +1,3 @@
/branches/11:372696
/team/mmichelson/private/phones-trunk:358764-361321
-/trunk:357542,368181-369527,369613
+/trunk:357542,368181-369527,369613,376341
Propchange: team/may/ooh323_qsig/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Nov 16 10:43:23 2012
@@ -1,1 +1,1 @@
-/trunk:1-376317
+/trunk:1-376317,376341
Modified: team/may/ooh323_qsig/include/asterisk/hashtab.h
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/include/asterisk/hashtab.h?view=diff&rev=376384&r1=376383&r2=376384
==============================================================================
--- team/may/ooh323_qsig/include/asterisk/hashtab.h (original)
+++ team/may/ooh323_qsig/include/asterisk/hashtab.h Fri Nov 16 10:43:23 2012
@@ -23,6 +23,9 @@
* \brief Generic (perhaps overly so) hashtable implementation
* \ref AstHash
*/
+
+#include "asterisk/lock.h"
+
/*! \page AstHash Hash Table support in Asterisk
A hash table is a structure that allows for an exact-match search
Modified: team/may/ooh323_qsig/utils/Makefile
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/utils/Makefile?view=diff&rev=376384&r1=376383&r2=376384
==============================================================================
--- team/may/ooh323_qsig/utils/Makefile (original)
+++ team/may/ooh323_qsig/utils/Makefile Fri Nov 16 10:43:23 2012
@@ -88,7 +88,7 @@
rm -f *.s *.i
rm -f md5.c strcompat.c ast_expr2.c ast_expr2.h ast_expr2f.c pbx_ael.c pval.c hashtab.c lock.c
rm -f aelparse.c aelbison.c conf2ael
- rm -f utils.c strings.c threadstorage.c sha1.c astobj2.c hashtest2 hashtest refcounter
+ rm -f utils.c strings.c threadstorage.c sha1.c astobj2.c refcounter
rm -f db1-ast/.*.d
@$(MAKE) -C db1-ast clean
@@ -175,11 +175,6 @@
$(ECHO_PREFIX) echo " [CP] $(subst $(ASTTOPDIR)/,,$<) -> $@"
$(CMD_PREFIX) cp "$<" "$@"
-hashtest2.o: _ASTCFLAGS+=-O0
-hashtest2: hashtest2.o md5.o lock.o utils.o strings.o astobj2.o sha1.o strcompat.o threadstorage.o clicompat.o poll.o
-
-hashtest: hashtest.o md5.o hashtab.o lock.o utils.o strings.o sha1.o strcompat.o threadstorage.o clicompat.o poll.o
-hashtest.o: _ASTCFLAGS+=-O0
refcounter: refcounter.o md5.o hashtab.o lock.o utils.o strings.o sha1.o strcompat.o threadstorage.o clicompat.o poll.o
refcounter.o: _ASTCFLAGS+=-O0
Modified: team/may/ooh323_qsig/utils/utils.xml
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_qsig/utils/utils.xml?view=diff&rev=376384&r1=376383&r2=376384
==============================================================================
--- team/may/ooh323_qsig/utils/utils.xml (original)
+++ team/may/ooh323_qsig/utils/utils.xml Fri Nov 16 10:43:23 2012
@@ -32,14 +32,6 @@
<defaultenabled>no</defaultenabled>
<support_level>extended</support_level>
</member>
- <member name="hashtest">
- <defaultenabled>no</defaultenabled>
- <support_level>extended</support_level>
- </member>
- <member name="hashtest2">
- <defaultenabled>no</defaultenabled>
- <support_level>extended</support_level>
- </member>
<member name="muted">
<defaultenabled>no</defaultenabled>
<support_level>extended</support_level>
More information about the asterisk-commits
mailing list