From 4af061368ec35c6fecef03aaa91d56cb27b1897b Mon Sep 17 00:00:00 2001 From: Joe Jordan Date: Fri, 2 Oct 2020 10:23:04 +0000 Subject: [PATCH] Add tests for setStringEntry --- src/gromacs/fileio/tests/readinp.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/gromacs/fileio/tests/readinp.cpp b/src/gromacs/fileio/tests/readinp.cpp index b1aa664182..343a15f19b 100644 --- a/src/gromacs/fileio/tests/readinp.cpp +++ b/src/gromacs/fileio/tests/readinp.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2016,2017,2018,2019, by the GROMACS development team, led by + * Copyright (c) 2016,2017,2018,2019,2020, 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. @@ -131,5 +131,16 @@ TEST_F(ReadTest, get_ereal_WarnsAboutString) ASSERT_TRUE(warning_errors_exist(wi_)); } +TEST_F(ReadTest, setStringEntry_ReturnsCorrectString) +{ + const std::string name = "name"; + const std::string definition = "definition"; + const std::string returnValue = setStringEntry(&inputField_, name, definition); + // The definition should be returned + EXPECT_EQ(returnValue, definition); + // The name should not be returned + EXPECT_NE(returnValue, name); +} + } // namespace testing } // namespace gmx -- 2.22.0