summaryrefslogtreecommitdiff
path: root/src/test/tinytest.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/tinytest.c')
-rw-r--r--src/test/tinytest.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/test/tinytest.c b/src/test/tinytest.c
index 27fa94c2ca..4d9afacce4 100644
--- a/src/test/tinytest.c
+++ b/src/test/tinytest.c
@@ -73,7 +73,7 @@ static void usage(struct testgroup_t *groups, int list_groups)
__attribute__((noreturn));
static enum outcome
-_testcase_run_bare(const struct testcase_t *testcase)
+testcase_run_bare_(const struct testcase_t *testcase)
{
void *env = NULL;
int outcome;
@@ -100,7 +100,7 @@ _testcase_run_bare(const struct testcase_t *testcase)
#define MAGIC_EXITCODE 42
static enum outcome
-_testcase_run_forked(const struct testgroup_t *group,
+testcase_run_forked_(const struct testgroup_t *group,
const struct testcase_t *testcase)
{
#ifdef _WIN32
@@ -119,7 +119,7 @@ _testcase_run_forked(const struct testgroup_t *group,
DWORD exitcode;
if (!in_tinytest_main) {
- printf("\nERROR. On Windows, _testcase_run_forked must be"
+ printf("\nERROR. On Windows, testcase_run_forked_ must be"
" called from within tinytest_main.\n");
abort();
}
@@ -165,7 +165,7 @@ _testcase_run_forked(const struct testgroup_t *group,
int test_r, write_r;
char b[1];
close(outcome_pipe[0]);
- test_r = _testcase_run_bare(testcase);
+ test_r = testcase_run_bare_(testcase);
assert(0<=(int)test_r && (int)test_r<=2);
b[0] = "NYS"[test_r];
write_r = (int)write(outcome_pipe[1], b, 1);
@@ -219,9 +219,9 @@ testcase_run_one(const struct testgroup_t *group,
}
if ((testcase->flags & TT_FORK) && !(opt_forked||opt_nofork)) {
- outcome = _testcase_run_forked(group, testcase);
+ outcome = testcase_run_forked_(group, testcase);
} else {
- outcome = _testcase_run_bare(testcase);
+ outcome = testcase_run_bare_(testcase);
}
if (outcome == OK) {
@@ -247,7 +247,7 @@ testcase_run_one(const struct testgroup_t *group,
}
int
-_tinytest_set_flag(struct testgroup_t *groups, const char *arg, unsigned long flag)
+tinytest_set_flag_(struct testgroup_t *groups, const char *arg, unsigned long flag)
{
int i, j;
size_t length = LONGEST_TEST_NAME;
@@ -279,7 +279,7 @@ usage(struct testgroup_t *groups, int list_groups)
puts(" Use --list-tests for a list of tests.");
if (list_groups) {
puts("Known tests are:");
- _tinytest_set_flag(groups, "..", 0);
+ tinytest_set_flag_(groups, "..", 0);
}
exit(0);
}
@@ -322,28 +322,28 @@ tinytest_main(int c, const char **v, struct testgroup_t *groups)
}
} else {
const char *test = v[i];
- int flag = _TT_ENABLED;
+ int flag = TT_ENABLED_;
if (test[0] == ':') {
++test;
flag = TT_SKIP;
} else {
++n;
}
- if (!_tinytest_set_flag(groups, test, flag)) {
+ if (!tinytest_set_flag_(groups, test, flag)) {
printf("No such test as %s!\n", v[i]);
return -1;
}
}
}
if (!n)
- _tinytest_set_flag(groups, "..", _TT_ENABLED);
+ tinytest_set_flag_(groups, "..", TT_ENABLED_);
setvbuf(stdout, NULL, _IONBF, 0);
++in_tinytest_main;
for (i=0; groups[i].prefix; ++i)
for (j=0; groups[i].cases[j].name; ++j)
- if (groups[i].cases[j].flags & _TT_ENABLED)
+ if (groups[i].cases[j].flags & TT_ENABLED_)
testcase_run_one(&groups[i],
&groups[i].cases[j]);
@@ -362,13 +362,13 @@ tinytest_main(int c, const char **v, struct testgroup_t *groups)
}
int
-_tinytest_get_verbosity(void)
+tinytest_get_verbosity_(void)
{
return opt_verbosity;
}
void
-_tinytest_set_test_failed(void)
+tinytest_set_test_failed_(void)
{
if (opt_verbosity <= 0 && cur_test_name) {
if (opt_verbosity==0) puts("");
@@ -379,7 +379,7 @@ _tinytest_set_test_failed(void)
}
void
-_tinytest_set_test_skipped(void)
+tinytest_set_test_skipped_(void)
{
if (cur_test_outcome==OK)
cur_test_outcome = SKIP;