Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion utest/ctest.h
Original file line number Diff line number Diff line change
Expand Up @@ -373,12 +373,14 @@ static void __ctest_linkTests(void)
struct ctest ** ctest_end = (struct ctest **)__PNAME(suite, test);

// find begin and end of section by comparing magics
while (1) {
#if 0
while (1) {
struct ctest** t = __CTEST_POINTER_PREV(ctest_begin);
if (t[0] == NULL) break;
if (t[1] != (struct ctest*)__CTEST_MAGIC) break;
ctest_begin = t;
}
#endif
while (1) {
struct ctest** t = __CTEST_POINTER_NEXT(ctest_end);
if (t[0] == NULL) break;
Expand Down
5 changes: 5 additions & 0 deletions utest/test_fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ exit(0);
if (fork_pid == -1) {
perror("fork");
CTEST_ERR("Failed to fork process.");
free(a);free(b);free(c);free(d);
} else if (fork_pid == 0) {
// Compute a DGEMM product in the child process to check that the
// thread pool as been properly been reinitialized after the fork.
Expand All @@ -117,14 +118,17 @@ exit(0);
if (fork_pid_nested == -1) {
perror("fork");
CTEST_ERR("Failed to fork nested process.");
free(a);free(b);free(c);free(d);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad indentation

exit(1);
} else if (fork_pid_nested == 0) {
check_dgemm(a, b, d, c, n);
free(a);free(b);free(c);free(d);
exit(0);
} else {
check_dgemm(a, b, d, c, n);
int child_status = 0;
pid_t wait_pid = wait(&child_status);
free(a);free(b);free(c);free(d);
ASSERT_EQUAL(wait_pid, fork_pid_nested);
ASSERT_EQUAL(0, WEXITSTATUS (child_status));
exit(0);
Expand All @@ -134,6 +138,7 @@ exit(0);
// Wait for the child to finish and check the exit code.
int child_status = 0;
pid_t wait_pid = wait(&child_status);
free(a);free(b);free(c);free(d);
ASSERT_EQUAL(wait_pid, fork_pid);
ASSERT_EQUAL(0, WEXITSTATUS (child_status));
}
Expand Down
2 changes: 2 additions & 0 deletions utest/test_post_fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ exit(0);
#ifdef USE_OPENMP
CTEST_ERR("Number of OpenMP threads was %d in this attempt.",i);
#endif
free(a);free(b);free(c);free(d);
} else if (fork_pid == 0) {
// Just pretend to do something, e.g. call `uname`, then exit
exit(0);
Expand All @@ -137,5 +138,6 @@ exit(0);
}
#endif

free(a);free(b);free(c);free(d);
#endif
}
2 changes: 2 additions & 0 deletions utest/test_post_fork_async.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ exit(0);
if (fork_pid == -1) {
perror("fork");
CTEST_ERR("Failed to fork process.");
free(arr);free(ipiv);
} else if (fork_pid == 0) {
exit(0);
} else {
Expand All @@ -90,5 +91,6 @@ exit(0);
ASSERT_EQUAL(0, WEXITSTATUS (child_status));
}
BLASFUNC(dgetrf)(&n, &n, arr, &n, ipiv, &info);
free(arr);free(ipiv);
#endif
}
Loading