mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2025-02-20 11:43:27 +08:00
tests: add FFstrbuf smallest allocation test & minor fix (#1387)
This commit is contained in:
parent
07d0743a18
commit
0a61031463
@ -116,7 +116,7 @@ int main(void)
|
||||
|
||||
{
|
||||
FF_LIST_AUTO_DESTROY test = ffListCreate(1);
|
||||
VERIFY(test.elementSize = 1);
|
||||
VERIFY(test.elementSize == 1);
|
||||
VERIFY(test.capacity == 0);
|
||||
VERIFY(test.length == 0);
|
||||
}
|
||||
|
@ -442,6 +442,19 @@ int main(void)
|
||||
VERIFY(ffStrbufEqualS(&strbuf, "AA12BB3456CCDD"));
|
||||
ffStrbufDestroy(&strbuf);
|
||||
|
||||
// smallest allocation test
|
||||
{
|
||||
FF_STRBUF_AUTO_DESTROY strbuf1 = ffStrbufCreateA(10);
|
||||
VERIFY(strbuf1.allocated == 10);
|
||||
ffStrbufEnsureFree(&strbuf1, 16);
|
||||
VERIFY(strbuf1.allocated == 32);
|
||||
|
||||
FF_STRBUF_AUTO_DESTROY strbuf2 = ffStrbufCreate();
|
||||
VERIFY(strbuf2.allocated == 0);
|
||||
ffStrbufEnsureFree(&strbuf2, 16);
|
||||
VERIFY(strbuf2.allocated == 32);
|
||||
}
|
||||
|
||||
//Success
|
||||
puts("\e[32mAll tests passed!" FASTFETCH_TEXT_MODIFIER_RESET);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user