diff -r b84e68af8248 -r c8fa41fcc4a7 test/graph_copy_test.cc --- a/test/graph_copy_test.cc Thu Nov 25 22:45:29 2010 +0100 +++ b/test/graph_copy_test.cc Thu Dec 01 09:05:47 2011 +0100 @@ -221,24 +221,30 @@ SmartBpGraph::ArcMap fam(from); SmartBpGraph::EdgeMap fem(from); SmartBpGraph::Node fn = INVALID; + SmartBpGraph::RedNode frn = INVALID; + SmartBpGraph::BlueNode fbn = INVALID; SmartBpGraph::Arc fa = INVALID; SmartBpGraph::Edge fe = INVALID; - std::vector frnv; + std::vector frnv; for (int i = 0; i < nn; ++i) { - SmartBpGraph::Node node = from.addRedNode(); + SmartBpGraph::RedNode node = from.addRedNode(); frnv.push_back(node); fnm[node] = i * i; frnm[node] = i + i; - if (i == 0) fn = node; + if (i == 0) { + fn = node; + frn = node; + } } - std::vector fbnv; + std::vector fbnv; for (int i = 0; i < nn; ++i) { - SmartBpGraph::Node node = from.addBlueNode(); + SmartBpGraph::BlueNode node = from.addBlueNode(); fbnv.push_back(node); fnm[node] = i * i; fbnm[node] = i + i; + if (i == 0) fbn = node; } for (int i = 0; i < nn; ++i) { @@ -260,18 +266,20 @@ typename GR::template ArcMap tam(to); typename GR::template EdgeMap tem(to); typename GR::Node tn; + typename GR::RedNode trn; + typename GR::BlueNode tbn; typename GR::Arc ta; typename GR::Edge te; SmartBpGraph::NodeMap nr(from); - SmartBpGraph::RedMap rnr(from); - SmartBpGraph::BlueMap bnr(from); + SmartBpGraph::RedMap rnr(from); + SmartBpGraph::BlueMap bnr(from); SmartBpGraph::ArcMap ar(from); SmartBpGraph::EdgeMap er(from); typename GR::template NodeMap ncr(to); - typename GR::template RedMap rncr(to); - typename GR::template BlueMap bncr(to); + typename GR::template RedMap rncr(to); + typename GR::template BlueMap bncr(to); typename GR::template ArcMap acr(to); typename GR::template EdgeMap ecr(to); @@ -282,7 +290,8 @@ arcRef(ar).edgeRef(er). nodeCrossRef(ncr).redCrossRef(rncr).blueCrossRef(bncr). arcCrossRef(acr).edgeCrossRef(ecr). - node(fn, tn).arc(fa, ta).edge(fe, te).run(); + node(fn, tn).redNode(frn, trn).blueNode(fbn, tbn). + arc(fa, ta).edge(fe, te).run(); check(countNodes(from) == countNodes(to), "Wrong copy."); check(countRedNodes(from) == countRedNodes(to), "Wrong copy."); @@ -293,17 +302,24 @@ for (SmartBpGraph::NodeIt it(from); it != INVALID; ++it) { check(ncr[nr[it]] == it, "Wrong copy."); check(fnm[it] == tnm[nr[it]], "Wrong copy."); - if (from.red(it)) { - check(rnr[it] == nr[it], "Wrong copy."); - check(rncr[rnr[it]] == it, "Wrong copy."); - check(frnm[it] == trnm[rnr[it]], "Wrong copy."); - check(to.red(rnr[it]), "Wrong copy."); - } else { - check(bnr[it] == nr[it], "Wrong copy."); - check(bncr[bnr[it]] == it, "Wrong copy."); - check(fbnm[it] == tbnm[bnr[it]], "Wrong copy."); - check(to.blue(bnr[it]), "Wrong copy."); - } + } + + for (SmartBpGraph::RedIt it(from); it != INVALID; ++it) { + check(ncr[nr[it]] == it, "Wrong copy."); + check(fnm[it] == tnm[nr[it]], "Wrong copy."); + check(rnr[it] == nr[it], "Wrong copy."); + check(rncr[rnr[it]] == it, "Wrong copy."); + check(frnm[it] == trnm[rnr[it]], "Wrong copy."); + check(to.red(rnr[it]), "Wrong copy."); + } + + for (SmartBpGraph::BlueIt it(from); it != INVALID; ++it) { + check(ncr[nr[it]] == it, "Wrong copy."); + check(fnm[it] == tnm[nr[it]], "Wrong copy."); + check(bnr[it] == nr[it], "Wrong copy."); + check(bncr[bnr[it]] == it, "Wrong copy."); + check(fbnm[it] == tbnm[bnr[it]], "Wrong copy."); + check(to.blue(bnr[it]), "Wrong copy."); } for (SmartBpGraph::ArcIt it(from); it != INVALID; ++it) { @@ -342,6 +358,8 @@ check(er[ecr[it]] == it, "Wrong copy."); } check(tn == nr[fn], "Wrong copy."); + check(trn == rnr[frn], "Wrong copy."); + check(tbn == bnr[fbn], "Wrong copy."); check(ta == ar[fa], "Wrong copy."); check(te == er[fe], "Wrong copy.");