OpenWalnut  1.5.0dev
WDataSetFiberVector_test.h
1 //---------------------------------------------------------------------------
2 //
3 // Project: OpenWalnut ( http://www.openwalnut.org )
4 //
5 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6 // For more information see http://www.openwalnut.org/copying
7 //
8 // This file is part of OpenWalnut.
9 //
10 // OpenWalnut is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // OpenWalnut is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
22 //
23 //---------------------------------------------------------------------------
24 
25 #ifndef WDATASETFIBERVECTOR_TEST_H
26 #define WDATASETFIBERVECTOR_TEST_H
27 
28 #include <memory>
29 #include <vector>
30 
31 #include <cxxtest/TestSuite.h>
32 
33 #include "../../common/math/linearAlgebra/WPosition.h"
34 #include "../WDataSetFiberVector.h"
35 
36 /**
37  * Unit tests our fiber dataset class
38  */
39 class WDataSetFiberVectorTest : public CxxTest::TestSuite
40 {
41 public:
42  /**
43  * Generates the test evironment
44  */
45  void setUp( void )
46  {
47  using std::vector;
48  m_somefibs = std::shared_ptr< vector< WFiber > >( new vector< WFiber > );
49  vector< WPosition > points;
50  points.push_back( WPosition( 0., 0., 1. ) );
51  m_somefibs->push_back( WFiber( points ) );
52  points.push_back( WPosition( 0., 0., 2. ) );
53  m_somefibs->push_back( WFiber( points ) );
54  points.push_back( WPosition( 0., 0., 3. ) );
55  m_somefibs->push_back( WFiber( points ) );
56  }
57 
58  /**
59  * With a vector of WFiber a valid DataSetFibers should be possible
60  */
62  {
63  std::vector< WPosition > points;
64  points.push_back( WPosition( 0., 0., 1. ) );
65  points.push_back( WPosition( 0., 0., 2. ) );
66  points.push_back( WPosition( 0., 0., 3. ) );
67  WFiber expected( points );
69  TS_ASSERT_EQUALS( d[2], expected );
70  }
71 private:
72  std::shared_ptr< std::vector< WFiber > > m_somefibs; //!< Default fiber dataset
73 };
74 
75 #endif // WDATASETFIBERVECTOR_TEST_H
Unit tests our fiber dataset class.
std::shared_ptr< std::vector< WFiber > > m_somefibs
Default fiber dataset.
void testBasicAccessAndCreation(void)
With a vector of WFiber a valid DataSetFibers should be possible.
void setUp(void)
Generates the test evironment.
Represents a simple set of WFibers.
Represents a neural pathway.
Definition: WFiber.h:40
This only is a 3d double vector.