BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
test_utils.test.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // qt-mvvm: Model-view-view-model framework for large GUI applications
4 //
5 //! @file mvvm/tests/testmodel/test_utils.test.cpp
6 //! @brief Implements class CLASS?
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2020
11 //! @authors Gennady Pospelov et al, Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #include "google_test.h"
16 #include "test_utils.h"
17 
19 
20 //! Testing functions in test_utils.
21 
22 class TestUtilsTest : public ::testing::Test {
23 public:
25 };
26 
28 
29 //! Testing toVector function.
30 
32 {
33  std::vector<int> expected_int = {1, 2, 3};
34  EXPECT_EQ(toVector<int>(1, 2, 3), expected_int);
35 
36  std::vector<double> expected_double = {1.1, 2.2, 3.3};
37  EXPECT_EQ(toVector<double>(1.1, 2.2, 3.3), expected_double);
38 
39  std::vector<std::string> expected_string = {"a", "bb", "ccc"};
40  EXPECT_EQ(toVector<std::string>("a", "bb", "ccc"), expected_string);
41 }
Testing functions in test_utils.
Defines class CLASS?
std::vector< T > toVector(Args &&... args)
Creates vector of T from argument list. Used in EXPECT_EQ macros for convenience.
Definition: test_utils.h:100
Defines class CLASS?
TEST_F(TestUtilsTest, toVector)
Testing toVector function.