diff --git a/APP_Framework/Applications/app_test/test_rbtree/test_rbtree.c b/APP_Framework/Applications/app_test/test_rbtree/test_rbtree.c index 7f339bd63..6a879ba67 100644 --- a/APP_Framework/Applications/app_test/test_rbtree/test_rbtree.c +++ b/APP_Framework/Applications/app_test/test_rbtree/test_rbtree.c @@ -1,6 +1,7 @@ -#include -#include -#include "test_rbtree.h" +#include +#include +#include"test_rbtree.h" +#ifdef ADD_XIZI_FEATURES #define rb_parent(r) ((r)->parent) #define rb_color(r) ((r)->is_red) @@ -540,8 +541,7 @@ void printRbtree(RBRoot *root) } - -int main(void){ +void TestRBTree(void){ int i, ret; char cmd; RBRoot *root = createRbtree(); @@ -622,5 +622,9 @@ int main(void){ } destroyRbtree(root); - return 0; + return; } + +PRIV_SHELL_CMD_FUNCTION(TestRBTree, a red-black tree test sample, PRIV_SHELL_CMD_MAIN_ATTR); + +#endif \ No newline at end of file diff --git a/APP_Framework/Applications/app_test/test_rbtree/test_rbtree.h b/APP_Framework/Applications/app_test/test_rbtree/test_rbtree.h index 7bcab2217..bbb601606 100644 --- a/APP_Framework/Applications/app_test/test_rbtree/test_rbtree.h +++ b/APP_Framework/Applications/app_test/test_rbtree/test_rbtree.h @@ -1,5 +1,7 @@ #ifndef _RED_BLACK_TREE_H_ #define _RED_BLACK_TREE_H_ +#include +#include #define RED 0 // 红色节点 #define BLACK 1 // 黑色节点 @@ -20,6 +22,8 @@ typedef struct RBTreeType{ Node *node; }RBRoot; +void TestRBTree(void); + // 创建红黑树,返回"红黑树的根"! RBRoot* createRbtree(); diff --git a/APP_Framework/Applications/main.c b/APP_Framework/Applications/main.c index aae959231..e1de024b5 100644 --- a/APP_Framework/Applications/main.c +++ b/APP_Framework/Applications/main.c @@ -1,32 +1,32 @@ -// /* -// * Copyright (c) 2020 AIIT XUOS Lab -// * XiUOS is licensed under Mulan PSL v2. -// * You can use this software according to the terms and conditions of the Mulan PSL v2. -// * You may obtain a copy of Mulan PSL v2 at: -// * http://license.coscl.org.cn/MulanPSL2 -// * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -// * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -// * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -// * See the Mulan PSL v2 for more details. -// */ +/* +* Copyright (c) 2020 AIIT XUOS Lab +* XiUOS is licensed under Mulan PSL v2. +* You can use this software according to the terms and conditions of the Mulan PSL v2. +* You may obtain a copy of Mulan PSL v2 at: +* http://license.coscl.org.cn/MulanPSL2 +* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, +* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, +* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +* See the Mulan PSL v2 for more details. +*/ -// #include -// #include -// // #include -// #include +#include +#include +// #include +#include -// extern int FrameworkInit(); -// extern void ApplicationOtaTaskInit(void); -// int main(void) -// { -// printf("Hello, world! \n"); -// FrameworkInit(); -// #ifdef APPLICATION_OTA -// ApplicationOtaTaskInit(); -// #endif -// return 0; -// } -// // int cppmain(void); +extern int FrameworkInit(); +extern void ApplicationOtaTaskInit(void); +int main(void) +{ + printf("Hello, world! \n"); + FrameworkInit(); +#ifdef APPLICATION_OTA + ApplicationOtaTaskInit(); +#endif + return 0; +} +// int cppmain(void);