summaryrefslogtreecommitdiff
path: root/tests/test_threadpool.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2013-01-15 19:44:25 +0000
committerMark Michelson <mmichelson@digium.com>2013-01-15 19:44:25 +0000
commitc6bc51ef28a79303500ab541684e8adc331cc662 (patch)
tree47eec8e82823f419b3179a25517721f250c97ab4 /tests/test_threadpool.c
parentedc2e4dac0a6d532957fd27b6b784232cf2ae55c (diff)
Make the initial size of the threadpool part of the options passed in.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@379123 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'tests/test_threadpool.c')
-rw-r--r--tests/test_threadpool.c36
1 files changed, 24 insertions, 12 deletions
diff --git a/tests/test_threadpool.c b/tests/test_threadpool.c
index bb648571c..1143056c3 100644
--- a/tests/test_threadpool.c
+++ b/tests/test_threadpool.c
@@ -283,6 +283,7 @@ AST_TEST_DEFINE(threadpool_push)
.version = AST_THREADPOOL_OPTIONS_VERSION,
.idle_timeout = 0,
.auto_increment = 0,
+ .initial_size = 0,
};
switch (cmd) {
@@ -306,7 +307,7 @@ AST_TEST_DEFINE(threadpool_push)
goto end;
}
- pool = ast_threadpool_create(info->name, listener, 0, &options);
+ pool = ast_threadpool_create(info->name, listener, &options);
if (!pool) {
goto end;
}
@@ -342,6 +343,7 @@ AST_TEST_DEFINE(threadpool_initial_threads)
.version = AST_THREADPOOL_OPTIONS_VERSION,
.idle_timeout = 0,
.auto_increment = 0,
+ .initial_size = 3,
};
switch (cmd) {
@@ -367,7 +369,7 @@ AST_TEST_DEFINE(threadpool_initial_threads)
goto end;
}
- pool = ast_threadpool_create(info->name, listener, 3, &options);
+ pool = ast_threadpool_create(info->name, listener, &options);
if (!pool) {
goto end;
}
@@ -394,6 +396,7 @@ AST_TEST_DEFINE(threadpool_thread_creation)
.version = AST_THREADPOOL_OPTIONS_VERSION,
.idle_timeout = 0,
.auto_increment = 0,
+ .initial_size = 0,
};
switch (cmd) {
@@ -418,7 +421,7 @@ AST_TEST_DEFINE(threadpool_thread_creation)
goto end;
}
- pool = ast_threadpool_create(info->name, listener, 0, &options);
+ pool = ast_threadpool_create(info->name, listener, &options);
if (!pool) {
goto end;
}
@@ -449,6 +452,7 @@ AST_TEST_DEFINE(threadpool_thread_destruction)
.version = AST_THREADPOOL_OPTIONS_VERSION,
.idle_timeout = 0,
.auto_increment = 0,
+ .initial_size = 0,
};
switch (cmd) {
@@ -473,7 +477,7 @@ AST_TEST_DEFINE(threadpool_thread_destruction)
goto end;
}
- pool = ast_threadpool_create(info->name, listener, 0, &options);
+ pool = ast_threadpool_create(info->name, listener, &options);
if (!pool) {
goto end;
}
@@ -513,6 +517,7 @@ AST_TEST_DEFINE(threadpool_thread_timeout)
.version = AST_THREADPOOL_OPTIONS_VERSION,
.idle_timeout = 2,
.auto_increment = 0,
+ .initial_size = 0,
};
switch (cmd) {
@@ -537,7 +542,7 @@ AST_TEST_DEFINE(threadpool_thread_timeout)
goto end;
}
- pool = ast_threadpool_create(info->name, listener, 0, &options);
+ pool = ast_threadpool_create(info->name, listener, &options);
if (!pool) {
goto end;
}
@@ -581,6 +586,7 @@ AST_TEST_DEFINE(threadpool_one_task_one_thread)
.version = AST_THREADPOOL_OPTIONS_VERSION,
.idle_timeout = 0,
.auto_increment = 0,
+ .initial_size = 0,
};
switch (cmd) {
@@ -605,7 +611,7 @@ AST_TEST_DEFINE(threadpool_one_task_one_thread)
goto end;
}
- pool = ast_threadpool_create(info->name, listener, 0, &options);
+ pool = ast_threadpool_create(info->name, listener, &options);
if (!pool) {
goto end;
}
@@ -663,6 +669,7 @@ AST_TEST_DEFINE(threadpool_one_thread_one_task)
.version = AST_THREADPOOL_OPTIONS_VERSION,
.idle_timeout = 0,
.auto_increment = 0,
+ .initial_size = 0,
};
switch (cmd) {
@@ -687,7 +694,7 @@ AST_TEST_DEFINE(threadpool_one_thread_one_task)
goto end;
}
- pool = ast_threadpool_create(info->name, listener, 0, &options);
+ pool = ast_threadpool_create(info->name, listener, &options);
if (!pool) {
goto end;
}
@@ -747,6 +754,7 @@ AST_TEST_DEFINE(threadpool_one_thread_multiple_tasks)
.version = AST_THREADPOOL_OPTIONS_VERSION,
.idle_timeout = 0,
.auto_increment = 0,
+ .initial_size = 0,
};
switch (cmd) {
@@ -771,7 +779,7 @@ AST_TEST_DEFINE(threadpool_one_thread_multiple_tasks)
goto end;
}
- pool = ast_threadpool_create(info->name, listener, 0, &options);
+ pool = ast_threadpool_create(info->name, listener, &options);
if (!pool) {
goto end;
}
@@ -845,6 +853,7 @@ AST_TEST_DEFINE(threadpool_auto_increment)
.version = AST_THREADPOOL_OPTIONS_VERSION,
.idle_timeout = 0,
.auto_increment = 3,
+ .initial_size = 0,
};
switch (cmd) {
@@ -871,7 +880,7 @@ AST_TEST_DEFINE(threadpool_auto_increment)
goto end;
}
- pool = ast_threadpool_create(info->name, listener, 0, &options);
+ pool = ast_threadpool_create(info->name, listener, &options);
if (!pool) {
goto end;
}
@@ -960,6 +969,7 @@ AST_TEST_DEFINE(threadpool_reactivation)
.version = AST_THREADPOOL_OPTIONS_VERSION,
.idle_timeout = 0,
.auto_increment = 0,
+ .initial_size = 0,
};
switch (cmd) {
@@ -986,7 +996,7 @@ AST_TEST_DEFINE(threadpool_reactivation)
goto end;
}
- pool = ast_threadpool_create(info->name, listener, 0, &options);
+ pool = ast_threadpool_create(info->name, listener, &options);
if (!pool) {
goto end;
}
@@ -1128,6 +1138,7 @@ AST_TEST_DEFINE(threadpool_task_distribution)
.version = AST_THREADPOOL_OPTIONS_VERSION,
.idle_timeout = 0,
.auto_increment = 0,
+ .initial_size = 0,
};
switch (cmd) {
@@ -1153,7 +1164,7 @@ AST_TEST_DEFINE(threadpool_task_distribution)
goto end;
}
- pool = ast_threadpool_create(info->name, listener, 0, &options);
+ pool = ast_threadpool_create(info->name, listener, &options);
if (!pool) {
goto end;
}
@@ -1222,6 +1233,7 @@ AST_TEST_DEFINE(threadpool_more_destruction)
.version = AST_THREADPOOL_OPTIONS_VERSION,
.idle_timeout = 0,
.auto_increment = 0,
+ .initial_size = 0,
};
switch (cmd) {
@@ -1249,7 +1261,7 @@ AST_TEST_DEFINE(threadpool_more_destruction)
goto end;
}
- pool = ast_threadpool_create(info->name, listener, 0, &options);
+ pool = ast_threadpool_create(info->name, listener, &options);
if (!pool) {
goto end;
}