Index: test/CMakeLists.txt
===================================================================
--- test/CMakeLists.txt	(revision 513)
+++ test/CMakeLists.txt	(revision 531)
@@ -22,4 +22,5 @@
   error_test
   euler_test
+  gomory_hu_test
   graph_copy_test
   graph_test
Index: test/Makefile.am
===================================================================
--- test/Makefile.am	(revision 513)
+++ test/Makefile.am	(revision 531)
@@ -18,4 +18,5 @@
 	test/error_test \
 	test/euler_test \
+	test/gomory_hu_test \
 	test/graph_copy_test \
 	test/graph_test \
@@ -58,4 +59,5 @@
 test_error_test_SOURCES = test/error_test.cc
 test_euler_test_SOURCES = test/euler_test.cc
+test_gomory_hu_test_SOURCES = test/gomory_hu_test.cc
 test_graph_copy_test_SOURCES = test/graph_copy_test.cc
 test_graph_test_SOURCES = test/graph_test.cc
Index: test/gomory_hu_test.cc
===================================================================
--- test/gomory_hu_test.cc	(revision 531)
+++ test/gomory_hu_test.cc	(revision 531)
@@ -0,0 +1,85 @@
+#include <iostream>
+
+#include "test_tools.h"
+#include <lemon/smart_graph.h>
+#include <lemon/adaptors.h>
+#include <lemon/lgf_reader.h>
+#include <lemon/lgf_writer.h>
+#include <lemon/dimacs.h>
+#include <lemon/time_measure.h>
+#include <lemon/gomory_hu_tree.h>
+#include <cstdlib>
+
+using namespace std;
+using namespace lemon;
+
+typedef SmartGraph Graph;
+
+char test_lgf[] =
+  "@nodes\n"
+  "label\n"
+  "0\n"
+  "1\n"
+  "2\n"
+  "3\n"
+  "4\n"
+  "@arcs\n"
+  "     label capacity\n"
+  "0 1  0     1\n"
+  "1 2  1     1\n"
+  "2 3  2     1\n"
+  "0 3  4     5\n"
+  "0 3  5     10\n"
+  "0 3  6     7\n"
+  "4 2  7     1\n"
+  "@attributes\n"
+  "source 0\n"
+  "target 3\n";
+  
+GRAPH_TYPEDEFS(Graph);
+typedef Graph::EdgeMap<int> IntEdgeMap;
+typedef Graph::NodeMap<bool> BoolNodeMap;
+
+int cutValue(const Graph& graph, const BoolNodeMap& cut,
+	     const IntEdgeMap& capacity) {
+
+  int sum = 0;
+  for (EdgeIt e(graph); e != INVALID; ++e) {
+    Node s = graph.u(e);
+    Node t = graph.v(e);
+
+    if (cut[s] != cut[t]) {
+      sum += capacity[e];
+    }
+  }
+  return sum;
+}
+
+
+int main() {
+  Graph graph;
+  IntEdgeMap capacity(graph);
+
+  std::istringstream input(test_lgf);
+  GraphReader<Graph>(graph, input).
+    edgeMap("capacity", capacity).run();
+
+  GomoryHuTree<Graph> ght(graph, capacity);
+  ght.init();
+  ght.run();
+
+  for (NodeIt u(graph); u != INVALID; ++u) {
+    for (NodeIt v(graph); v != u; ++v) {
+      Preflow<Graph, IntEdgeMap> pf(graph, capacity, u, v);
+      pf.runMinCut();
+      BoolNodeMap cm(graph);
+      ght.minCutMap(u, v, cm);
+      check(pf.flowValue() == ght.minCutValue(u, v), "Wrong cut 1");
+      check(cm[u] != cm[v], "Wrong cut 3");
+      check(pf.flowValue() == cutValue(graph, cm, capacity), "Wrong cut 2");
+      
+    }
+  }
+  
+  return 0;
+}
Index: test/lp_test.cc
===================================================================
--- test/lp_test.cc	(revision 530)
+++ test/lp_test.cc	(revision 462)
@@ -198,9 +198,4 @@
     check(const_cast<const LpSolver::Expr&>(e)[p2]==0, buf.str());
 
-    //Test for clone/new
-    LP* lpnew = lp.newSolver();
-    LP* lpclone = lp.cloneSolver();
-    delete lpnew;
-    delete lpclone;
 
   }
@@ -253,6 +248,5 @@
   if (stat ==  LpSolver::OPTIMAL) {
     std::ostringstream sbuf;
-    sbuf << "Wrong optimal value (" << lp.primal() <<") with "
-         << lp.solverName() <<"\n     the right optimum is " << exp_opt;
+    sbuf << "Wrong optimal value: the right optimum is " << exp_opt;
     check(std::abs(lp.primal()-exp_opt) < 1e-3, sbuf.str());
   }
@@ -362,17 +356,4 @@
 }
 
-template<class LP>
-void cloneTest()
-{
-  //Test for clone/new
-  
-  LP* lp = new LP();
-  LP* lpnew = lp->newSolver();
-  LP* lpclone = lp->cloneSolver();
-  delete lp;
-  delete lpnew;
-  delete lpclone;
-}
-
 int main()
 {
@@ -385,5 +366,4 @@
     lpTest(lp_glpk1);
     aTest(lp_glpk2);
-    cloneTest<GlpkLp>();
   }
 #endif
@@ -402,5 +382,4 @@
 #endif
   }
-    cloneTest<CplexLp>();
 #endif
 
@@ -410,5 +389,4 @@
     lpTest(lp_soplex1);
     aTest(lp_soplex2);
-    cloneTest<SoplexLp>();
   }
 #endif
@@ -419,5 +397,4 @@
     lpTest(lp_clp1);
     aTest(lp_clp2);
-    cloneTest<ClpLp>();
   }
 #endif
Index: test/mip_test.cc
===================================================================
--- test/mip_test.cc	(revision 530)
+++ test/mip_test.cc	(revision 462)
@@ -107,15 +107,4 @@
 }
 
-template<class MIP>
-void cloneTest()
-{
-  
-  MIP* mip = new MIP();
-  MIP* mipnew = mip->newSolver();
-  MIP* mipclone = mip->cloneSolver();
-  delete mip;
-  delete mipnew;
-  delete mipclone;
-}
 
 int main()
@@ -126,5 +115,4 @@
     GlpkMip mip1;
     aTest(mip1);
-    cloneTest<GlpkMip>();
   }
 #endif
@@ -142,5 +130,4 @@
 #endif
   }
-  cloneTest<CplexMip>();
 #endif
 
