update kmaplib/HashMap_test.c.

测试类做了小优化,windows中方便观察测试结果
pull/1/head
一枚小java 2021-03-05 10:42:26 +08:00 committed by Gitee
parent 96513af0d5
commit 2008e41eff
1 changed files with 8 additions and 8 deletions

View File

@ -1,7 +1,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <xiphashmap.h>
#include "xiphashmap.h"
static void name_print( int idx, char * key, void * value);
@ -21,7 +21,7 @@ int main()
int i = 0;
int length = 15;
char tmpname[51];
/*初始化put*/
/*初始化put*/
for ( i = 0; i < length ; i++)
{
strcpy( tmpname, name[i]);
@ -29,29 +29,29 @@ int main()
XipHashmapPut( hashmap, tmpname, tmpname, strlen(tmpname)+1);
}
/*打印和检查*/
/*打印和检查*/
XipHashmapPrint(hashmap, NULL);
/*查看set是否好用*/
/*查看set是否好用*/
printf("GetSize--[%d]", XipHashmapSize(hashmap, NULL, NULL, NULL, NULL, NULL));
XipHashmapPut( hashmap, "panzi", "iceskyiceskyicesky", strlen("iceskyiceskyicesky")+1);
XipHashmapPrint(hashmap, name_print);
printf("GetNum--[%d]", XipHashmapNum(hashmap));
printf("GetSize--[%d]", XipHashmapSize(hashmap, NULL, NULL, NULL, NULL, NULL));
/*查看get是否好用*/
/*查看get是否好用*/
for ( i = 0; i< length; i++)
printf("get(%15s): %15s\n", name[i], (char *)XipHashmapGet(hashmap, name[i]));
XipHashmapPrint(hashmap, NULL);
/*查看remove是否好用*/
/*查看remove是否好用*/
printf("remove(%15s): %d\n", "lionsoul", XipHashmapRemove(hashmap, "lionsoul"));
XipHashmapPrint(hashmap, NULL);
/*查看destory*/
/*查看destory*/
XipHashmapDestory(hashmap);
hashmap = NULL;
system("pause");
return 0;
}