From: Wolfgang Bangerth Date: Tue, 3 Oct 2017 01:02:34 +0000 (-0600) Subject: Add a test. X-Git-Tag: v9.0.0-rc1~987^2~4 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=081d66cc0d947c1d07abab90badbe9836fd26415;p=dealii.git Add a test. --- diff --git a/tests/base/table_07.cc b/tests/base/table_07.cc new file mode 100644 index 0000000000..8ee737166a --- /dev/null +++ b/tests/base/table_07.cc @@ -0,0 +1,55 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2017 by the deal.II authors +// +// This file is part of the deal.II library. +// +// The deal.II library is free software; you can use it, redistribute +// it, and/or modify it under the terms of the GNU Lesser General +// Public License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// The full text of the license can be found in the file LICENSE at +// the top level of the deal.II distribution. +// +// --------------------------------------------------------------------- + + +// check that Table works for types that can not be copy constructed + +#include "../tests.h" + +#include + + +class T +{ +public: + T () + { + deallog << "Default construct." << std::endl; + } + T (const T &) = delete; + T (T &&) + { + deallog << "Move construct." << std::endl; + } + + T &operator= (const T &) = delete; + T &operator= (T &&) + { + deallog << "Move assign." << std::endl; + return *this; + } +}; + + +int main() +{ + initlog(); + dealii::Table<2,T> table(2,2); + + dealii::Table<2,T> table2; + table2 = std::move(table); // should not create new objects + + deallog << "OK" << std::endl; +} diff --git a/tests/base/table_07.output b/tests/base/table_07.output new file mode 100644 index 0000000000..9ef77df91d --- /dev/null +++ b/tests/base/table_07.output @@ -0,0 +1,6 @@ + +DEAL::Default construct. +DEAL::Default construct. +DEAL::Default construct. +DEAL::Default construct. +DEAL::OK