Index: test/CMakeLists.txt
===================================================================
--- test/CMakeLists.txt	(revision 522)
+++ test/CMakeLists.txt	(revision 528)
@@ -30,4 +30,5 @@
   maps_test
   max_matching_test
+  min_cost_arborescence_test
   path_test
   preflow_test
Index: test/Makefile.am
===================================================================
--- test/Makefile.am	(revision 522)
+++ test/Makefile.am	(revision 528)
@@ -26,4 +26,5 @@
 	test/maps_test \
 	test/max_matching_test \
+	test/min_cost_arborescence_test \
 	test/path_test \
 	test/preflow_test \
@@ -67,4 +68,5 @@
 test_mip_test_SOURCES = test/mip_test.cc
 test_max_matching_test_SOURCES = test/max_matching_test.cc
+test_min_cost_arborescence_test_SOURCES = test/min_cost_arborescence_test.cc
 test_path_test_SOURCES = test/path_test.cc
 test_preflow_test_SOURCES = test/preflow_test.cc
Index: test/euler_test.cc
===================================================================
--- test/euler_test.cc	(revision 522)
+++ test/euler_test.cc	(revision 531)
@@ -26,9 +26,9 @@
 void checkDiEulerIt(const Digraph& g)
 {
-  typename Digraph::template ArcMap<int> visitationNumber(g);
+  typename Digraph::template ArcMap<int> visitationNumber(g, 0);
 
   DiEulerIt<Digraph> e(g);
   typename Digraph::Node firstNode = g.source(e);
-  typename Digraph::Node lastNode;
+  typename Digraph::Node lastNode = g.target(e);
 
   for (; e != INVALID; ++e)
@@ -54,9 +54,9 @@
 void checkEulerIt(const Graph& g)
 {
-  typename Graph::template EdgeMap<int> visitationNumber(g);
+  typename Graph::template EdgeMap<int> visitationNumber(g, 0);
 
   EulerIt<Graph> e(g);
   typename Graph::Node firstNode = g.u(e);
-  typename Graph::Node lastNode;
+  typename Graph::Node lastNode = g.v(e);
 
   for (; e != INVALID; ++e)
Index: test/lp_test.cc
===================================================================
--- test/lp_test.cc	(revision 538)
+++ test/lp_test.cc	(revision 540)
@@ -198,4 +198,9 @@
     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;
 
   }
@@ -248,5 +253,6 @@
   if (stat ==  LpSolver::OPTIMAL) {
     std::ostringstream sbuf;
-    sbuf << "Wrong optimal value: the right optimum is " << exp_opt;
+    sbuf << "Wrong optimal value (" << lp.primal() <<") with "
+         << lp.solverName() <<"\n     the right optimum is " << exp_opt;
     check(std::abs(lp.primal()-exp_opt) < 1e-3, sbuf.str());
   }
@@ -356,4 +362,17 @@
 }
 
+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()
 {
@@ -366,4 +385,5 @@
     lpTest(lp_glpk1);
     aTest(lp_glpk2);
+    cloneTest<GlpkLp>();
   }
 #endif
@@ -382,4 +402,5 @@
 #endif
   }
+    cloneTest<CplexLp>();
 #endif
 
@@ -389,4 +410,5 @@
     lpTest(lp_soplex1);
     aTest(lp_soplex2);
+    cloneTest<SoplexLp>();
   }
 #endif
@@ -397,4 +419,5 @@
     lpTest(lp_clp1);
     aTest(lp_clp2);
+    cloneTest<ClpLp>();
   }
 #endif
Index: test/min_cost_arborescence_test.cc
===================================================================
--- test/min_cost_arborescence_test.cc	(revision 490)
+++ test/min_cost_arborescence_test.cc	(revision 490)
@@ -0,0 +1,146 @@
+/* -*- mode: C++; indent-tabs-mode: nil; -*-
+ *
+ * This file is a part of LEMON, a generic C++ optimization library.
+ *
+ * Copyright (C) 2003-2008
+ * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
+ * (Egervary Research Group on Combinatorial Optimization, EGRES).
+ *
+ * Permission to use, modify and distribute this software is granted
+ * provided that this copyright notice appears in all copies. For
+ * precise terms see the accompanying LICENSE file.
+ *
+ * This software is provided "AS IS" with no warranty of any kind,
+ * express or implied, and with no claim as to its suitability for any
+ * purpose.
+ *
+ */
+
+#include <iostream>
+#include <set>
+#include <vector>
+#include <iterator>
+
+#include <lemon/smart_graph.h>
+#include <lemon/min_cost_arborescence.h>
+#include <lemon/lgf_reader.h>
+
+#include "test_tools.h"
+
+using namespace lemon;
+using namespace std;
+
+const char test_lgf[] =
+  "@nodes\n"
+  "label\n"
+  "0\n"
+  "1\n"
+  "2\n"
+  "3\n"
+  "4\n"
+  "5\n"
+  "6\n"
+  "7\n"
+  "8\n"
+  "9\n"
+  "@arcs\n"
+  "     label  cost\n"
+  "1 8  0      107\n"
+  "0 3  1      70\n"
+  "2 1  2      46\n"
+  "4 1  3      28\n"
+  "4 4  4      91\n"
+  "3 9  5      76\n"
+  "9 8  6      61\n"
+  "8 1  7      39\n"
+  "9 8  8      74\n"
+  "8 0  9      39\n"
+  "4 3  10     45\n"
+  "2 2  11     34\n"
+  "0 1  12     100\n"
+  "6 3  13     95\n"
+  "4 1  14     22\n"
+  "1 1  15     31\n"
+  "7 2  16     51\n"
+  "2 6  17     29\n"
+  "8 3  18     115\n"
+  "6 9  19     32\n"
+  "1 1  20     60\n"
+  "0 3  21     40\n"
+  "@attributes\n"
+  "source 0\n";
+
+int main() {
+  typedef SmartDigraph Digraph;
+  DIGRAPH_TYPEDEFS(Digraph);
+
+  typedef Digraph::ArcMap<double> CostMap;
+
+  Digraph digraph;
+  CostMap cost(digraph);
+  Node source;
+
+  std::istringstream is(test_lgf);
+  digraphReader(digraph, is).
+    arcMap("cost", cost).
+    node("source", source).run();
+
+  MinCostArborescence<Digraph, CostMap> mca(digraph, cost);
+  mca.run(source);
+
+  vector<pair<double, set<Node> > > dualSolution(mca.dualNum());
+
+  for (int i = 0; i < mca.dualNum(); ++i) {
+    dualSolution[i].first = mca.dualValue(i);
+    for (MinCostArborescence<Digraph, CostMap>::DualIt it(mca, i);
+         it != INVALID; ++it) {
+      dualSolution[i].second.insert(it);
+    }
+  }
+
+  for (ArcIt it(digraph); it != INVALID; ++it) {
+    if (mca.reached(digraph.source(it))) {
+      double sum = 0.0;
+      for (int i = 0; i < int(dualSolution.size()); ++i) {
+        if (dualSolution[i].second.find(digraph.target(it))
+            != dualSolution[i].second.end() &&
+            dualSolution[i].second.find(digraph.source(it))
+            == dualSolution[i].second.end()) {
+          sum += dualSolution[i].first;
+        }
+      }
+      if (mca.arborescence(it)) {
+        check(sum == cost[it], "INVALID DUAL");
+      }
+      check(sum <= cost[it], "INVALID DUAL");
+    }
+  }
+
+
+  check(mca.dualValue() == mca.arborescenceValue(), "INVALID DUAL");
+
+  check(mca.reached(source), "INVALID ARBORESCENCE");
+  for (ArcIt a(digraph); a != INVALID; ++a) {
+    check(!mca.reached(digraph.source(a)) ||
+          mca.reached(digraph.target(a)), "INVALID ARBORESCENCE");
+  }
+
+  for (NodeIt n(digraph); n != INVALID; ++n) {
+    if (!mca.reached(n)) continue;
+    int cnt = 0;
+    for (InArcIt a(digraph, n); a != INVALID; ++a) {
+      if (mca.arborescence(a)) {
+        check(mca.pred(n) == a, "INVALID ARBORESCENCE");
+        ++cnt;
+      }
+    }
+    check((n == source ? cnt == 0 : cnt == 1), "INVALID ARBORESCENCE");
+  }
+
+  Digraph::ArcMap<bool> arborescence(digraph);
+  check(mca.arborescenceValue() ==
+        minCostArborescence(digraph, cost, source, arborescence),
+        "WRONG FUNCTION");
+
+  return 0;
+}
Index: test/mip_test.cc
===================================================================
--- test/mip_test.cc	(revision 538)
+++ test/mip_test.cc	(revision 540)
@@ -107,4 +107,15 @@
 }
 
+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()
@@ -115,4 +126,5 @@
     GlpkMip mip1;
     aTest(mip1);
+    cloneTest<GlpkMip>();
   }
 #endif
@@ -130,4 +142,5 @@
 #endif
   }
+  cloneTest<CplexMip>();
 #endif
 
