aboutsummaryrefslogtreecommitdiff
path: root/include/test
diff options
context:
space:
mode:
authorDario Binacchi <dariobin@libero.it>2020-03-29 18:04:40 +0200
committerSimon Glass <sjg@chromium.org>2020-04-16 08:07:58 -0600
commit70573c6c46be96d2e60497d8484b9afb119da8c1 (patch)
tree46fd98684c826ea40392d97bf0f4da32f1ac8975 /include/test
parentced1080489077ab9943c319a38c2d89adb215f1f (diff)
downloadu-boot-70573c6c46be96d2e60497d8484b9afb119da8c1.zip
u-boot-70573c6c46be96d2e60497d8484b9afb119da8c1.tar.gz
u-boot-70573c6c46be96d2e60497d8484b9afb119da8c1.tar.bz2
dm: test: add test case for dev_read_u64 function
Add test case to cover dev_read_u64 and dev_read_u64_default functions. Signed-off-by: Dario Binacchi <dariobin@libero.it> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/test')
-rw-r--r--include/test/ut.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/test/ut.h b/include/test/ut.h
index 04df8ba..ab86158 100644
--- a/include/test/ut.h
+++ b/include/test/ut.h
@@ -104,6 +104,22 @@ int ut_check_console_dump(struct unit_test_state *uts, int total_bytes);
} \
}
+/* Assert that two 64 int expressions are equal */
+#define ut_asserteq_64(expr1, expr2) { \
+ u64 _val1 = (expr1), _val2 = (expr2); \
+ \
+ if (_val1 != _val2) { \
+ ut_failf(uts, __FILE__, __LINE__, __func__, \
+ #expr1 " == " #expr2, \
+ "Expected %#llx (%lld), got %#llx (%lld)", \
+ (unsigned long long)_val1, \
+ (unsigned long long)_val1, \
+ (unsigned long long)_val2, \
+ (unsigned long long)_val2); \
+ return CMD_RET_FAILURE; \
+ } \
+}
+
/* Assert that two string expressions are equal */
#define ut_asserteq_str(expr1, expr2) { \
const char *_val1 = (expr1), *_val2 = (expr2); \