StaticAllocationFailureNodes are not stored in the pool

This commit is contained in:
Léa Saviot
2018-06-29 15:30:40 +02:00
parent 8117e73561
commit a4471e1570
13 changed files with 68 additions and 32 deletions

View File

@@ -122,7 +122,6 @@ void testPoolExpressionAllocationFail() {
AdditionRef a(f11, f3);
float result = a.approximate();
assert(result == -1);
assert(ExpressionRef::staticFailedAllocationStaticNode()->retainCount() == 3);
f1.replaceWith(f11);
float result2 = a1.approximate();
@@ -200,7 +199,6 @@ void testPoolLayoutAllocationFail() {
// Fill the pool for size 256
CharLayoutRef char1('a');
LayoutRef::staticFailedAllocationStaticNode();
CharLayoutRef char2('b');
CharLayoutRef char3('a');
CharLayoutRef char4('b');
@@ -226,8 +224,7 @@ void runTest(test t) {
int main() {
printf("\n*******************\nStart running tests\n*******************\n\n");
ExpressionRef::staticFailedAllocationStaticNode();
assert(TreePool::sharedPool()->numberOfNodes() == 1);
assert(TreePool::sharedPool()->numberOfNodes() == 0);
runTest(testAddition);
runTest(testPoolEmpties);
runTest(testCursorCreateAndRetain);