Module: xenomai-jki
Branch: for-upstream
Commit: 072b11fc9d6aa50312c5ffc2d86b08e2f07b407b
URL:    
http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=072b11fc9d6aa50312c5ffc2d86b08e2f07b407b

Author: Jan Kiszka <jan.kis...@siemens.com>
Date:   Tue Apr  3 20:54:47 2012 +0200

testsuite: Add rt-print buffer flushes to native error paths

Avoids reordering of the output.

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>

---

 src/testsuite/regression/native/check.h |    2 ++
 src/testsuite/regression/native/leaks.c |    1 +
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/testsuite/regression/native/check.h 
b/src/testsuite/regression/native/check.h
index 6add7cb..f014b1a 100644
--- a/src/testsuite/regression/native/check.h
+++ b/src/testsuite/regression/native/check.h
@@ -4,11 +4,13 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <rtdk.h>
 
 #define check_native(expr)                                             \
        ({                                                              \
                int rc = (expr);                                        \
                if (rc < 0) {                                           \
+                       rt_print_flush_buffers();                       \
                        fprintf(stderr, "%s:%d: "#expr ": %s\n", __FILE__, 
__LINE__, strerror(-rc)); \
                        exit(EXIT_FAILURE);                             \
                }                                                       \
diff --git a/src/testsuite/regression/native/leaks.c 
b/src/testsuite/regression/native/leaks.c
index a78acf5..67b0968 100644
--- a/src/testsuite/regression/native/leaks.c
+++ b/src/testsuite/regression/native/leaks.c
@@ -40,6 +40,7 @@ unsigned long long get_used(void)
                used += hd.used;
 
        if (used == 0) {
+               rt_print_flush_buffers();
                fprintf(stderr, "Error: could not get size of used memory\n");
                exit(EXIT_FAILURE);
        }


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

Reply via email to