refactor(ci): prevent memory leak message without memory leak

This commit is contained in:
Jakob Hasse 2023-11-17 12:15:46 +08:00
parent 82a110c7f3
commit 7781bfae79

View File

@ -32,11 +32,13 @@ void unity_utils_check_leak(unsigned int before_free,
unsigned int leaked = (size_t)(free_delta * -1);
if (leaked > 0) {
printf("MALLOC_CAP_%s %s leak: Before %u bytes free, After %u bytes free (delta %u)\n",
type,
leaked <= threshold ? "potential" : "critical",
before_free, after_free, leaked);
fflush(stdout);
}
TEST_ASSERT_MESSAGE(leaked <= threshold, "The test leaked too much memory");
}