still recovering from troubled merge

This commit is contained in:
Seth Alves 2015-03-13 18:29:59 -07:00
parent a5cdc3c68b
commit d749b350eb

View file

@ -55,10 +55,15 @@ void ShapeManagerTests::testShapeAccounting() {
} }
// release all references // release all references
bool released = shapeManager.releaseShape(info);
numReferences--;
while (numReferences > 0) { while (numReferences > 0) {
shapeManager.releaseShape(info); released = shapeManager.releaseShape(info) && released;
numReferences--; numReferences--;
} }
if (!released) {
std::cout << __FILE__ << ":" << __LINE__ << " ERROR: expected shape released" << std::endl;
}
// verify shape still exists (not yet garbage collected) // verify shape still exists (not yet garbage collected)
if (shapeManager.getNumShapes() != 1) { if (shapeManager.getNumShapes() != 1) {
@ -92,7 +97,7 @@ void ShapeManagerTests::testShapeAccounting() {
} }
// release reference and verify that it is collected as garbage // release reference and verify that it is collected as garbage
shapeManager.releaseShape(info); released = shapeManager.releaseShape(info);
shapeManager.collectGarbage(); shapeManager.collectGarbage();
if (shapeManager.getNumShapes() != 0) { if (shapeManager.getNumShapes() != 0) {
std::cout << __FILE__ << ":" << __LINE__ << " ERROR: expected zero shapes after release" << std::endl; std::cout << __FILE__ << ":" << __LINE__ << " ERROR: expected zero shapes after release" << std::endl;