unittests_smartptr.cc 301 Bytes
Newer Older
1 2
#include <gtest/gtest.h>

Jan Möbius's avatar
Jan Möbius committed
3 4
#if __cplusplus >= 201103L

5 6 7 8 9 10 11 12 13 14 15
#include <OpenVolumeMesh/System/MemoryInclude.hh>

TEST(MakeUniqueTest, MakeUniqueTest) {
  std::unique_ptr<int> foo;
  auto bar = ptr::make_unique<int>(5);
  foo = std::move(bar);

  EXPECT_EQ(*foo, 5);
  EXPECT_EQ(bar.get(), nullptr);
}

Jan Möbius's avatar
Jan Möbius committed
16
#endif