sample_test.cpp
Go to the documentation of this file.
1 // Copyright (C) 2007 Klaas Gadeyne <first dot last at gmail dot com>
2 //
3 // This program is free software; you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation; either version 2 of the License, or
6 // (at your option) any later version.
7 //
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16 //
17 
18 #include "sample_test.hpp"
19 
20 // Registers the fixture into the 'registry'
22 using namespace BFL;
23 
24 void
26 {
27  a = ColumnVector(3);
28  a(1) = 1; a(2) = 2; a(3) = 1;
29  a_sample_cv.ValueSet(a);
30  a_sample_int.ValueSet(2);
31  a_sample_double.ValueSet(3.1);
32 
33  b_sample_cv = a_sample_cv;
34 
35 }
36 
37 
38 void
40 {
41 }
42 
43 void
45 {
46  // Test one way
47  CPPUNIT_ASSERT_EQUAL( a, a_sample_cv.ValueGet());
48  CPPUNIT_ASSERT_EQUAL( 2.0 , (a_sample_cv.ValueGet())(2));
49  // CPPUNIT_ASSERT_EQUAL( a_sample_cv, b_sample_cv);
50  CPPUNIT_ASSERT_EQUAL( a_sample_cv.ValueGet(), b_sample_cv.ValueGet());
51 
52  CPPUNIT_ASSERT_EQUAL( 2, a_sample_int.ValueGet());
53  CPPUNIT_ASSERT_EQUAL( 3.1, a_sample_double.ValueGet());
54 }
55 
56 void
58 {
59  CPPUNIT_ASSERT_EQUAL((unsigned int) 3,a_sample_cv.DimensionGet());
60  CPPUNIT_ASSERT_EQUAL((unsigned int) 3,b_sample_cv.DimensionGet());
61  CPPUNIT_ASSERT_EQUAL((unsigned int) 1,a_sample_int.DimensionGet());
62  CPPUNIT_ASSERT_EQUAL((unsigned int) 1,a_sample_double.DimensionGet());
63 }
64 
65 void
67 {
68  double weight = 0.75;
69  a_weighted_sample_cv.ValueSet(a);
70  a_weighted_sample_cv.WeightSet(weight);
71  CPPUNIT_ASSERT_EQUAL( weight, a_weighted_sample_cv.WeightGet());
72 
73  b_weighted_sample_cv = a_weighted_sample_cv;
74  CPPUNIT_ASSERT_EQUAL( a_weighted_sample_cv.ValueGet(), b_weighted_sample_cv.ValueGet());
75  CPPUNIT_ASSERT_EQUAL( a_weighted_sample_cv.WeightGet(), b_weighted_sample_cv.WeightGet());
76 }
77 
78 // void
79 // SampleTest::testTimeProgress()
80 // {
81 // CPPUNIT_ASSERT( t != hbg->getTicks() );
82 // }
83 
84 
85 
void tearDown()
Definition: sample_test.cpp:39
void setUp()
Definition: sample_test.cpp:25
void testSampleDimension()
Definition: sample_test.cpp:57
void testSampleValue()
Definition: sample_test.cpp:44
void testWeightedSample()
Definition: sample_test.cpp:66
CPPUNIT_TEST_SUITE_REGISTRATION(SampleTest)


bfl
Author(s): Klaas Gadeyne, Wim Meeussen, Tinne Delaet and many others. See web page for a full contributor list. ROS package maintained by Wim Meeussen.
autogenerated on Mon Feb 28 2022 21:56:33