From ecf01e521e9a38e8280d402591874888aea58114 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Kijewski?= Date: Fri, 5 Dec 2014 10:51:00 +0100 Subject: [PATCH] tests: delete queue_fairness The test fails because it assumes the `msg_*` functions to yield, which is unrelated to fairness. --- tests/queue_fairness/Makefile | 10 ---- tests/queue_fairness/main.c | 84 ------------------------------ tests/queue_fairness/tests/01-test | 44 ---------------- 3 files changed, 138 deletions(-) delete mode 100644 tests/queue_fairness/Makefile delete mode 100644 tests/queue_fairness/main.c delete mode 100755 tests/queue_fairness/tests/01-test diff --git a/tests/queue_fairness/Makefile b/tests/queue_fairness/Makefile deleted file mode 100644 index 6d224e0bb6..0000000000 --- a/tests/queue_fairness/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -APPLICATION = queue_fairness -include ../Makefile.tests_common - -BOARD_INSUFFICIENT_RAM := mbed_lpc1768 stm32f0discovery pca10000 pca10005 - -USEMODULE += vtimer - -DISABLE_MODULE += auto_init - -include $(RIOTBASE)/Makefile.include diff --git a/tests/queue_fairness/main.c b/tests/queue_fairness/main.c deleted file mode 100644 index 6d92378085..0000000000 --- a/tests/queue_fairness/main.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (C) 2014 Freie Universität Berlin - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @ingroup tests - * @{ - * @file - * @brief Test if the queue used for messaging is fair. - * @author René Kijewski - * @} - */ - -#include - -#include "msg.h" -#include "sched.h" -#include "thread.h" -#include "vtimer.h" - -#define STACK_SIZE (KERNEL_CONF_STACKSIZE_DEFAULT + KERNEL_CONF_STACKSIZE_MAIN) - -#define NUM_CHILDREN (3) -#define NUM_ITERATIONS (10) - -static char stacks[NUM_CHILDREN][STACK_SIZE]; -static kernel_pid_t pids[NUM_CHILDREN]; -static char names[NUM_CHILDREN][8]; - -static kernel_pid_t parent_pid = KERNEL_PID_UNDEF; - -static void *child_fun(void *arg) -{ - printf("Start of %s.\n", (char*) arg); - - for (int i = 0; i < NUM_ITERATIONS; ++i) { - msg_t m; - m.type = i + 1; - m.content.ptr = (char*) arg; - msg_send(&m, parent_pid); - } - - printf("End of %s.\n", (char*) arg); - return NULL; -} - -int main(void) -{ - puts("Start."); - parent_pid = sched_active_pid; - - for (int i = 0; i < NUM_CHILDREN; ++i) { - snprintf(names[i], sizeof(names[i]), "child%2u", i + 1); - pids[i] = thread_create(stacks[i], - sizeof(stacks[i]), - PRIORITY_MAIN + 1, - CREATE_WOUT_YIELD | CREATE_STACKTEST, - child_fun, - names[i], - names[i]); - } - - int last_iteration = 0; - for (int i = 0; i < NUM_ITERATIONS * NUM_CHILDREN; ++i) { - msg_t m; - msg_receive(&m); - int cur_iteration = (int) m.type; - char *child = (char *) m.content.ptr; - - printf("Received message from %s, iteration %d / %u: %s\n", - child, cur_iteration, NUM_ITERATIONS, - cur_iteration >= last_iteration ? "okay" : "ERROR"); - - last_iteration = cur_iteration; - vtimer_usleep(25 * 1000); - } - - puts("Done."); - return 0; -} diff --git a/tests/queue_fairness/tests/01-test b/tests/queue_fairness/tests/01-test deleted file mode 100755 index 0164072e0d..0000000000 --- a/tests/queue_fairness/tests/01-test +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env expect - -set timeout 5 - -set pid [spawn make term] -puts "-*- Spawened $pid -*-\n" - -set result 0 -expect { - "Start." {} - timeout { - set result 1 - } -} - -while { $result == 0 } { - set result 1 - expect { - "Received message" { - expect { - ": okay" { set result 0 } - ": ERROR" { set result 1 } - timeout { break } - } - } - "Done." { - set result 0 - break - } - timeout { break } - } -} - -if { $result == 0 } { - puts "\n-*- Test successful! -*-\n" -} else { - puts "\n-*- TEST HAD ERRORS! -*-\n" -} -spawn kill -15 $pid -sleep 1 -spawn kill -9 $pid -wait -close -exit $result