summaryrefslogtreecommitdiff
path: root/tests/vb2_common_tests.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/vb2_common_tests.c')
-rw-r--r--tests/vb2_common_tests.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/vb2_common_tests.c b/tests/vb2_common_tests.c
index e476edf1..a9f414f8 100644
--- a/tests/vb2_common_tests.c
+++ b/tests/vb2_common_tests.c
@@ -11,6 +11,16 @@
#include "test_common.h"
/**
+ * Test memory compare functions
+ */
+static void test_memcmp(void)
+{
+ TEST_EQ(vb2_safe_memcmp("foo", "foo", 3), 0, "memcmp equal");
+ TEST_NEQ(vb2_safe_memcmp("foo1", "foo2", 4), 0, "memcmp different");
+ TEST_EQ(vb2_safe_memcmp("foo1", "foo2", 0), 0, "memcmp 0-size");
+}
+
+/**
* Test alignment functions
*/
static void test_align(void)
@@ -230,6 +240,7 @@ static void test_helper_functions(void)
int main(int argc, char* argv[])
{
+ test_memcmp();
test_align();
test_workbuf();
test_struct_packing();