summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-07-20 09:05:30 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-07-30 09:11:18 +0200
commita1b4af4bbac503df88e89d68e8cb8041f397d24e (patch)
tree6fa0c868e0cd279499f3fc5ed29fc6310e285e8b /testsuites
parentscore: Add self-contained futex implementation (diff)
downloadrtems-a1b4af4bbac503df88e89d68e8cb8041f397d24e.tar.bz2
score: Add scheduler <sys/lock.h> support
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/sptests/spsyslock01/init.c17
-rw-r--r--testsuites/sptests/spsyslock01/spsyslock01.doc5
2 files changed, 22 insertions, 0 deletions
diff --git a/testsuites/sptests/spsyslock01/init.c b/testsuites/sptests/spsyslock01/init.c
index 72e2ad28e7..ec78430eea 100644
--- a/testsuites/sptests/spsyslock01/init.c
+++ b/testsuites/sptests/spsyslock01/init.c
@@ -389,6 +389,20 @@ static void test_futex(test_context *ctx)
rtems_test_assert(ctx->eno[b] == 0);
}
+static void test_sched(void)
+{
+ rtems_test_assert(_Sched_Index() == 0);
+ rtems_test_assert(_Sched_Name_to_index("", 0) == -1);
+ rtems_test_assert(_Sched_Name_to_index("b", 1) == -1);
+ rtems_test_assert(_Sched_Name_to_index("bl", 2) == -1);
+ rtems_test_assert(_Sched_Name_to_index("blu", 3) == -1);
+ rtems_test_assert(_Sched_Name_to_index("blue", 4) == 0);
+ rtems_test_assert(_Sched_Name_to_index("blueX", 5) == 0);
+ rtems_test_assert(_Sched_Processor_count(-1) == 0);
+ rtems_test_assert(_Sched_Processor_count(0) == 1);
+ rtems_test_assert(_Sched_Processor_count(1) == 0);
+}
+
static void mid_task(rtems_task_argument arg)
{
rtems_test_assert(0);
@@ -532,6 +546,7 @@ static void test(void)
test_sem(ctx);
test_sem_prio_wait_order(ctx);
test_futex(ctx);
+ test_sched();
send_event(ctx, 0, EVENT_MTX_DEADLOCK);
@@ -567,6 +582,8 @@ static void Init(rtems_task_argument arg)
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+#define CONFIGURE_SCHEDULER_NAME rtems_build_name('b', 'l', 'u', 'e')
+
#define CONFIGURE_INIT
#include <rtems/confdefs.h>
diff --git a/testsuites/sptests/spsyslock01/spsyslock01.doc b/testsuites/sptests/spsyslock01/spsyslock01.doc
index bf59cebeff..c8ab182810 100644
--- a/testsuites/sptests/spsyslock01/spsyslock01.doc
+++ b/testsuites/sptests/spsyslock01/spsyslock01.doc
@@ -22,9 +22,14 @@ directives:
- _Futex_Wait()
- _Futex_Wake()
- _Futex_Destroy()
+ - _Sched_Count()
+ - _Sched_Index()
+ - _Sched_Name_to_index()
+ - _Sched_Processor_count()
concepts:
- Ensure that self-contained mutexes and recursive mutexes work.
- Ensure that self-contained semaphores work.
- Ensure that self-contained futexes work.
+ - Ensure that <sys/lock.h> scheduler support works.