diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-11-06 07:56:17 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-11-06 09:06:20 +0100 |
commit | 7b00c2fac57740963d3c4d8bf1cf5eab3a31f22e (patch) | |
tree | 51fa24406cfa7db08a25dc1d7588f4854c7ad3f9 /testsuites/samples/loopback/init.c | |
parent | fsjffs2gc01: Fix sporadic test failures (diff) | |
download | rtems-7b00c2fac57740963d3c4d8bf1cf5eab3a31f22e.tar.bz2 |
tests: Use <tmacros.h> in all tests
Update #3170.
Update #3199.
Diffstat (limited to 'testsuites/samples/loopback/init.c')
-rw-r--r-- | testsuites/samples/loopback/init.c | 33 |
1 files changed, 3 insertions, 30 deletions
diff --git a/testsuites/samples/loopback/init.c b/testsuites/samples/loopback/init.c index 0ba3e65a39..d537731bba 100644 --- a/testsuites/samples/loopback/init.c +++ b/testsuites/samples/loopback/init.c @@ -8,9 +8,7 @@ #include "config.h" #endif -#include <rtems/test.h> - -#include <bsp.h> +#include <tmacros.h> const char rtems_test_name[] = "LOOPBACK"; @@ -75,21 +73,6 @@ struct rtems_bsdnet_config rtems_bsdnet_config = { }; /* - * Thread-safe output routines - */ -static rtems_id printMutex; -static void printSafe(const char *fmt, ...) -{ - va_list args; - va_start(args, fmt); - rtems_semaphore_obtain(printMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); - vprintf(fmt, args); - rtems_semaphore_release(printMutex); - va_end(args); -} -#define printf printSafe - -/* * Spawn a task */ static void spawnTask(rtems_task_entry entryPoint, rtems_task_priority priority, rtems_task_argument arg) @@ -246,20 +229,10 @@ static rtems_task clientTask(rtems_task_argument arg) rtems_task Init (rtems_task_argument ignored) { - rtems_status_code sc; - rtems_print_printer_fprintf_putc(&rtems_test_printer); - rtems_test_begin(); + TEST_BEGIN(); - sc = rtems_semaphore_create(rtems_build_name('P','m','t','x'), - 1, - RTEMS_PRIORITY|RTEMS_BINARY_SEMAPHORE|RTEMS_INHERIT_PRIORITY| - RTEMS_NO_PRIORITY_CEILING|RTEMS_LOCAL, - 0, - &printMutex); - if (sc != RTEMS_SUCCESSFUL) - rtems_panic("Can't create printf mutex:", rtems_status_text(sc)); printf("\"Network\" initializing!\n"); rtems_bsdnet_initialize_network(); printf("\"Network\" initialized!\n"); @@ -286,6 +259,6 @@ Init (rtems_task_argument ignored) spawnTask(clientTask, 120, 6); rtems_task_wake_after(500); - rtems_test_end(); + TEST_END(); exit( 0 ); } |