Mercurial Hosting > traffic-intelligence
diff c/test_graph.cpp @ 196:aeab0b88c9b6
began testing of FeatureGraph
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Tue, 20 Dec 2011 00:31:37 -0500 |
parents | |
children | 0a27fa343257 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/c/test_graph.cpp Tue Dec 20 00:31:37 2011 -0500 @@ -0,0 +1,30 @@ +#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, 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()