From e449a9b3f4202897e933189d0dd21fa6b628b3af Mon Sep 17 00:00:00 2001 From: Mark Abraham Date: Wed, 24 Jul 2019 13:26:19 +0200 Subject: [PATCH] Remove tests of make_unique These made sense when we had compat::make_unique, but we should not be maintaining code for testing std components. Change-Id: I794e33638ed97331453bb28da2fbb7b944e72ed2 --- src/gromacs/compat/tests/CMakeLists.txt | 1 - src/gromacs/compat/tests/make_unique.cpp | 83 -------------------------------- 2 files changed, 84 deletions(-) delete mode 100644 src/gromacs/compat/tests/make_unique.cpp diff --git a/src/gromacs/compat/tests/CMakeLists.txt b/src/gromacs/compat/tests/CMakeLists.txt index e4512889dd..123728bed3 100644 --- a/src/gromacs/compat/tests/CMakeLists.txt +++ b/src/gromacs/compat/tests/CMakeLists.txt @@ -34,7 +34,6 @@ if (GMX_BUILD_UNITTESTS) gmx_add_unit_test(CompatibilityHelpersTests compat-test - make_unique.cpp optional.cpp pointers.cpp string_view.cpp diff --git a/src/gromacs/compat/tests/make_unique.cpp b/src/gromacs/compat/tests/make_unique.cpp deleted file mode 100644 index 5456720e3e..0000000000 --- a/src/gromacs/compat/tests/make_unique.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* - * This file is part of the GROMACS molecular simulation package. - * - * Copyright (c) 2017,2018,2019, by the GROMACS development team, led by - * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, - * and including many others, as listed in the AUTHORS file in the - * top-level source directory and at http://www.gromacs.org. - * - * GROMACS is free software; you can 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. - * - * GROMACS is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with GROMACS; if not, see - * http://www.gnu.org/licenses, or write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * If you want to redistribute modifications to GROMACS, please - * consider that scientific software is very special. Version - * control is crucial - bugs must be traceable. We will be happy to - * consider code for inclusion in the official distribution, but - * derived work must not be called official GROMACS. Details are found - * in the README & COPYING files - if they are missing, get the - * official version at http://www.gromacs.org. - * - * To help us fund GROMACS development, we humbly ask that you cite - * the research papers on the package. Check out http://www.gromacs.org. - */ -/*! \internal \file - * \brief Tests for std::make_unique - * - * \author M. Eric Irrgang - * \ingroup module_compat - */ -#include "gmxpre.h" - -#include - -#include - -namespace gmx -{ - -namespace -{ - -struct dummy -{ - char foo; - char bar; - dummy() : - foo {0}, - bar {0} - {} - dummy(const char a, const char b) : - foo {a}, - bar {b} - {} -}; - -TEST(CompatibilityHelper, MakeUniqueCompiles) -{ - // Check template parameters - auto ptr = std::make_unique(); - ASSERT_NE(ptr, nullptr); - ASSERT_NE(ptr.get(), nullptr); - constexpr bool is_dummy = std::is_same < decltype(ptr), std::unique_ptr < dummy>>::value; - ASSERT_TRUE(is_dummy); - - // Check template and function parameters - ptr = std::make_unique('a', 'b'); - ASSERT_EQ(ptr->foo, 'a'); -} - - -} // anonymous namespace -} // namespace gmx -- 2.11.4.GIT