forked from OneKeyHQ/lvgl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(mem): fix TLSF returning the wrong pointer when the requested siz…
…e is too large (lvgl#3325) * test(mem) add test for lvgl#3324 * fix(tlsf) don't return the same pointer if the requested size is too large
- Loading branch information
1 parent
d171f69
commit 9368a80
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#if LV_BUILD_TEST | ||
#include "../lvgl.h" | ||
|
||
#include "unity/unity.h" | ||
|
||
void setUp(void) | ||
{ | ||
/* Function run before every test */ | ||
} | ||
|
||
void tearDown(void) | ||
{ | ||
/* Function run after every test */ | ||
} | ||
|
||
/* #3324 */ | ||
void test_mem_buf_realloc(void) | ||
{ | ||
#if LV_MEM_CUSTOM == 0 | ||
void * buf1 = lv_mem_alloc(20); | ||
void * buf2 = lv_mem_realloc(buf1, LV_MEM_SIZE + 16384); | ||
TEST_ASSERT_NULL(buf2); | ||
#endif | ||
} | ||
|
||
#endif |