BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ViewItemTest Class Reference

Tests for ViewItem class. More...

Inheritance diagram for ViewItemTest:
[legend]
Collaboration diagram for ViewItemTest:
[legend]

Classes

class  TestItem
 

Public Types

using children_t = std::vector< std::unique_ptr< ViewItem > >
 
using expected_t = std::vector< ViewItem * >
 

Public Member Functions

 ~ViewItemTest ()
 
std::pair< children_t, expected_ttest_data (int ncolumns)
 Helper function to get two vectors, each ncolumns length, in the form of a pair. More...
 

Detailed Description

Tests for ViewItem class.

Definition at line 24 of file viewitem.test.cpp.

Member Typedef Documentation

◆ children_t

using ViewItemTest::children_t = std::vector<std::unique_ptr<ViewItem> >

Definition at line 33 of file viewitem.test.cpp.

◆ expected_t

using ViewItemTest::expected_t = std::vector<ViewItem*>

Definition at line 34 of file viewitem.test.cpp.

Constructor & Destructor Documentation

◆ ~ViewItemTest()

ViewItemTest::~ViewItemTest ( )
default

Member Function Documentation

◆ test_data()

std::pair<children_t, expected_t> ViewItemTest::test_data ( int  ncolumns)
inline

Helper function to get two vectors, each ncolumns length, in the form of a pair.

First vector contains unique_ptr objects, second vector bare pointers to same objects. First vector is intended to be moved inside a model, second vector is to validate the content of a model after the move.

Definition at line 41 of file viewitem.test.cpp.

42  {
43  auto vector_of_unique = TestUtils::create_row<ViewItem, TestItem>(ncolumns);
44  auto vector_of_pointers = TestUtils::create_pointers(vector_of_unique);
45  return std::make_pair(std::move(vector_of_unique), std::move(vector_of_pointers));
46  }
auto create_pointers(const std::vector< std::unique_ptr< T >> &vec)
Creates vector of pointers from vector of unique_ptr.
Definition: test_utils.h:90

References TestUtils::create_pointers().

Here is the call graph for this function:

The documentation for this class was generated from the following file: