19 #include <boost/test/unit_test.hpp>
25 BOOST_AUTO_TEST_SUITE(router)
36 boost::int32_t cost1 = 4;
37 boost::int32_t cost2 = 5;
38 Arc arc1(tilewire1, tilewire2);
39 Arc arc2(tilewire2, tilewire3);
45 + (3 *
sizeof(boost::int32_t)));
46 BOOST_CHECK_EQUAL(
sizeof(
RouteNode), 32u);
54 RouteNode* routenode3 =
new RouteNode(tilewire3, tilewire4, cost2, cost2, 2, routenode2);
56 BOOST_CHECK_EQUAL(routenode1 != 0,
true);
57 BOOST_CHECK_EQUAL(routenode2 != 0,
true);
58 BOOST_CHECK_EQUAL(routenode3 != 0,
true);
59 BOOST_CHECK_EQUAL(routenode4 != 0,
true);
70 BOOST_CHECK_EQUAL(arc1t == arc1,
true);
73 BOOST_CHECK_EQUAL(routenode3->
getCost() == cost2,
true);
74 BOOST_CHECK_EQUAL(routenode4->
getCost() == 0,
true);
75 BOOST_CHECK_EQUAL(routenode3->
getPathCost() == cost2,
true);
77 BOOST_CHECK_EQUAL(routenode4->
getCost() == 42,
true);
78 BOOST_CHECK_EQUAL(routenode3->
getParent() == routenode2,
true);
79 BOOST_CHECK_EQUAL(routenode3->
getTop() == routenode1,
true);
83 BOOST_CHECK_EQUAL(compare(routenode1, routenode1),
false);
84 BOOST_CHECK_EQUAL(compare(routenode2, routenode3),
false);
85 BOOST_CHECK_EQUAL(compare(routenode3, routenode2),
true);
93 BOOST_AUTO_TEST_SUITE_END()
const boost::int32_t getPathCost() const
Get the path cost.
Encapsulation of a tile index in an unsigned 32-bit integer.
Encapsulation of an arc between two tilewires.
RouteNode * getParent() const
Get the node's parent.
Header for the RouteNode class.
Encapsulation of a wire index in an unsigned 16-bit integer.
Binary predicate for comparing RouteNode pointers based on cost.
const Tilewire & getSinkTilewire() const
Get the sink Tilewire.
void setCost(boost::int32_t inHeuristicCost)
Set the heuristic node cost.
Encapsulation of a device tile and wire pair.
const Tilewire & getSourceTilewire() const
Get the source Tilewire.
const Arc & getArc() const
Get the associated Arc.
RouteNode * getTop()
Return the top node by tracing parent pointers.
An object that holds an arc and path information for routing.
BOOST_AUTO_TEST_CASE(NetRouterHeuristicT)
Unit test for the Heuristic.
const boost::int32_t getCost() const
Get the heuristic node cost.