Add assertions on pool emptiness

This commit is contained in:
Léa Saviot
2018-06-27 15:58:59 +02:00
parent 3d5e8dc4c4
commit 08f16bca23

View File

@@ -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;
}