summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-10-27 09:04:53 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-10-28 13:10:47 +0200
commit8744498752ad4f0eaf9fb5640c6a0e0f2dc92fda (patch)
tree3359a898e4776aa776cc3a9021f0d7762f8d58db /testsuites
parentposix: Fix pthread_create() with user stack (diff)
downloadrtems-8744498752ad4f0eaf9fb5640c6a0e0f2dc92fda.tar.bz2
score: Fix _Scheduler_Set_affinity()
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/sptests/spscheduler01/init.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/testsuites/sptests/spscheduler01/init.c b/testsuites/sptests/spscheduler01/init.c
index 0fc1a891fe..77a4e9eacb 100644
--- a/testsuites/sptests/spscheduler01/init.c
+++ b/testsuites/sptests/spscheduler01/init.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2016 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2014, 2017 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
* Dornierstr. 4
@@ -43,6 +43,7 @@ static void test_task_get_set_affinity(void)
rtems_id task_id;
rtems_status_code sc;
cpu_set_t cpusetone;
+ cpu_set_t cpusetall;
cpu_set_t cpuset;
size_t big = 2 * CHAR_BIT * sizeof(cpu_set_t);
size_t cpusetbigsize = CPU_ALLOC_SIZE(big);
@@ -52,6 +53,8 @@ static void test_task_get_set_affinity(void)
CPU_ZERO(&cpusetone);
CPU_SET(0, &cpusetone);
+ CPU_FILL(&cpusetall);
+
sc = rtems_task_create(
rtems_build_name('T', 'A', 'S', 'K'),
2,
@@ -99,6 +102,14 @@ static void test_task_get_set_affinity(void)
rtems_test_assert(CPU_EQUAL(&cpuset, &cpusetone));
+ sc = rtems_task_set_affinity(RTEMS_SELF, sizeof(cpusetall), &cpusetall);
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+
+ sc = rtems_task_get_affinity(task_id, sizeof(cpuset), &cpuset);
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+
+ rtems_test_assert(CPU_EQUAL(&cpuset, &cpusetone));
+
cpusetbigone = CPU_ALLOC(big);
rtems_test_assert(cpusetbigone != NULL);