Update common auto test to include test for aligning values to multiples
of given integer.

Signed-off-by: Pavan Nikhilesh <pbhagavat...@caviumnetworks.com>
---
 test/test/test_common.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/test/test/test_common.c b/test/test/test_common.c
index d0342430f..e43cba49b 100644
--- a/test/test/test_common.c
+++ b/test/test/test_common.c
@@ -128,6 +128,18 @@ test_align(void)
                                FAIL("rte_is_aligned");
                }
        }
+
+       for (p = 1; p <= MAX_NUM / 2; p++) {
+               for (i = 1; i <= MAX_NUM / 2; i++) {
+                       val = RTE_ALIGN_MUL_CEIL(i, p);
+                       if (val % p != 0 || val < i)
+                               FAIL_ALIGN("RTE_ALIGN_MUL_CEIL", i, p);
+                       val = RTE_ALIGN_MUL_FLOOR(i, p);
+                       if (val % p != 0 || val > i)
+                               FAIL_ALIGN("RTE_ALIGN_MUL_FLOOR", i, p);
+               }
+       }
+
        return 0;
 }
 
-- 
2.16.2

Reply via email to