Commit 743bf510 by Marcus Winter

mtapi_c: checked for memory leaks in tests

parent 7d4ecd5b
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <embb/base/c/thread.h> #include <embb/base/c/thread.h>
#include <embb/base/c/memory_allocation.h>
#include <embb_mtapi_test_config.h> #include <embb_mtapi_test_config.h>
#include <embb_mtapi_test_group.h> #include <embb_mtapi_test_group.h>
...@@ -195,5 +196,7 @@ void GroupTest::TestBasic() { ...@@ -195,5 +196,7 @@ void GroupTest::TestBasic() {
mtapi_finalize(&status); mtapi_finalize(&status);
MTAPI_CHECK_STATUS(status); MTAPI_CHECK_STATUS(status);
PT_EXPECT(embb_get_bytes_allocated() == 0);
embb_mtapi_log_info("...done\n\n"); embb_mtapi_log_info("...done\n\n");
} }
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#include <embb/base/c/memory_allocation.h>
#include <embb_mtapi_test_config.h> #include <embb_mtapi_test_config.h>
#include <embb_mtapi_test_init_finalize.h> #include <embb_mtapi_test_init_finalize.h>
...@@ -66,5 +68,7 @@ void InitFinalizeTest::TestBasic() { ...@@ -66,5 +68,7 @@ void InitFinalizeTest::TestBasic() {
MTAPI_CHECK_STATUS(status); MTAPI_CHECK_STATUS(status);
} }
PT_EXPECT(embb_get_bytes_allocated() == 0);
embb_mtapi_log_info("...done\n\n"); embb_mtapi_log_info("...done\n\n");
} }
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <embb_mtapi_test_config.h> #include <embb_mtapi_test_config.h>
#include <embb_mtapi_test_queue.h> #include <embb_mtapi_test_queue.h>
#include <embb/base/c/memory_allocation.h>
#include <embb/base/c/internal/unused.h> #include <embb/base/c/internal/unused.h>
#define JOB_TEST_TASK 42 #define JOB_TEST_TASK 42
...@@ -129,5 +130,7 @@ void QueueTest::TestBasic() { ...@@ -129,5 +130,7 @@ void QueueTest::TestBasic() {
mtapi_finalize(&status); mtapi_finalize(&status);
MTAPI_CHECK_STATUS(status); MTAPI_CHECK_STATUS(status);
PT_EXPECT(embb_get_bytes_allocated() == 0);
embb_mtapi_log_info("...done\n\n"); embb_mtapi_log_info("...done\n\n");
} }
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <embb_mtapi_test_config.h> #include <embb_mtapi_test_config.h>
#include <embb_mtapi_test_task.h> #include <embb_mtapi_test_task.h>
#include <embb/base/c/memory_allocation.h>
#include <embb/base/c/internal/unused.h> #include <embb/base/c/internal/unused.h>
#define JOB_TEST_TASK 42 #define JOB_TEST_TASK 42
...@@ -162,5 +163,7 @@ void TaskTest::TestBasic() { ...@@ -162,5 +163,7 @@ void TaskTest::TestBasic() {
mtapi_finalize(&status); mtapi_finalize(&status);
MTAPI_CHECK_STATUS(status); MTAPI_CHECK_STATUS(status);
PT_EXPECT(embb_get_bytes_allocated() == 0);
embb_mtapi_log_info("...done\n\n"); embb_mtapi_log_info("...done\n\n");
} }
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