From 33c8659512cb480f4451b969e8881a91b7c47965 Mon Sep 17 00:00:00 2001 From: Brian Daniels Date: Mon, 31 Oct 2016 14:52:06 -0500 Subject: [PATCH] Preventing test from printing before Greentea __sync This test was causing issues on some platforms because the serial output would get garbled and cause exceptions to occur in the testing tools. This corrects the behavior to follow the other tests. It will now defer all pritning until after the __sync event occurs. --- TESTS/mbedmicro-mbed/cpp/main.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/TESTS/mbedmicro-mbed/cpp/main.cpp b/TESTS/mbedmicro-mbed/cpp/main.cpp index bfa02200ae..fc5bcc21ce 100644 --- a/TESTS/mbedmicro-mbed/cpp/main.cpp +++ b/TESTS/mbedmicro-mbed/cpp/main.cpp @@ -9,8 +9,10 @@ private: const int pattern; public: - Test(const char* _name) : name(_name), pattern(PATTERN_CHECK_VALUE) { - print("init"); + Test(const char* _name, bool print_message=true) : name(_name), pattern(PATTERN_CHECK_VALUE) { + if (print_message) { + print("init"); + } } void print(const char *message) { @@ -39,7 +41,7 @@ public: }; /* Check C++ startup initialisation */ -Test s("Static"); +Test s("Static", false); /* EXPECTED OUTPUT: ******************* @@ -59,6 +61,7 @@ int main (void) { bool result = true; for (;;) { + s.print("init"); // Global stack object simple test s.stack_test(); if (s.check_init() == false)