Skip to content

Commit

Permalink
Merge "Fix a few minor memory leaks in controller/src/schema:test uni…
Browse files Browse the repository at this point in the history
…t tests"
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Mar 30, 2017
2 parents 287d821 + 2214b11 commit fd93838
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
7 changes: 4 additions & 3 deletions src/schema/test/ifmap_deep_property_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ class DeepPropertyTest : public ::testing::Test {
}

virtual void SetUp() {
xparser_ = IFMapServerParser::GetInstance("ifmap_deep_property");
ifmap_deep_property_ParserInit(xparser_);
xparser_.reset(IFMapServerParser::GetInstance("ifmap_deep_property"));
ifmap_deep_property_ParserInit(xparser_.get());
}


pugi::xml_document xdoc_;
IFMapServerParser *xparser_;
boost::scoped_ptr<IFMapServerParser> xparser_;
};

TEST_F(DeepPropertyTest, Decode) {
Expand Down
2 changes: 1 addition & 1 deletion src/schema/test/ifmap_identity_property_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ TEST_F(IdentityPropertyTest, EncodeDecode) {
BOOST_FOREACH(DBRequest *req, requests) {
table->Enqueue(req);
}
requests.clear();
STLDeleteValues(&requests);
WaitForIdle();

pugi::xml_document xmsg;
Expand Down
6 changes: 2 additions & 4 deletions src/schema/test/ifmap_link_attr_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,7 @@ TEST_F(LinkAttrTest, Decode) {
}

table->Enqueue(req);
// request ownership is transfered to table and deleted when operation
// completes.
req = NULL;
requests.clear();
STLDeleteValues(&requests);

// Wait for operation to be performed.
WaitForIdle();
Expand Down Expand Up @@ -167,6 +164,7 @@ TEST_F(LinkAttrTest, AgentEncodeDecode) {
ASSERT_TRUE(table != NULL);

table->Enqueue(requests.front());
STLDeleteValues(&requests);
WaitForIdle();

IFMapNode *a = table->FindNode("a");
Expand Down

0 comments on commit fd93838

Please sign in to comment.