summaryrefslogtreecommitdiff
path: root/include/test_util.h
diff options
context:
space:
mode:
authorIvan Chen <yulunchen@google.com>2023-05-17 03:32:45 +0000
committerIvan Chen <yulunchen@google.com>2023-05-17 03:32:45 +0000
commitd7c9c6beb03ee5725232b9ac3bfe4825e1e227cb (patch)
tree3a0d6776c0e76e325d1b087cd51a850cb871358e /include/test_util.h
parent8641442366bd7c2c133e302a57f904dfac3c896b (diff)
parentb34dc2ae9022e2fbb57ae6477891ff32954c62fd (diff)
downloadchrome-ec-firmware-brya-14505.B-main.tar.gz
Merge remote-tracking branch cros/main into firmware-brya-14505.B-mainfirmware-brya-14505.B-main
Generated by: util/update_release_branch.py --board brya firmware-brya-14505.B-main Relevant changes: git log --oneline 8641442366..b34dc2ae90 -- board/brya board/brya util/getversion.sh BRANCH=None TEST=`make -j buildall` Force-Relevant-Builds: all Change-Id: I63149b4c1782b3ed57f2556755901c21f5f1e3e9 Signed-off-by: Ivan Chen <yulunchen@google.com>
Diffstat (limited to 'include/test_util.h')
-rw-r--r--include/test_util.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/test_util.h b/include/test_util.h
index 4f9869ab61..54da6a1d6c 100644
--- a/include/test_util.h
+++ b/include/test_util.h
@@ -19,6 +19,7 @@ extern "C" {
#include "ec_commands.h"
#include "math_util.h"
#include "stack_trace.h"
+#include "string.h"
#ifdef CONFIG_ZTEST
#include "ec_tasks.h"
@@ -115,6 +116,19 @@ extern "C" {
} \
} while (0)
+#define TEST_ASSERT_ARRAY_NE(s, d, n) \
+ do { \
+ if (n < 0) \
+ return EC_ERROR_UNKNOWN; \
+ \
+ if (memcmp(&s[0], &d[0], n) == 0) { \
+ ccprintf("%s:%d: ASSERT_ARRAY_NE failed\n", __FILE__, \
+ __LINE__); \
+ task_dump_trace(); \
+ return EC_ERROR_UNKNOWN; \
+ } \
+ } while (0)
+
#define TEST_ASSERT_MEMSET(d, c, n) \
do { \
if (n < 0) \