Skip to content

Commit

Permalink
Deallocate the factory in FactoryUnitTest before exiting
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoferigo committed Jan 29, 2019
1 parent 57c50ef commit 3f1b197
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/Factory/FactoryUnitTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ TEST_CASE("Load plugin", "[Factory][Plugin]")
// Finally, this should work
auto factory = factorySingleton.getClassFactory({mockPluginName, mockBlockName});
REQUIRE(factory != nullptr);

// Deallocate the factory
factory.reset();
REQUIRE(factorySingleton.destroyFactory({mockPluginName, mockBlockName}));
}

TEST_CASE("Load and use plugin", "[Factory][Plugin][Parameter]")
Expand Down Expand Up @@ -94,4 +98,8 @@ TEST_CASE("Load and use plugin", "[Factory][Plugin][Parameter]")
// Deallocate the block
factory->destroy(block);
factory->removeRef();

// Deallocate the factory
factory.reset();
REQUIRE(factorySingleton.destroyFactory({mockPluginName, mockBlockName}));
}

0 comments on commit 3f1b197

Please sign in to comment.