mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-12 10:22:12 +02:00
tests: add FFstrbuf smallest allocation test & minor fix (#1387)
This commit is contained in:
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user