/[LeafOK_CVS]/lbbs/src/test_hash_dict.c
ViewVC logotype

Diff of /lbbs/src/test_hash_dict.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.2 by sysadm, Sun Nov 16 04:22:30 2025 UTC Revision 1.3 by sysadm, Wed Dec 17 03:41:56 2025 UTC
# Line 55  int main(int argc, char *argv[]) Line 55  int main(int argc, char *argv[])
55          for (i = 0; i < dict_item_count; i++)          for (i = 0; i < dict_item_count; i++)
56          {          {
57                  key = i * 37 + 13;                  key = i * 37 + 13;
58                  if (i % 2 == 0)                  if (i % 2 == 1)
                 {  
                         if (hash_dict_set(p_dict, key, i * 3 + 7) != 0)  
                         {  
                                 printf("hash_dict_set(%lu) error\n", key);  
                                 break;  
                         }  
                 }  
                 else  
59                  {                  {
60                          if (hash_dict_inc(p_dict, key, i * 3 + 7) != 0)                          if (hash_dict_inc(p_dict, key, i * 3 + 7) != 0)
61                          {                          {
# Line 71  int main(int argc, char *argv[]) Line 63  int main(int argc, char *argv[])
63                                  break;                                  break;
64                          }                          }
65                  }                  }
66    
67                    if (hash_dict_set(p_dict, key, i * 3 + 7) != 0)
68                    {
69                            printf("hash_dict_set(%lu) error\n", key);
70                            break;
71                    }
72          }          }
73    
74          ret = (int)hash_dict_item_count(p_dict);          ret = (int)hash_dict_item_count(p_dict);
# Line 98  int main(int argc, char *argv[]) Line 96  int main(int argc, char *argv[])
96          for (i = 0; i < dict_item_count; i++)          for (i = 0; i < dict_item_count; i++)
97          {          {
98                  key = i * 37 + 13;                  key = i * 37 + 13;
99                  if (hash_dict_inc(p_dict, key, i * 5 + 17) != 0)                  if (hash_dict_inc(p_dict, key, i * 5 + 17) != 1)
100                  {                  {
101                          printf("hash_dict_set(%lu) error\n", key);                          printf("hash_dict_inc(%lu) error\n", key);
102                          break;                          break;
103                  }                  }
104          }          }


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1