Merge pull request #436 from acxz/clang-warns

fix clang warnings on tests
release/4.3a0
Varun Agrawal 2020-07-27 12:04:54 -04:00 committed by GitHub
commit 832b420baa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 43 deletions

View File

@ -137,7 +137,7 @@ TEST( GaussianBayesNet, optimize3 )
} }
/* ************************************************************************* */ /* ************************************************************************* */
TEST(GaussianBayesNet, ordering) TEST(GaussianBayesNet, ordering)
{ {
Ordering expected; Ordering expected;
expected += _x_, _y_; expected += _x_, _y_;
@ -155,7 +155,7 @@ TEST( GaussianBayesNet, MatrixStress )
bn.emplace_shared<GC>(_z_, Vector2(5, 6), 6 * I_2x2); bn.emplace_shared<GC>(_z_, Vector2(5, 6), 6 * I_2x2);
const VectorValues expected = bn.optimize(); const VectorValues expected = bn.optimize();
for (const auto keys : for (const auto& keys :
{KeyVector({_x_, _y_, _z_}), KeyVector({_x_, _z_, _y_}), {KeyVector({_x_, _y_, _z_}), KeyVector({_x_, _z_, _y_}),
KeyVector({_y_, _x_, _z_}), KeyVector({_y_, _z_, _x_}), KeyVector({_y_, _x_, _z_}), KeyVector({_y_, _z_, _x_}),
KeyVector({_z_, _x_, _y_}), KeyVector({_z_, _y_, _x_})}) { KeyVector({_z_, _x_, _y_}), KeyVector({_z_, _y_, _x_})}) {
@ -183,7 +183,7 @@ TEST( GaussianBayesNet, backSubstituteTranspose )
VectorValues actual = smallBayesNet.backSubstituteTranspose(x); VectorValues actual = smallBayesNet.backSubstituteTranspose(x);
EXPECT(assert_equal(expected, actual)); EXPECT(assert_equal(expected, actual));
const auto ordering = noisyBayesNet.ordering(); const auto ordering = noisyBayesNet.ordering();
const Matrix R = smallBayesNet.matrix(ordering).first; const Matrix R = smallBayesNet.matrix(ordering).first;
const Vector expected_vector = R.transpose().inverse() * x.vector(ordering); const Vector expected_vector = R.transpose().inverse() * x.vector(ordering);
@ -206,7 +206,7 @@ TEST( GaussianBayesNet, backSubstituteTransposeNoisy )
VectorValues actual = noisyBayesNet.backSubstituteTranspose(x); VectorValues actual = noisyBayesNet.backSubstituteTranspose(x);
EXPECT(assert_equal(expected, actual)); EXPECT(assert_equal(expected, actual));
const auto ordering = noisyBayesNet.ordering(); const auto ordering = noisyBayesNet.ordering();
const Matrix R = noisyBayesNet.matrix(ordering).first; const Matrix R = noisyBayesNet.matrix(ordering).first;
const Vector expected_vector = R.transpose().inverse() * x.vector(ordering); const Vector expected_vector = R.transpose().inverse() * x.vector(ordering);

View File

@ -1,37 +0,0 @@
/*
* testPlanning.cpp
* @brief develop code for planning example
* @date Feb 13, 2012
* @author Frank Dellaert
*/
//#include <gtsam/discrete/Planner.h>
#include <gtsam/discrete/DiscreteKey.h>
#include <CppUnitLite/TestHarness.h>
#include <iostream>
#include <fstream>
using namespace std;
using namespace gtsam;
/* ************************************************************************* */
TEST_UNSAFE(Planner, allInOne)
{
// A small planning problem
// First variable is location
DiscreteKey location(0,3),
haveRock(1,2), haveSoil(2,2), haveImage(3,2),
commRock(4,2), commSoil(5,2), commImage(6,2);
// There are 3 actions:
// Drive, communicate, sample
}
/* ************************************************************************* */
int main() {
TestResult tr;
return TestRegistry::runAllTests(tr);
}
/* ************************************************************************* */

View File

@ -75,7 +75,7 @@ DiscreteFactorGraph createExpected() {
// Mutual exclusion for students // Mutual exclusion for students
expected.addAllDiff(A, J); expected.addAllDiff(A, J);
return expected; return std::move(expected);
} }
/* ************************************************************************* */ /* ************************************************************************* */

View File

@ -244,7 +244,7 @@ TEST(Similarity3, GroupAction) {
&Similarity3::transformFrom, _1, _2, boost::none, boost::none); &Similarity3::transformFrom, _1, _2, boost::none, boost::none);
Point3 q(1, 2, 3); Point3 q(1, 2, 3);
for (const auto T : { T1, T2, T3, T4, T5, T6 }) { for (const auto& T : { T1, T2, T3, T4, T5, T6 }) {
Point3 q(1, 0, 0); Point3 q(1, 0, 0);
Matrix H1 = numericalDerivative21<Point3, Similarity3, Point3>(f, T, q); Matrix H1 = numericalDerivative21<Point3, Similarity3, Point3>(f, T, q);
Matrix H2 = numericalDerivative22<Point3, Similarity3, Point3>(f, T, q); Matrix H2 = numericalDerivative22<Point3, Similarity3, Point3>(f, T, q);