Module: xenomai-forge
Branch: master
Commit: ebce6da89812e3ba3019ee765d1be4a259661cfa
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=ebce6da89812e3ba3019ee765d1be4a259661cfa

Author: Philippe Gerum <r...@xenomai.org>
Date:   Fri Mar 23 10:10:39 2012 +0100

lib/testsuite: fix expected execution sequence for timer-related tests

First call to timerobj_init() may trigger a switch to secondary mode
over Cobalt, as we create the timer server thread internally. For this
reason, we can't expect the related tests to keep running in primary
mode unaffected when traversing this code.

Fix all expected execution sequences accordingly in the various tests
involved.

---

 lib/alchemy/testsuite/alarm-1.c |    6 +++---
 lib/psos/testsuite/tm-2.c       |    4 +---
 lib/psos/testsuite/tm-3.c       |    4 +---
 lib/psos/testsuite/tm-4.c       |    4 +---
 lib/vxworks/testsuite/wd-1.c    |    4 +---
 5 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/lib/alchemy/testsuite/alarm-1.c b/lib/alchemy/testsuite/alarm-1.c
index 83d236d..79ae458 100644
--- a/lib/alchemy/testsuite/alarm-1.c
+++ b/lib/alchemy/testsuite/alarm-1.c
@@ -53,9 +53,6 @@ static void main_task(void *arg)
 
        traceobj_mark(&trobj, 5);
 
-       ret = rt_alarm_create(&alrm, "ALARM", alarm_handler, &alrm);
-       traceobj_assert(&trobj, ret == 0);
-
        ret = rt_alarm_start(&alrm, 200000000ULL, 200000000ULL);
        traceobj_assert(&trobj, ret == 0);
 
@@ -80,6 +77,9 @@ int main(int argc, char *const argv[])
 
        traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
+       ret = rt_alarm_create(&alrm, "ALARM", alarm_handler, &alrm);
+       traceobj_assert(&trobj, ret == 0);
+
        ret = rt_task_spawn(&t_main, "main_task", 0,  50, 0, main_task, NULL);
        traceobj_assert(&trobj, ret == 0);
 
diff --git a/lib/psos/testsuite/tm-2.c b/lib/psos/testsuite/tm-2.c
index ff40cd6..6a416d2 100644
--- a/lib/psos/testsuite/tm-2.c
+++ b/lib/psos/testsuite/tm-2.c
@@ -7,7 +7,7 @@
 static struct traceobj trobj;
 
 static int tseq[] = {
-       5, 1, 2, 6, 3, 3, 3, 3, 3, 4
+       5, 1, 2, 3, 3, 3, 3, 3, 4
 };
 
 static u_long tid;
@@ -60,8 +60,6 @@ int main(int argc, char *const argv[])
        ret = t_start(tid, 0, task, args);
        traceobj_assert(&trobj, ret == SUCCESS);
 
-       traceobj_mark(&trobj, 6);
-
        traceobj_join(&trobj);
 
        traceobj_verify(&trobj, tseq, sizeof(tseq) / sizeof(int));
diff --git a/lib/psos/testsuite/tm-3.c b/lib/psos/testsuite/tm-3.c
index e1e0480..0a3c1ca 100644
--- a/lib/psos/testsuite/tm-3.c
+++ b/lib/psos/testsuite/tm-3.c
@@ -7,7 +7,7 @@
 static struct traceobj trobj;
 
 static int tseq[] = {
-       7, 1, 2, 8, 3, 4, 5, 6
+       7, 1, 2, 3, 4, 5, 6
 };
 
 static u_long tid;
@@ -69,8 +69,6 @@ int main(int argc, char *const argv[])
        ret = t_start(tid, 0, task, args);
        traceobj_assert(&trobj, ret == SUCCESS);
 
-       traceobj_mark(&trobj, 8);
-
        traceobj_join(&trobj);
 
        traceobj_verify(&trobj, tseq, sizeof(tseq) / sizeof(int));
diff --git a/lib/psos/testsuite/tm-4.c b/lib/psos/testsuite/tm-4.c
index 155391a..5bf2188 100644
--- a/lib/psos/testsuite/tm-4.c
+++ b/lib/psos/testsuite/tm-4.c
@@ -15,7 +15,7 @@
 static struct traceobj trobj;
 
 static int tseq[] = {
-       4, 1, 2, 5, 3
+       4, 1, 2, 3
 };
 
 static u_long tid;
@@ -66,8 +66,6 @@ int main(int argc, char *const argv[])
        ret = t_start(tid, 0, task, args);
        traceobj_assert(&trobj, ret == SUCCESS);
 
-       traceobj_mark(&trobj, 5);
-
        traceobj_join(&trobj);
 
        traceobj_verify(&trobj, tseq, sizeof(tseq) / sizeof(int));
diff --git a/lib/vxworks/testsuite/wd-1.c b/lib/vxworks/testsuite/wd-1.c
index 5b13102..388d1bd 100644
--- a/lib/vxworks/testsuite/wd-1.c
+++ b/lib/vxworks/testsuite/wd-1.c
@@ -10,7 +10,7 @@
 static struct traceobj trobj;
 
 static int tseq[] = {
-       5, 6, 8,
+       5, 6,
        1, 4, 1, 4, 1,
        2, 3, 7
 };
@@ -88,8 +88,6 @@ int main(int argc, char *const argv[])
                        0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
        traceobj_assert(&trobj, tid != ERROR);
 
-       traceobj_mark(&trobj, 8);
-
        traceobj_join(&trobj);
 
        traceobj_verify(&trobj, tseq, sizeof(tseq) / sizeof(int));


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to