summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2012-11-16 05:00:42 +0000
committerMark Michelson <mmichelson@digium.com>2012-11-16 05:00:42 +0000
commitec68a156191e9d8d6c752b9232b46a29f90a5cbb (patch)
tree07cd28ab4027df616c6a400a678c6b40cc186f06 /tests
parent2b36cbe2d5a387c088f5c4b3cb7a93f869986ee9 (diff)
Test that shutdown callback is called when expected.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376383 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'tests')
-rw-r--r--tests/test_taskprocessor.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_taskprocessor.c b/tests/test_taskprocessor.c
index 424449dd9..2ad172f41 100644
--- a/tests/test_taskprocessor.c
+++ b/tests/test_taskprocessor.c
@@ -239,8 +239,16 @@ AST_TEST_DEFINE(taskprocessor_listener)
goto test_exit;
}
+ tps = ast_taskprocessor_unreference(tps);
+
+ if (!pvt->shutdown) {
+ res = AST_TEST_FAIL;
+ goto test_exit;
+ }
+
test_exit:
ao2_ref(listener, -1);
+ /* This is safe even if tps is NULL */
ast_taskprocessor_unreference(tps);
return res;
}