summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-12-03 13:07:28 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-12-03 13:07:28 +0100
commit26b336f81128b6c51e2757381c19d8cdf0b2c369 (patch)
treed2eb26d3c9c63ab8bf692686de3143cd43dc25ee
parent38354ec4d890c384b5d91738f955ed6aed6d0c1c (diff)
lib: Don't put functional code into asserts
Android apparently compiles with NDEBUG. Which is strongly advised against, since the big pile of asserts mostly check correct usage of the helper code in testcases. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--lib/drmtest.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/drmtest.c b/lib/drmtest.c
index 31303343..94fa6861 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -1106,13 +1106,14 @@ static void fork_helper_exit_handler(int sig)
{
for (int i = 0; i < ARRAY_SIZE(helper_process_pids); i++) {
pid_t pid = helper_process_pids[i];
- int status;
+ int status, ret;
if (pid != -1) {
/* Someone forgot to fill up the array? */
assert(pid != 0);
- assert(kill(pid, SIGQUIT) == 0);
+ ret = kill(pid, SIGQUIT);
+ assert(ret == 0);
while (waitpid(pid, &status, 0) == -1 &&
errno == EINTR)
;
@@ -1174,12 +1175,13 @@ bool __igt_fork_helper(struct igt_helper_process *proc)
*/
void igt_stop_helper(struct igt_helper_process *proc)
{
- int status;
+ int status, ret;
assert(proc->running);
- assert(kill(proc->pid,
- proc->use_SIGKILL ? SIGKILL : SIGQUIT) == 0);
+ ret = kill(proc->pid,
+ proc->use_SIGKILL ? SIGKILL : SIGQUIT);
+ assert(ret == 0);
while (waitpid(proc->pid, &status, 0) == -1 &&
errno == EINTR)
;
@@ -1194,11 +1196,14 @@ void igt_stop_helper(struct igt_helper_process *proc)
static void children_exit_handler(int sig)
{
+ int ret;
+
assert(!test_child);
for (int nc = 0; nc < num_test_children; nc++) {
int status = -1;
- assert(kill(test_children[nc], SIGQUIT) == 0);
+ ret = kill(test_children[nc], SIGQUIT);
+ assert(ret == 0);
while (waitpid(test_children[nc], &status, 0) == -1 &&
errno == EINTR)