diff --git a/APP_Framework/Applications/app_test/test_hash.c b/APP_Framework/Applications/app_test/test_hash.c index 7ecccb162..3979bb4b6 100644 --- a/APP_Framework/Applications/app_test/test_hash.c +++ b/APP_Framework/Applications/app_test/test_hash.c @@ -21,11 +21,48 @@ #include #include #include +#include #ifdef ADD_XIZI_FETURES +int testa[4]; +int i = 0; -void TestHash(void) +void TestHash(int argc, char *argv[]) { - printf("hallo!Hash.\n"); + if (argc > 1) + { + // 对哈希表的一些操作 + for (int arg = 0; arg < argc; arg ++) + { + // printf("the commend is %s.\n",argv[arg]); + if (strcmp(argv[arg],"--insert") == 0) + { + testa[i] = atoi(argv[arg + 1]); + i++; + for (int j = 0; j < 4; j++) + printf("testa[%d]:%d\n",j,testa[j]); + printf("insert hash table,insert element is %s.\n",argv[arg + 1]); + } + if (strcmp(argv[arg],"--delete") == 0) + { + // TODO:实现hash的删除操作 + printf("delete index is %s.\n",argv[arg + 1]); + } + if (strcmp(argv[arg],"--search") == 0) + { + // TODO:实现hash的查找操作 + printf("search hash table."); + } + if (strcmp(argv[arg],"--update") == 0) + { + // TODO:实现hash的修改操作 + printf("update index is %s.\n",argv[arg + 1]); + } + } + } + else + { + printf("nothing to do.\n"); + } } PRIV_SHELL_CMD_FUNCTION(TestHash, a hash test sample, PRIV_SHELL_CMD_MAIN_ATTR); #endif \ No newline at end of file