Skip to content

Commit c32b2cf

Browse files
authored
Merge pull request #3170 from bridadan/fixing_cpp_test_print
[tests] Preventing test from printing before Greentea __sync
2 parents 8490dd4 + 33c8659 commit c32b2cf

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)