Position2DVectorTest.cpp File Reference

#include <gtest/gtest.h>
#include <utils/geom/Position2DVector.h>

Go to the source code of this file.

Data Structures

class  Position2DVectorTest

Functions

 TEST_F (Position2DVectorTest, test_method_getBoxBoundary)
 TEST_F (Position2DVectorTest, test_method_getPolygonCenter)
 TEST_F (Position2DVectorTest, test_method_around)


Function Documentation

TEST_F ( Position2DVectorTest  ,
test_method_getBoxBoundary   
)

Definition at line 57 of file Position2DVectorTest.cpp.

References Boundary::xmax(), Boundary::xmin(), Boundary::ymax(), and Boundary::ymin().

00057                                                          {  
00058     Boundary bound = vectorPolygon->getBoxBoundary();
00059     EXPECT_FLOAT_EQ(bound.xmax(), 4);
00060     EXPECT_FLOAT_EQ(bound.xmin(), 0);
00061     EXPECT_FLOAT_EQ(bound.ymax(), 4);
00062     EXPECT_FLOAT_EQ(bound.ymin(), 0);
00063 }

TEST_F ( Position2DVectorTest  ,
test_method_getPolygonCenter   
)

Definition at line 46 of file Position2DVectorTest.cpp.

References Position2D::x(), and Position2D::y().

00046                                                            {
00047     Position2D pos = vectorPolygon->getPolygonCenter();
00048     EXPECT_FLOAT_EQ(2, pos.x());
00049     EXPECT_FLOAT_EQ(1.6, pos.y());
00050     Position2D pos2 = vectorLine->getPolygonCenter();
00051     EXPECT_FLOAT_EQ(1, pos2.x());
00052     EXPECT_FLOAT_EQ(1, pos2.y());
00053     
00054 }

TEST_F ( Position2DVectorTest  ,
test_method_around   
)

Definition at line 34 of file Position2DVectorTest.cpp.

00034                                                  {
00035 
00036     EXPECT_TRUE(vectorPolygon->around(Position2D(1,1)));
00037     EXPECT_TRUE(vectorPolygon->around(Position2D(1,2)));
00038     EXPECT_FALSE(vectorPolygon->around(Position2D(4,4)));
00039     EXPECT_FALSE(vectorPolygon->around(Position2D(0,0)));
00040 
00041     EXPECT_FALSE(vectorLine->around(Position2D(1,1)));
00042     EXPECT_FALSE(vectorLine->around(Position2D(0,2)));
00043 }


Generated on Wed May 5 00:06:39 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6