Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "sample_test.hpp"
00019
00020
00021 CPPUNIT_TEST_SUITE_REGISTRATION( SampleTest );
00022 using namespace BFL;
00023
00024 void
00025 SampleTest::setUp()
00026 {
00027 a = ColumnVector(3);
00028 a(1) = 1; a(2) = 2; a(3) = 1;
00029 a_sample_cv.ValueSet(a);
00030 a_sample_int.ValueSet(2);
00031 a_sample_double.ValueSet(3.1);
00032
00033 b_sample_cv = a_sample_cv;
00034
00035 }
00036
00037
00038 void
00039 SampleTest::tearDown()
00040 {
00041 }
00042
00043 void
00044 SampleTest::testSampleValue()
00045 {
00046
00047 CPPUNIT_ASSERT_EQUAL( a, a_sample_cv.ValueGet());
00048 CPPUNIT_ASSERT_EQUAL( 2.0 , (a_sample_cv.ValueGet())(2));
00049
00050 CPPUNIT_ASSERT_EQUAL( a_sample_cv.ValueGet(), b_sample_cv.ValueGet());
00051
00052 CPPUNIT_ASSERT_EQUAL( 2, a_sample_int.ValueGet());
00053 CPPUNIT_ASSERT_EQUAL( 3.1, a_sample_double.ValueGet());
00054 }
00055
00056 void
00057 SampleTest::testSampleDimension()
00058 {
00059 CPPUNIT_ASSERT_EQUAL((unsigned int) 3,a_sample_cv.DimensionGet());
00060 CPPUNIT_ASSERT_EQUAL((unsigned int) 3,b_sample_cv.DimensionGet());
00061 CPPUNIT_ASSERT_EQUAL((unsigned int) 1,a_sample_int.DimensionGet());
00062 CPPUNIT_ASSERT_EQUAL((unsigned int) 1,a_sample_double.DimensionGet());
00063 }
00064
00065 void
00066 SampleTest::testWeightedSample()
00067 {
00068 double weight = 0.75;
00069 a_weighted_sample_cv.ValueSet(a);
00070 a_weighted_sample_cv.WeightSet(weight);
00071 CPPUNIT_ASSERT_EQUAL( weight, a_weighted_sample_cv.WeightGet());
00072
00073 b_weighted_sample_cv = a_weighted_sample_cv;
00074 CPPUNIT_ASSERT_EQUAL( a_weighted_sample_cv.ValueGet(), b_weighted_sample_cv.ValueGet());
00075 CPPUNIT_ASSERT_EQUAL( a_weighted_sample_cv.WeightGet(), b_weighted_sample_cv.WeightGet());
00076 }
00077
00078
00079
00080
00081
00082
00083
00084
00085
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 Thu Feb 11 2016 22:31:57