diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/test_util.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/test_util.h b/include/test_util.h index 4f76a200c4..f8f50fcc76 100644 --- a/include/test_util.h +++ b/include/test_util.h @@ -58,6 +58,19 @@ } \ } while (0) +#define TEST_ASSERT_MEMSET(d, c, n) \ + do { \ + int __i; \ + for (__i = 0; __i < n; ++__i) \ + if ((d)[__i] != (c)) { \ + ccprintf("%d: ASSERT_MEMSET failed at " \ + "index=%d: %d != %d\n", __LINE__, \ + __i, (int)(d)[__i], (c)); \ + task_dump_trace(); \ + return EC_ERROR_UNKNOWN; \ + } \ + } while (0) + #define TEST_CHECK(n) \ do { \ if (n) \ |