Skip to content
Permalink
Browse files

subsys/testsuite/ztest: Fix zassert_mem_equal user message printing

This commit fixes the zassert_mem_equal macro to properly print
the formatting string is given as a parameter by the user.
There is an error that is an effect of directly copying the
previous implementation that was using the inline function.

Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
  • Loading branch information...
rakons authored and nashif committed Jun 4, 2019
1 parent 6a6264e commit 8ab22556f6b92af4559035d61e3c71660b1fab86
Showing with 2 additions and 2 deletions.
  1. +2 −2 subsys/testsuite/ztest/include/ztest_assert.h
@@ -206,8 +206,8 @@ static inline void z_zassert(int cond,
* @param size Size of buffers
* @param msg Optional message to print if the assertion fails
*/
#define zassert_mem_equal__(buf, exp, size, msg, ...) \
zassert_equal(memcmp(buf, exp, size), 0, #buf " not equal to " #exp, \
#define zassert_mem_equal__(buf, exp, size, msg, ...) \
zassert(memcmp(buf, exp, size) == 0, #buf " not equal to " #exp, \
msg, ##__VA_ARGS__)

/**

0 comments on commit 8ab2255

Please sign in to comment.
You can’t perform that action at this time.