Changes in test/preflow_test.cc [394:e7707b3069f1:423:ff48c2738fb2] in lemon-main
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/preflow_test.cc
r394 r423 17 17 */ 18 18 19 #include <fstream> 20 #include <string> 19 #include <iostream> 21 20 22 21 #include "test_tools.h" … … 29 28 30 29 using namespace lemon; 30 31 char test_lgf[] = 32 "@nodes\n" 33 "label\n" 34 "0\n" 35 "1\n" 36 "2\n" 37 "3\n" 38 "4\n" 39 "5\n" 40 "6\n" 41 "7\n" 42 "8\n" 43 "9\n" 44 "@arcs\n" 45 " label capacity\n" 46 "0 1 0 20\n" 47 "0 2 1 0\n" 48 "1 1 2 3\n" 49 "1 2 3 8\n" 50 "1 3 4 8\n" 51 "2 5 5 5\n" 52 "3 2 6 5\n" 53 "3 5 7 5\n" 54 "3 6 8 5\n" 55 "4 3 9 3\n" 56 "5 7 10 3\n" 57 "5 6 11 10\n" 58 "5 8 12 10\n" 59 "6 8 13 8\n" 60 "8 9 14 20\n" 61 "8 1 15 5\n" 62 "9 5 16 5\n" 63 "@attributes\n" 64 "source 1\n" 65 "target 8\n"; 31 66 32 67 void checkPreflowCompile() … … 124 159 typedef Preflow<Digraph, CapMap> PType; 125 160 126 std::string f_name;127 if( getenv("srcdir") )128 f_name = std::string(getenv("srcdir"));129 else f_name = ".";130 f_name += "/test/preflow_graph.lgf";131 132 std::ifstream file(f_name.c_str());133 134 check(file, "Input file '" << f_name << "' not found.");135 136 161 Digraph g; 137 162 Node s, t; 138 163 CapMap cap(g); 139 DigraphReader<Digraph>(g,file). 164 std::istringstream input(test_lgf); 165 DigraphReader<Digraph>(g,input). 140 166 arcMap("capacity", cap). 141 167 node("source",s).
Note: See TracChangeset
for help on using the changeset viewer.