--- lbbs/src/test_hash_dict.c 2025/11/16 04:22:30 1.2 +++ lbbs/src/test_hash_dict.c 2025/12/17 03:41:56 1.3 @@ -55,15 +55,7 @@ int main(int argc, char *argv[]) for (i = 0; i < dict_item_count; i++) { key = i * 37 + 13; - if (i % 2 == 0) - { - if (hash_dict_set(p_dict, key, i * 3 + 7) != 0) - { - printf("hash_dict_set(%lu) error\n", key); - break; - } - } - else + if (i % 2 == 1) { if (hash_dict_inc(p_dict, key, i * 3 + 7) != 0) { @@ -71,6 +63,12 @@ int main(int argc, char *argv[]) break; } } + + if (hash_dict_set(p_dict, key, i * 3 + 7) != 0) + { + printf("hash_dict_set(%lu) error\n", key); + break; + } } ret = (int)hash_dict_item_count(p_dict); @@ -98,9 +96,9 @@ int main(int argc, char *argv[]) for (i = 0; i < dict_item_count; i++) { key = i * 37 + 13; - if (hash_dict_inc(p_dict, key, i * 5 + 17) != 0) + if (hash_dict_inc(p_dict, key, i * 5 + 17) != 1) { - printf("hash_dict_set(%lu) error\n", key); + printf("hash_dict_inc(%lu) error\n", key); break; } }