Commit dc92ea93 authored by Michaël Roynard's avatar Michaël Roynard

Cleanup

parent 582356c0
......@@ -4,7 +4,7 @@ project(MILENA)
# Add FindTBB directory to CMake's module path
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
find_package(Boost 1.42 COMPONENTS program_options unit_test_framework REQUIRED)
find_package(Boost 1.42 COMPONENTS program_options REQUIRED)
find_package(FreeImage REQUIRED)
find_package(TBB)
find_package(Qt4)
......
......@@ -12,15 +12,15 @@ TEST(Accu, Sum)
acc.take(12);
acc.take("blabla");
ASSERT_EQ(extractor::count(acc), 2);
ASSERT_EQ(extractor::count(acc), 2u);
acc.untake(13);
ASSERT_EQ(extractor::count(acc), 1);
ASSERT_EQ(extractor::count(acc), 1u);
acc2.take(69);
acc.take(69);
acc2.take(acc);
ASSERT_EQ(extractor::count(acc2), 3);
ASSERT_EQ(extractor::count(acc2), 3u);
}
......@@ -13,23 +13,23 @@ TEST(Accu, Mean)
acc.take(5);
acc.take(15);
ASSERT_EQ(extractor::sum(acc), 20);
ASSERT_EQ(extractor::count(acc), 2);
ASSERT_EQ(extractor::mean(acc), 10);
ASSERT_EQ(extractor::sum(acc), 20u);
ASSERT_EQ(extractor::count(acc), 2u);
ASSERT_EQ(extractor::mean(acc), 10u);
acc.untake(10);
ASSERT_EQ(extractor::sum(acc), 10);
ASSERT_EQ(extractor::count(acc), 1);
ASSERT_EQ(extractor::mean(acc), 10);
ASSERT_EQ(extractor::sum(acc), 10u);
ASSERT_EQ(extractor::count(acc), 1u);
ASSERT_EQ(extractor::mean(acc), 10u);
acc2.take(20);
acc2.take(40);
acc2.take(acc);
ASSERT_EQ(extractor::sum(acc2), 70);
ASSERT_EQ(extractor::count(acc2), 3);
ASSERT_EQ(extractor::mean(acc2), 23);
ASSERT_EQ(extractor::sum(acc2), 70u);
ASSERT_EQ(extractor::count(acc2), 3u);
ASSERT_EQ(extractor::mean(acc2), 23u);
}
TEST(Accu, Mean_vec)
......@@ -44,12 +44,12 @@ TEST(Accu, Mean_vec)
acc.take(rgb8{(uint8)255, (uint8)5, (uint8)255});
ASSERT_EQ(extractor::sum(acc), (rgb<int>{260, 10, 510}));
ASSERT_EQ(extractor::count(acc), 2);
ASSERT_EQ(extractor::count(acc), 2u);
ASSERT_EQ(extractor::mean(acc), (rgb8{(uint8)130, (uint8)5, (uint8)255}));
acc.untake(rgb8{(uint8)10, (uint8)10, (uint8)10});
ASSERT_EQ(extractor::sum(acc), (rgb<int>{250, 0, 500}));
ASSERT_EQ(extractor::count(acc), 1);
ASSERT_EQ(extractor::count(acc), 1u);
ASSERT_EQ(extractor::mean(acc), (rgb<int>{250, 0, 500}));
}
......@@ -12,14 +12,14 @@ TEST(Accu, Sum)
acc.take(12);
acc.take(13);
ASSERT_EQ(extractor::sum(acc), 25);
ASSERT_EQ(extractor::sum(acc), 25u);
acc.untake(10);
ASSERT_EQ(extractor::sum(acc), 15);
ASSERT_EQ(extractor::sum(acc), 15u);
acc2.take(69);
acc2.take(acc);
ASSERT_EQ(extractor::sum(acc2), 84);
ASSERT_EQ(extractor::sum(acc2), 84u);
}
......@@ -11,7 +11,7 @@ struct iterator_test
{
image2d<int> ima;
std::vector<int> values;
std::vector<int> indexes;
std::vector<unsigned> indexes;
void test_forward_viter()
{
......
......@@ -25,5 +25,5 @@ TEST(Core, range_filter)
ASSERT_TRUE(x.has(point2d{1, 1}));
ASSERT_TRUE(not x.has(point2d{0, 1}));
ASSERT_TRUE(not x.has(point2d{1, 0}));
ASSERT_EQ(sz, 33);
ASSERT_EQ(sz, 33u);
}
......@@ -12,7 +12,7 @@ TEST(Core, stdrange_compatibility)
std::array<int, 4> x = {{2, 5, 15, 22}};
ASSERT_EQ(rng::size(x), 4);
ASSERT_EQ(rng::size(x), 4u);
{
int i = 0;
......
......@@ -14,7 +14,7 @@ TEST(Core, ziprange)
std::array<int, 4> x{{2, 5, 15, 22}};
std::array<int, 4> y{{-2, -5, -15, -22}};
ASSERT_EQ(rng::size(x), 4);
ASSERT_EQ(rng::size(x), 4u);
auto z = rng::zip(x, y);
......
......@@ -15,7 +15,7 @@ TEST(Value, Integers)
Int<14> z = 12;
y += z;
++y;
ASSERT_EQ(y, 31);
ASSERT_EQ(y, 31u);
Int<7> zz = x + z;
ASSERT_EQ(zz, 25);
......
......@@ -52,7 +52,7 @@ TEST(Graph, graph_iteration)
box2d b({-2, -3}, {3, 4});
mln::graph::undirected_graph_image2d<char, float, c4_t> g(b, c4);
unsigned nv = 0, ne = 0;
int nv = 0, ne = 0;
mln_foreach (point2d p, g.vertices())
g.vertex(p) = 'a' + (nv++ % 26);
......
......@@ -17,7 +17,7 @@ TEST(GraphCut, graph_iteration)
typedef mln::graphcut::internal::graphcut_graph_t<char, float, c4_t> graph_t;
graph_t g(b, c4);
unsigned nv = 0, ne = 0;
int nv = 0, ne = 0;
mln_foreach (point2d p, g.vertices())
{
......
......@@ -19,7 +19,7 @@ TEST(Labeling, blobs_fast)
image2d<uint8> lbl;
unsigned nlabel;
std::tie(lbl, nlabel) = labeling::blobs(mask, c4, uint8());
ASSERT_EQ(nlabel, 13);
ASSERT_EQ(nlabel, 13u);
}
TEST(Labeling, blobs_custom)
......@@ -33,8 +33,8 @@ TEST(Labeling, blobs_custom)
unsigned nlabel;
std::tie(lbl, nlabel) = labeling::blobs(ima % 2 == 0, c4, uint8());
ASSERT_EQ(nlabel, 13);
ASSERT_EQ(nlabel, 13u);
std::tie(lbl, nlabel) = labeling::blobs(ima % 2 == 0, c8, uint8());
ASSERT_EQ(nlabel, 1);
ASSERT_EQ(nlabel, 1u);
}
......@@ -78,7 +78,7 @@ TEST(Morpho, component_tree_forward_iteration)
std::cout << y << ",";
std::cout << std::endl;
}
ASSERT_EQ(n, 7);
ASSERT_EQ(n, 7u);
}
TEST(Morpho, component_tree_backward_iteration)
......@@ -104,7 +104,7 @@ TEST(Morpho, component_tree_backward_iteration)
mln_reverse_foreach(auto y, x.pset()) std::cout << y << ",";
std::cout << std::endl;
}
ASSERT_EQ(n, 0);
ASSERT_EQ(n, 0u);
}
TEST(Morpho, component_tree_subtree)
......@@ -139,5 +139,5 @@ TEST(Morpho, component_tree_subtree)
std::cout << std::endl;
n++;
}
ASSERT_EQ(n, 3);
ASSERT_EQ(n, 3u);
}
......@@ -89,7 +89,7 @@ TEST(Morpho, property_image_nbh)
unsigned j = 0;
mln_forall (nx)
{
ASSERT_EQ(nx->val(), voisins[i][j]);
ASSERT_EQ(static_cast<unsigned>(nx->val()), voisins[i][j]);
ASSERT_EQ(nx->point().id(), voisins[i][j]);
++j;
}
......@@ -106,7 +106,7 @@ TEST(Morpho, property_image_nbh)
unsigned j = 0;
mln_forall (n)
{
ASSERT_EQ(ima(*n), voisins[i][j]);
ASSERT_EQ(static_cast<unsigned>(ima(*n)), voisins[i][j]);
ASSERT_TRUE(n->id() == voisins[i][j]);
++j;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment