MCPcopy Create free account
hub / github.com/comaps/comaps / check_set_from_rect

Function check_set_from_rect

libs/geometry/geometry_tests/screen_test.cpp:12–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10using test::is_equal;
11
12static void check_set_from_rect(ScreenBase & screen, int width, int height)
13{
14 screen.OnSize(0, 0, width, height);
15
16 m2::PointD b1(0.0, 0.0);
17 m2::PointD b2(300.0, 300.0);
18 screen.SetFromRect(m2::AnyRectD(m2::RectD(b1, b2)));
19
20 b1 = screen.GtoP(b1);
21 b2 = screen.GtoP(b2);
22
23 // check that we are in boundaries.
24 TEST(math::Between(0, width, math::iround(b1.x)), ());
25 TEST(math::Between(0, width, math::iround(b2.x)), ());
26 TEST(math::Between(0, height, math::iround(b1.y)), ());
27 TEST(math::Between(0, height, math::iround(b2.y)), ());
28}
29
30UNIT_TEST(ScreenBase_P2G2P)
31{

Callers 1

UNIT_TESTFunction · 0.85

Calls 6

TESTFunction · 0.85
BetweenFunction · 0.50
iroundFunction · 0.50
OnSizeMethod · 0.45
SetFromRectMethod · 0.45
GtoPMethod · 0.45

Tested by

no test coverage detected