view c/test_graph.cpp @ 200:0a27fa343257

added one test and cleaned the first and last instant mess
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Fri, 02 Mar 2012 19:32:54 -0500
parents aeab0b88c9b6
children f7ddfc4aeb1e
line wrap: on
line source

#include "Motion.hpp"
#include "testutils.hpp"

#include "opencv2/core/core.hpp"

#include <boost/test/unit_test.hpp>
#include <boost/test/floating_point_comparison.hpp>

using namespace std;
using namespace cv;

BOOST_AUTO_TEST_SUITE(test_graph)

BOOST_AUTO_TEST_CASE(graph_add_delete) {
  FeatureGraph featureGraph(5, 1, 5 /* min time interval */, 1.);
  FeatureTrajectoryPtr ft1 = createFeatureTrajectory(10, 20, Point2f(1,1), Point2f(0.5, 0.));
  FeatureTrajectoryPtr ft2 = createFeatureTrajectory(10, 20, Point2f(1.1,1), Point2f(0.5, 0.));

  featureGraph.addFeature(ft1);
  BOOST_CHECK_EQUAL(featureGraph.getNVertices(), 1);
  BOOST_CHECK_EQUAL(featureGraph.getNEdges(), 0);

  featureGraph.addFeature(ft2);
  BOOST_CHECK_EQUAL(featureGraph.getNVertices(), 2);
  BOOST_CHECK_EQUAL(featureGraph.getNEdges(), 1);

  
}

BOOST_AUTO_TEST_SUITE_END()