Skip to content

Commit

Permalink
Add additional checks to test_shared_ptr (succeeding).
Browse files Browse the repository at this point in the history
  • Loading branch information
Oberon00 committed Aug 4, 2013
1 parent 772a898 commit a13a7e2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/test_shared_ptr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,16 @@ void test_main(lua_State* L)
DOSTRING(L,
"assert(x == filter(x))\n"
);

boost::shared_ptr<X> spx(new X(2));
globals(L)["x2"] = spx;
TEST_CHECK(spx.use_count() == 2);
DOSTRING(L, "assert(get_value(x2) == 2)");
DOSTRING(L,
"x = nil\n"
"x2 = nil\n"
"collectgarbage()\n"
"collectgarbage()\n"
);
TEST_CHECK(spx.use_count() == 1);
}

0 comments on commit a13a7e2

Please sign in to comment.