mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-12-02 03:58:33 +08:00
improve darray
This commit is contained in:
parent
40f7bf6b60
commit
68a164dd79
@ -2,6 +2,7 @@
|
||||
|
||||
2020/10/22
|
||||
* OpenGL 模式下的图片采样算法由相邻采样改为线性采样,主要为了提高图片旋转缩放效果(感谢智明提供补丁)。
|
||||
* 修改darray的elms为NULL是内存泄漏的问题(感谢兆坤提供补丁)。
|
||||
|
||||
2020/10/21
|
||||
* awtk-web 修复编译报错问题(感谢智明提供补丁)。
|
||||
|
@ -335,7 +335,7 @@ ret_t darray_deinit(darray_t* darray) {
|
||||
}
|
||||
|
||||
ret_t darray_destroy(darray_t* darray) {
|
||||
return_value_if_fail(darray != NULL && darray->elms != NULL, RET_BAD_PARAMS);
|
||||
return_value_if_fail(darray != NULL, RET_BAD_PARAMS);
|
||||
|
||||
darray_deinit(darray);
|
||||
TKMEM_FREE(darray);
|
||||
|
@ -29,6 +29,14 @@ TEST(DArrayTest, create) {
|
||||
darray_destroy(darray);
|
||||
}
|
||||
|
||||
TEST(DArrayTest, create0) {
|
||||
darray_t* darray = darray_create(0, NULL, NULL);
|
||||
ASSERT_EQ(darray->size, 0);
|
||||
ASSERT_EQ(darray->elms == NULL, true);
|
||||
ASSERT_EQ(darray->capacity, 0);
|
||||
darray_destroy(darray);
|
||||
}
|
||||
|
||||
TEST(DArrayTest, stack) {
|
||||
char* p = NULL;
|
||||
darray_t* darray = darray_create(10, NULL, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user