aboutsummaryrefslogtreecommitdiffstats
path: root/man/mt_run.3
diff options
context:
space:
mode:
authorMichał Łyszczek <michal.lyszczek@bofc.pl>2018-10-08 20:06:30 +0200
committerMichał Łyszczek <michal.lyszczek@bofc.pl>2018-10-08 20:06:30 +0200
commit7ba71da5fd85306648bacdcb416617f7133d8f11 (patch)
tree55eef4ad201961bafc8e75ebb9bffe42ab93c08a /man/mt_run.3
parentf1ba3506906cda3d88244fcb340041093c9a3156 (diff)
downloadmtest-7ba71da5fd85306648bacdcb416617f7133d8f11.tar.gz
mtest-7ba71da5fd85306648bacdcb416617f7133d8f11.tar.bz2
mtest-7ba71da5fd85306648bacdcb416617f7133d8f11.zip
add: manuals for param tests
Diffstat (limited to 'man/mt_run.3')
-rw-r--r--man/mt_run.330
1 files changed, 28 insertions, 2 deletions
diff --git a/man/mt_run.3 b/man/mt_run.3
index 456e87a..17cba99 100644
--- a/man/mt_run.3
+++ b/man/mt_run.3
@@ -9,11 +9,17 @@ c/c++
.PP
.B #include <mtest.h>
.PP
-.BI "void (*" function_name ")(void)
+.BI "void (*" function_name ")(void)"
.br
+.BI "void (*" function_name_param ")(void *" parameter ")"
+.PP
.BI "mt_run(" function_name ")"
.br
+.BI "mt_run_param(" function_name_param ", " parameter ")"
+.br
.BI "mt_run_named(" function_name ", " test_name ")"
+.br
+.BI "mt_run_named_param(" function_name_param ", " parameter ", " test_name ")"
.PP
.BI "static void (*" mt_prepare_test ")(void)"
.br
@@ -48,7 +54,15 @@ that will be printed instead of
when reporting test results.
.I test_name
should be simple
-. Bconst char *.
+.B const char *.
+.PP
+.BR mt_run_param (3)
+and
+.BR mt_run_named_param (3)
+works in the same way as they non-parameter counterpart, but
+.I parameter
+will be passed to
+.IR function_name_param .
.PP
Optionally user can also set two function pointers
.I mt_prepare_test
@@ -75,6 +89,11 @@ c/c++
mt_defs();
+ static void test_param(void *param)
+ {
+ mt_assert(bar((int *)i) == 0);
+ }
+
static void test(void)
{
mt_assert(foo() == 0);
@@ -82,10 +101,17 @@ c/c++
int main(void)
{
+ int i;
+
mt_run(test);
mt_run_named(test, "test param 1");
mt_run_named(test, "test_param 2");
+ for (i = 0; i != 5; ++i)
+ {
+ mt_run_param(test_param, &i);
+ }
+
mt_return();
}
.EX