OpenWalnut  1.4.0
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 <vector>
29 
30 #ifndef Q_MOC_RUN
31 #include <boost/shared_ptr.hpp>
32 #endif
33 #include <cxxtest/TestSuite.h>
34 
35 #include "../WDataSetFiberVector.h"
36 #include "../../common/math/linearAlgebra/WPosition.h"
37 
38 /**
39  * Unit tests our fiber dataset class
40  */
41 class WDataSetFiberVectorTest : public CxxTest::TestSuite
42 {
43 public:
44  /**
45  * Generates the test evironment
46  */
47  void setUp( void )
48  {
49  using std::vector;
50  m_somefibs = boost::shared_ptr< vector< WFiber > >( new vector< WFiber > );
51  vector< WPosition > points;
52  points.push_back( WPosition( 0., 0., 1. ) );
53  m_somefibs->push_back( WFiber( points ) );
54  points.push_back( WPosition( 0., 0., 2. ) );
55  m_somefibs->push_back( WFiber( points ) );
56  points.push_back( WPosition( 0., 0., 3. ) );
57  m_somefibs->push_back( WFiber( points ) );
58  }
59 
60  /**
61  * With a vector of WFiber a valid DataSetFibers should be possible
62  */
64  {
65  std::vector< WPosition > points;
66  points.push_back( WPosition( 0., 0., 1. ) );
67  points.push_back( WPosition( 0., 0., 2. ) );
68  points.push_back( WPosition( 0., 0., 3. ) );
69  WFiber expected( points );
71  TS_ASSERT_EQUALS( d[2], expected );
72  }
73 private:
74  boost::shared_ptr< std::vector< WFiber > > m_somefibs; //!< Default fiber dataset
75 };
76 
77 #endif // WDATASETFIBERVECTOR_TEST_H
Represents a neural pathway.
Definition: WFiber.h:39
Unit tests our fiber dataset class.
boost::shared_ptr< std::vector< WFiber > > m_somefibs
Default fiber dataset.
void testBasicAccessAndCreation(void)
With a vector of WFiber a valid DataSetFibers should be possible.
This only is a 3d double vector.
Represents a simple set of WFibers.
void setUp(void)
Generates the test evironment.