Fix a bug with null pointor.

This commit is contained in:
xiaojiazhu 2023-08-15 07:06:38 -07:00
parent 6d886d26eb
commit 36dbb97146
2 changed files with 19 additions and 3 deletions

View File

@ -363,3 +363,17 @@ https://gitee.com/RT-Thread-Mirror/TinyFrame
   基于C语言的多态单例设计模式。
###### 1.4.2.4.7.2. 协议数据结构
## 1.5. 自动化测试
### 1.5.1. 自动化测试概述
   自动化测试是该产品设计的一大特点,需要严格执行。自动化测试指使用纯代码对业务设计进行测试用例设计,实现业务集成测试的能力。
### 1.5.2. 自动化测试规范
1. 每个源码文件在开发时均要写调试的example用于验证该文件的接口功能测试文件的命名规则为文件名 + “_Test.c(pp)”;
例如:
* C语言log_impl.c对应的测试文件为log_impl_Test.cpp;
* C++:LogImpl.cpp对应的测试文件为LogImpl_Test.cpp;
2.

View File

@ -44,10 +44,12 @@ RETURN_CODE_C new_hal(Hal **hal)
hal_init_impl(*hal);
return CreateReturnCode(C_RETURN_CODE_OK);
}
hal_init_impl(*hal);
LogError("new_hal failed.\n");
return CreateReturnCode(C_RETURN_CODE_NOT_OK);
}
else
{
hal_init_impl(*hal);
}
return CreateReturnCode(C_RETURN_CODE_OK);
}