From 08f16bca23e02fa502aaabc141341094c92ee153 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Wed, 27 Jun 2018 15:58:59 +0200 Subject: [PATCH] Add assertions on pool emptiness --- test.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/test.cpp b/test.cpp index bb82355af..22c08bb6f 100644 --- a/test.cpp +++ b/test.cpp @@ -98,10 +98,17 @@ void testCursorMoveLeft() { assert(aChar.nodeRetainCount() == 3); } +typedef void (test)(); +void runTest(test t) { + assert(TreePool::sharedPool()->numberOfNodes() == 0); + t(); + assert(TreePool::sharedPool()->numberOfNodes() == 0); +} + int main() { - testAddition(); - testPoolEmpties(); - testCursorCreateAndRetain(); - testCursorMoveLeft(); + runTest(testAddition); + runTest(testPoolEmpties); + runTest(testCursorCreateAndRetain); + runTest(testCursorMoveLeft); return 0; }