PathState_test.cpp
Go to the documentation of this file.
1 //=============================================================================
2 // Copyright (C) 2021-2024 Wageningen University - All Rights Reserved
3 // Author: Gonzalo Mier
4 // BSD-3 License
5 //=============================================================================
6 
7 #include <gtest/gtest.h>
8 #include "fields2cover/types.h"
9 
10 TEST(fields2cover_types_pathState, atEnd) {
12  ps.point = F2CPoint(1, 1);
13  ps.angle = 0.0;
14  ps.velocity = 2.0;
15  ps.len = 4.0;
18  EXPECT_EQ(ps.atEnd(), F2CPoint(5,1));
19 
20  ps.angle = M_PI*0.5;
21  EXPECT_NEAR(ps.atEnd().getX(), 1, 1e-7);
22  EXPECT_NEAR(ps.atEnd().getY(), 5, 1e-7);
23 
25  EXPECT_NEAR(ps.atEnd().getX(), 1, 1e-7);
26  EXPECT_NEAR(ps.atEnd().getY(), -3, 1e-7);
27 
28  ps.len = -4.0;
29  EXPECT_NEAR(ps.atEnd().getX(), 1, 1e-7);
30  EXPECT_NEAR(ps.atEnd().getY(), 5, 1e-7);
31 }
32 
33 
34 
types.h
f2c::types::PathState
Definition: PathState.h:27
f2c::types::PathDirection::FORWARD
@ FORWARD
f2c::types::PathDirection::BACKWARD
@ BACKWARD
TEST
TEST(fields2cover_types_pathState, atEnd)
Definition: PathState_test.cpp:10
f2c::types::PathSectionType::SWATH
@ SWATH
8_complete_flow.ps
list ps
Definition: 8_complete_flow.py:43
f2c::types::Point
Definition: Point.h:21
F2CPoint
f2c::types::Point F2CPoint
Definition: types.h:38


fields2cover
Author(s):
autogenerated on Fri Apr 25 2025 02:18:31