devtools: add checkpatch spelling dictionary builder
[dpdk.git] / app / test / test_malloc.c
index d6c4c4f..71b3cfd 100644 (file)
@@ -828,6 +828,11 @@ test_malloc_bad_params(void)
        if (bad_ptr != NULL)
                goto err_return;
 
+       /* rte_realloc expected to return null with inappropriate size */
+       bad_ptr = rte_realloc(NULL, size, align);
+       if (bad_ptr != NULL)
+               goto err_return;
+
        /* rte_malloc expected to return null with inappropriate alignment */
        align = 17;
        size = 1024;
@@ -836,6 +841,23 @@ test_malloc_bad_params(void)
        if (bad_ptr != NULL)
                goto err_return;
 
+       /* rte_realloc expected to return null with inappropriate alignment */
+       bad_ptr = rte_realloc(NULL, size, align);
+       if (bad_ptr != NULL)
+               goto err_return;
+
+       /* rte_malloc expected to return null with size will cause overflow */
+       align = RTE_CACHE_LINE_SIZE;
+       size = (size_t)-8;
+
+       bad_ptr = rte_malloc(type, size, align);
+       if (bad_ptr != NULL)
+               goto err_return;
+
+       bad_ptr = rte_realloc(NULL, size, align);
+       if (bad_ptr != NULL)
+               goto err_return;
+
        return 0;
 
 err_return: