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

Function fbk_hash_unit_test

dpdk/app/test/test_hash.c:1005–1296  ·  view source on GitHub ↗

/

Source from the content-addressed store, hash-verified

1003
1004/******************************************************************************/
1005static int
1006fbk_hash_unit_test(void)
1007{
1008 struct rte_fbk_hash_params params = {
1009 .name = "fbk_hash_test",
1010 .entries = LOCAL_FBK_HASH_ENTRIES_MAX,
1011 .entries_per_bucket = 4,
1012 .socket_id = 0,
1013 };
1014
1015 struct rte_fbk_hash_params invalid_params_1 = {
1016 .name = "invalid_1",
1017 .entries = LOCAL_FBK_HASH_ENTRIES_MAX + 1, /* Not power of 2 */
1018 .entries_per_bucket = 4,
1019 .socket_id = 0,
1020 };
1021
1022 struct rte_fbk_hash_params invalid_params_2 = {
1023 .name = "invalid_2",
1024 .entries = 4,
1025 .entries_per_bucket = 3, /* Not power of 2 */
1026 .socket_id = 0,
1027 };
1028
1029 struct rte_fbk_hash_params invalid_params_3 = {
1030 .name = "invalid_3",
1031 .entries = 0, /* Entries is 0 */
1032 .entries_per_bucket = 4,
1033 .socket_id = 0,
1034 };
1035
1036 struct rte_fbk_hash_params invalid_params_4 = {
1037 .name = "invalid_4",
1038 .entries = LOCAL_FBK_HASH_ENTRIES_MAX,
1039 .entries_per_bucket = 0, /* Entries per bucket is 0 */
1040 .socket_id = 0,
1041 };
1042
1043 struct rte_fbk_hash_params invalid_params_5 = {
1044 .name = "invalid_5",
1045 .entries = 4,
1046 .entries_per_bucket = 8, /* Entries per bucket > entries */
1047 .socket_id = 0,
1048 };
1049
1050 struct rte_fbk_hash_params invalid_params_6 = {
1051 .name = "invalid_6",
1052 .entries = RTE_FBK_HASH_ENTRIES_MAX * 2, /* Entries > max allowed */
1053 .entries_per_bucket = 4,
1054 .socket_id = 0,
1055 };
1056
1057 struct rte_fbk_hash_params invalid_params_7 = {
1058 .name = "invalid_7",
1059 .entries = RTE_FBK_HASH_ENTRIES_MAX,
1060 .entries_per_bucket = RTE_FBK_HASH_ENTRIES_PER_BUCKET_MAX * 2, /* Entries > max allowed */
1061 .socket_id = 0,
1062 };

Callers 1

test_hashFunction · 0.85

Calls 9

rte_fbk_hash_createFunction · 0.85
rte_eal_has_hugepagesFunction · 0.85
rte_fbk_hash_freeFunction · 0.85
rte_fbk_hash_add_keyFunction · 0.85
rte_fbk_hash_lookupFunction · 0.85
rte_fbk_hash_delete_keyFunction · 0.85
rte_fbk_hash_clear_allFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected