MCPcopy Create free account
hub / github.com/F-Stack/f-stack / test_memzone_bounded

Function test_memzone_bounded

dpdk/app/test/test_memzone.c:822–869  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

820}
821
822static int
823test_memzone_bounded(void)
824{
825 const struct rte_memzone *memzone_err;
826 int rc;
827
828 /* should fail as boundary is not power of two */
829 memzone_err = rte_memzone_reserve_bounded(
830 TEST_MEMZONE_NAME("bounded_error_31"), 100,
831 SOCKET_ID_ANY, 0, 32, UINT32_MAX);
832 if (memzone_err != NULL) {
833 printf("%s(%s)created a memzone with invalid boundary "
834 "conditions\n", __func__, memzone_err->name);
835 return -1;
836 }
837
838 /* should fail as len is greater then boundary */
839 memzone_err = rte_memzone_reserve_bounded(
840 TEST_MEMZONE_NAME("bounded_error_32"), 100,
841 SOCKET_ID_ANY, 0, 32, 32);
842 if (memzone_err != NULL) {
843 printf("%s(%s)created a memzone with invalid boundary "
844 "conditions\n", __func__, memzone_err->name);
845 return -1;
846 }
847
848 rc = check_memzone_bounded(TEST_MEMZONE_NAME("bounded_128"), 100, 128,
849 128);
850 if (rc != 0)
851 return rc;
852
853 rc = check_memzone_bounded(TEST_MEMZONE_NAME("bounded_256"), 100, 256,
854 128);
855 if (rc != 0)
856 return rc;
857
858 rc = check_memzone_bounded(TEST_MEMZONE_NAME("bounded_1K"), 100, 64,
859 1024);
860 if (rc != 0)
861 return rc;
862
863 rc = check_memzone_bounded(TEST_MEMZONE_NAME("bounded_1K_MAX"), 0, 64,
864 1024);
865 if (rc != 0)
866 return rc;
867
868 return 0;
869}
870
871static int
872test_memzone_free(void)

Callers 1

test_memzoneFunction · 0.85

Calls 3

check_memzone_boundedFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected