Skip to content

Commit 33c8659

Browse files
committed
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.
1 parent 8a9a246 commit 33c8659

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

TESTS/mbedmicro-mbed/cpp/main.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ class Test {
99
const int pattern;
1010

1111
public:
12-
Test(const char* _name) : name(_name), pattern(PATTERN_CHECK_VALUE) {
13-
print("init");
12+
Test(const char* _name, bool print_message=true) : name(_name), pattern(PATTERN_CHECK_VALUE) {
13+
if (print_message) {
14+
print("init");
15+
}
1416
}
1517

1618
void print(const char *message) {
@@ -39,7 +41,7 @@ class Test {
3941
};
4042

4143
/* Check C++ startup initialisation */
42-
Test s("Static");
44+
Test s("Static", false);
4345

4446
/* EXPECTED OUTPUT:
4547
*******************
@@ -59,6 +61,7 @@ int main (void) {
5961
bool result = true;
6062
for (;;)
6163
{
64+
s.print("init");
6265
// Global stack object simple test
6366
s.stack_test();
6467
if (s.check_init() == false)

0 commit comments

Comments
 (0)