Commit 9ba195cf by Marcus Winter

base_c: checked for memory leaks in tests

parent ae9bab43
......@@ -177,6 +177,12 @@ void AllocTest::TestMixedAllocs() {
expected += (1 + 1) * EMBB_CACHE_LINE_SIZE + 3 * sizeof(size_t) - 1;
#endif // else EMBB_DEBUG
PT_EXPECT_EQ(allocated, expected);
embb_free(plain);
embb_free_aligned(aligned);
embb_free_aligned(cache_aligned);
PT_EXPECT(embb_get_bytes_allocated() == 0);
}
} // namespace test
......
......@@ -39,6 +39,8 @@
#include <embb/base/c/log.h>
#include <iostream>
#include <embb/base/c/memory_allocation.h>
PT_MAIN("Base C") {
embb_log_set_log_level(EMBB_LOG_LEVEL_WARNING);
unsigned int max_threads =
......@@ -55,4 +57,6 @@ PT_MAIN("Base C") {
PT_RUN(embb::base::test::ConditionVarTest);
PT_RUN(embb::base::test::ThreadTest);
PT_RUN(embb::base::test::ThreadSpecificStorageTest);
PT_EXPECT(embb_get_bytes_allocated() == 0);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment