summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Peress <peress@chromium.org>2019-10-10 13:06:46 -0600
committerCommit Bot <commit-bot@chromium.org>2019-10-12 19:42:56 +0000
commit57eac6b37e1565bad779ef8fa7cdd77085f489a1 (patch)
treefbcef5dbfc7492de02b03f4a82adc2b9f39c0fea
parenta6c2477aca71c0dd3aed21d34009aecf056a6f4a (diff)
downloadchrome-ec-stabilize-12593.B.tar.gz
common:test: Add comparators to test_util.hstabilize-12593.B
Add <, <=, >, >= tests to test_util.h BUG=None BRANCH=None TEST=buildall Change-Id: I5d8ddfc3eda59f0193707c77d52d97962ef1a325 Signed-off-by: Yuval Peress <peress@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1853694 Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
-rw-r--r--include/test_util.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/test_util.h b/include/test_util.h
index 124ef77aa4..f91a47674f 100644
--- a/include/test_util.h
+++ b/include/test_util.h
@@ -52,6 +52,10 @@
#define TEST_EQ(a, b, fmt) TEST_OPERATOR(a, b, ==, fmt)
#define TEST_NE(a, b, fmt) TEST_OPERATOR(a, b, !=, fmt)
+#define TEST_LT(a, b, fmt) TEST_OPERATOR(a, b, <, fmt)
+#define TEST_LE(a, b, fmt) TEST_OPERATOR(a, b, <=, fmt)
+#define TEST_GT(a, b, fmt) TEST_OPERATOR(a, b, >, fmt)
+#define TEST_GE(a, b, fmt) TEST_OPERATOR(a, b, >=, fmt)
#define TEST_BITS_SET(a, bits) TEST_OPERATOR(a & (int)bits, (int)bits, ==, "%u")
#define TEST_BITS_CLEARED(a, bits) TEST_OPERATOR(a & (int)bits, 0, ==, "%u")