Skip to content

Commit

Permalink
Reference raw pointers in Some unit-tests
Browse files Browse the repository at this point in the history
This resolves segfaults that were introduced
by API changes in 2dbcaa6.
  • Loading branch information
lisitsyn committed Jun 7, 2016
1 parent 2dbcaa6 commit d6407a5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/unit/base/Some_unittest.cc
Expand Up @@ -16,6 +16,7 @@ TEST(Some,basic)
EXPECT_EQ(1, kernel->ref_count());
EXPECT_EQ(1, kernel->ref_count());
raw = kernel;
SG_REF(raw);
EXPECT_TRUE(kernel->equals(raw));

// reference is held
Expand All @@ -42,6 +43,7 @@ TEST(Some,get)
{
auto kernel = some<CGaussianKernel>();
CGaussianKernel* raw = kernel;
SG_REF(raw);
EXPECT_TRUE(kernel->equals(raw));
EXPECT_EQ(2, raw->ref_count());
SG_UNREF(raw);
Expand Down

0 comments on commit d6407a5

Please sign in to comment.