added several grid-walks

added new helper methods/classes (e.g. for heading)
new test cases
optimize the dijkstra
cleanups/refactoring
added timed-benchmarks to the log
many more...
This commit is contained in:
2016-01-24 18:59:06 +01:00
parent cdf97322f8
commit 9947dced15
30 changed files with 1406 additions and 94 deletions

29
tests/geo/TestHeading.cpp Normal file
View File

@@ -0,0 +1,29 @@
#ifdef WITH_TESTS
#include "../Tests.h"
#include "../../geo/Heading.h"
TEST(Heading, diff) {
// 180 degree turn
{
// Heading h1(0,0, 0,+1);
// Heading h2(0,0, 0,-1);
// ASSERT_NEAR(h1.getDiffHalfRAD(h2), M_PI, 0.001);
// ASSERT_NEAR(h2.getDiffHalfRAD(h1), M_PI, 0.001);
}
// ~180 degree turn
{
Heading h1(0,0, 0.00,+1);
Heading h2(0,1, -0.01,-1);
Heading h3(0,1, +0.01,-1);
ASSERT_NEAR(h1.getDiffHalfRAD(h2), M_PI, 0.01);
ASSERT_NEAR(h2.getDiffHalfRAD(h1), M_PI, 0.01);
ASSERT_NEAR(h1.getDiffHalfRAD(h3), M_PI, 0.01);
ASSERT_NEAR(h3.getDiffHalfRAD(h1), M_PI, 0.01);
}
}
#endif