X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest%2Ftest_memzone.c;h=6ddd0fbab5543ee0d9ac875d1da6eceee943e3a3;hb=f0243339496d48e6f5d76e6ef6741d6986b965d0;hp=03a9d1d3bb1b9e95551dedae3d6aeed92edb3839;hpb=99a2dd955fba6e4cc23b77d590a033650ced9c45;p=dpdk.git diff --git a/app/test/test_memzone.c b/app/test/test_memzone.c index 03a9d1d3bb..6ddd0fbab5 100644 --- a/app/test/test_memzone.c +++ b/app/test/test_memzone.c @@ -18,7 +18,8 @@ #include #include #include -#include "../../lib/eal/common/malloc_elem.h" + +#include "malloc_elem.h" #include "test.h" @@ -81,6 +82,26 @@ test_memzone_invalid_alignment(void) return 0; } +static int +test_memzone_invalid_flags(void) +{ + const struct rte_memzone *mz; + + mz = rte_memzone_lookup(TEST_MEMZONE_NAME("invalid_flags")); + if (mz != NULL) { + printf("Zone with invalid flags has been reserved\n"); + return -1; + } + + mz = rte_memzone_reserve(TEST_MEMZONE_NAME("invalid_flags"), + 100, SOCKET_ID_ANY, RTE_MEMZONE_IOVA_CONTIG << 1); + if (mz != NULL) { + printf("Zone with invalid flags has been reserved\n"); + return -1; + } + return 0; +} + static int test_memzone_reserving_zone_size_bigger_than_the_maximum(void) { @@ -1105,6 +1126,10 @@ test_memzone(void) if (test_memzone_invalid_alignment() < 0) return -1; + printf("test invalid flags for memzone_reserve\n"); + if (test_memzone_invalid_flags() < 0) + return -1; + printf("test reserving the largest size memzone possible\n"); if (test_memzone_reserve_max() < 0) return -1;