Skip to content

TESTS TOOLS - fix warnings #2818

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Sep 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ class GreenteaSerial : public mbed::RawSerial {
};

extern SingletonPtr<GreenteaSerial> greentea_serial;
#endif
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,13 @@ typedef struct {

// Mutex to protect "buf"
SingletonPtr<Mutex> mutex;
#if defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED
static char buf[128];
static SingletonPtr<CircularBuffer<thread_info_t, THREAD_BUF_COUNT> > queue;
#endif

static void send_heap_info(void);
#if defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks a weird construct why not just
#ifdef MBED_STACK_STATS_ENABLED ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've used the same construct as the one which was already there: see here and there.

I believe the intent was to check that MBED_STACK_STATS_ENABLED is defined before testing its value.

static void send_stack_info(void);
static void on_thread_terminate(osThreadId id);
static void enqeue_thread_info(osThreadId id);
Expand All @@ -47,6 +50,7 @@ static void deque_and_print_thread_info(void);
// sprintf uses a lot of stack so use these instead
static uint32_t print_hex(char *buf, uint32_t value);
static uint32_t print_dec(char *buf, uint32_t value);
#endif

void greentea_metrics_setup()
{
Expand All @@ -71,6 +75,7 @@ static void send_heap_info()
greentea_send_kv("max_heap_usage",heap_stats.max_size);
}

#if defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED
MBED_UNUSED static void send_stack_info()
{
mutex->lock();
Expand Down Expand Up @@ -205,3 +210,5 @@ static uint32_t print_dec(char *buf, uint32_t value)

return pos;
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

SingletonPtr<GreenteaSerial> greentea_serial;

GreenteaSerial::GreenteaSerial() : mbed::RawSerial(USBTX, USBRX) {};
GreenteaSerial::GreenteaSerial() : mbed::RawSerial(USBTX, USBRX) {};
1 change: 0 additions & 1 deletion features/frameworks/greentea-client/source/test_env.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,6 @@ int greentea_parse_kv(char *out_key,
break;
}
}
return 0;
}

/**
Expand Down
2 changes: 0 additions & 2 deletions features/frameworks/utest/source/utest_harness.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ bool Harness::run(const Specification& specification)
if (handlers->test_teardown) handlers->test_teardown(0, 0, failure);
test_cases = NULL;
exit(1);
return true;
}

notify_testcases();
Expand All @@ -159,7 +158,6 @@ bool Harness::run(const Specification& specification)
if (handlers->test_teardown) handlers->test_teardown(0, 0, failure);
test_cases = NULL;
exit(1);
return true;
}
return true;
}
Expand Down
1 change: 0 additions & 1 deletion features/frameworks/utest/source/utest_shim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ static int32_t utest_us_ticker_run()
callback();
}
}
return 0;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this not then complain about a function expecting to return a value but not supplying one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the compilers (ARMCC, GCC and IAR) doesn't complain because this functions never returns.
Actually the compiler was complaining of the return statement because it can't be reached.



Expand Down