From 23545cbab5c41fc03ad10d9714af58950844c1ae Mon Sep 17 00:00:00 2001 From: vng Date: Sat, 4 Jun 2011 16:04:41 +0300 Subject: [PATCH] Fix uninitialized variable. --- map/map_tests/map_foreach_test.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/map/map_tests/map_foreach_test.cpp b/map/map_tests/map_foreach_test.cpp index bf081e8b4c..3b6c616623 100644 --- a/map/map_tests/map_foreach_test.cpp +++ b/map/map_tests/map_foreach_test.cpp @@ -252,10 +252,13 @@ namespace int const level = scales::GetScaleLevel(r); - size_t errInd; + size_t const emptyInd = size_t(-1); + size_t errInd = emptyInd; if (!compare_sequence(v2, v1, compare_strings(), errInd)) { - src2.ForEachFeature(r, FindOffset(level, v2[errInd])); + if (errInd != emptyInd) + src2.ForEachFeature(r, FindOffset(level, v2[errInd])); + TEST(false, ("Failed for rect: ", r, "; Scale level = ", level, ". Etalon size = ", v2.size(), ". Index size = ", v1.size())); }