message: Add more tests to dim
diff: @@ -33,6 +33,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  #include <ginkgo/core/base/dim.hpp>
  +#include <memory>
  +
  +
  #include <gtest/gtest.h>
  @@ -48,6 +51,16 @@ TEST(Dim, ConstructsCorrectObject)
  }
  +TEST(Dim, ConstructsCorrectConstexprObject)
  +{
  + constexpr gko::dim<3> d{4, 5, 6};
  +
  + ASSERT_EQ(d[0], 4);
  + ASSERT_EQ(d[1], 5);
  + ASSERT_EQ(d[2], 6);
  +}
  +
  +
  TEST(Dim, ConstructsSquareObject)
  {
  gko::dim<2> d{5};
  @@ -66,6 +79,34 @@ TEST(Dim, ConstructsNullObject)
  }
  +class dim_manager {
  +public:
  + using dim = gko::dim<3>;
  + const dim &get_size() const { return size_; }
  +
  + static std::unique_ptr<dim_manager> create(const dim &size)
  + {
  + return std::unique_ptr<dim_manager>{new dim_manager{size}};
  + }
  +
  +private:
  + dim_manager(const dim &size) : size_{size} {}
  + dim size_;
  +};
  +
  +
  +TEST(Dim, CopiesProperlyOnHeap)
  +{
  + auto manager = dim_manager::create(gko::dim<3>{1, 2, 3});
  +
  + const auto copy = manager->get_size();
  +
  + ASSERT_EQ(copy[0], 1);
  + ASSERT_EQ(copy[1], 2);
  + ASSERT_EQ(copy[2], 3);
  +}
  +
  +
  TEST(Dim, ConvertsToBool)
  {
  gko::dim<2> d1{};
  