Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r85654 - trunk/libs/graph/test
From: jewillco_at_[hidden]
Date: 2013-09-12 10:01:50


Author: jewillco
Date: 2013-09-12 10:01:50 EDT (Thu, 12 Sep 2013)
New Revision: 85654
URL: http://svn.boost.org/trac/boost/changeset/85654

Log:
Fixing tests (hopefully) for VC++

Text files modified:
   trunk/libs/graph/test/cycle_canceling_test.cpp | 4 +++-
   trunk/libs/graph/test/min_cost_max_flow_utils.hpp | 9 +++++++--
   2 files changed, 10 insertions(+), 3 deletions(-)

Modified: trunk/libs/graph/test/cycle_canceling_test.cpp
==============================================================================
--- trunk/libs/graph/test/cycle_canceling_test.cpp Wed Sep 11 17:02:47 2013 (r85653)
+++ trunk/libs/graph/test/cycle_canceling_test.cpp 2013-09-12 10:01:50 EDT (Thu, 12 Sep 2013) (r85654)
@@ -51,8 +51,10 @@
     typedef boost::graph_traits<Graph>::edge_descriptor edge_descriptor;
     std::vector<edge_descriptor> pred(N);
 
+ boost::property_map<Graph, boost::vertex_index_t>::const_type idx = get(boost::vertex_index, g);
+
     boost::edmonds_karp_max_flow(g, s, t);
- boost::cycle_canceling(g, boost::distance_map(&dist[0]).predecessor_map(&pred[0]).vertex_index_map(boost::identity_property_map()));
+ boost::cycle_canceling(g, boost::distance_map(boost::make_iterator_property_map(dist.begin(), idx)).predecessor_map(boost::make_iterator_property_map(pred.begin(), idx)).vertex_index_map(idx));
 
     int cost = boost::find_flow_cost(g);
     BOOST_CHECK_EQUAL(cost, 29);

Modified: trunk/libs/graph/test/min_cost_max_flow_utils.hpp
==============================================================================
--- trunk/libs/graph/test/min_cost_max_flow_utils.hpp Wed Sep 11 17:02:47 2013 (r85653)
+++ trunk/libs/graph/test/min_cost_max_flow_utils.hpp 2013-09-12 10:01:50 EDT (Thu, 12 Sep 2013) (r85654)
@@ -10,6 +10,8 @@
 #ifndef SAMPLE_GRAPH_UNDIRECTED_HPP
 #define SAMPLE_GRAPH_UNDIRECTED_HPP
 
+#include <iostream>
+#include <cstdlib>
 #include <boost/graph/adjacency_list.hpp>
 
 
@@ -46,8 +48,11 @@
         Traits::edge_descriptor add(int v, int w, int weight, int capacity) {
             bool b;
             Traits::edge_descriptor e;
- boost::tie(e, b) = add_edge(v, w, m_g);
- assert(b);
+ boost::tie(e, b) = add_edge(vertex(v, m_g), vertex(w, m_g), m_g);
+ if (!b) {
+ std::cerr << "Edge between " << v << " and " << w << " already exists." << std::endl;
+ std::abort();
+ }
             m_cap[e] = capacity;
             m_w[e] = weight;
             return e;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk