Add polygon data tests.

This commit is contained in:
vng 2011-09-07 19:23:53 +03:00 committed by Alex Zolotarev
parent c4e18de1fb
commit bf694656b5
3 changed files with 109 additions and 0 deletions

View file

@ -13,6 +13,7 @@ include($$ROOT_DIR/common.pri)
HEADERS += \
equality.hpp \
large_polygon.hpp \
test_regions.hpp \
SOURCES += \
../../testing/testingmain.cpp \

View file

@ -1,5 +1,7 @@
#include "../../base/SRC_FIRST.hpp"
#include "test_regions.hpp"
#include "../../testing/testing.hpp"
#include "../region2d/binary_operators.hpp"
@ -82,3 +84,69 @@ UNIT_TEST(RegionDifference_Smoke)
TEST_EQUAL(res[0].GetRect(), m2::RectI(0, 0, 1, 1), ());
}
}
UNIT_TEST(RegionDifference_Data1)
{
using namespace geom_test;
vector<R> vec;
vec.push_back(R());
vec.back().Assign(arrB1, arrB1 + ARRAY_SIZE(arrB1));
vec.push_back(R());
vec.back().Assign(arrB2, arrB2 + ARRAY_SIZE(arrB2));
vec.push_back(R());
vec.back().Assign(arrB3, arrB3 + ARRAY_SIZE(arrB3));
vec.push_back(R());
vec.back().Assign(arrB4, arrB4 + ARRAY_SIZE(arrB4));
vec.push_back(R());
vec.back().Assign(arrB5, arrB5 + ARRAY_SIZE(arrB5));
vec.push_back(R());
vec.back().Assign(arrB6, arrB6 + ARRAY_SIZE(arrB6));
vec.push_back(R());
vec.back().Assign(arrB7, arrB7 + ARRAY_SIZE(arrB7));
vec.push_back(R());
vec.back().Assign(arrB8, arrB8 + ARRAY_SIZE(arrB8));
vec.push_back(R());
vec.back().Assign(arrB9, arrB9 + ARRAY_SIZE(arrB9));
vec.push_back(R());
vec.back().Assign(arrB10, arrB10 + ARRAY_SIZE(arrB10));
vec.push_back(R());
vec.back().Assign(arrB11, arrB11 + ARRAY_SIZE(arrB11));
vec.push_back(R());
vec.back().Assign(arrB12, arrB12 + ARRAY_SIZE(arrB12));
vec.push_back(R());
vec.back().Assign(arrB13, arrB13 + ARRAY_SIZE(arrB13));
vec.push_back(R());
vec.back().Assign(arrB14, arrB14 + ARRAY_SIZE(arrB14));
vec.push_back(R());
vec.back().Assign(arrB15, arrB15 + ARRAY_SIZE(arrB15));
vector<R> res;
res.push_back(R());
res.back().Assign(arrMain, arrMain + ARRAY_SIZE(arrMain));
for (size_t i = 0; i < vec.size(); ++i)
{
vector<R> local;
for (size_t j = 0; j < res.size(); ++j)
m2::DiffRegions(res[j], vec[i], local);
local.swap(res);
}
}

File diff suppressed because one or more lines are too long