mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-06 04:24:29 +00:00
Format all C++ and Java code via clang-format
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
@@ -8,14 +8,10 @@
|
||||
|
||||
namespace
|
||||
{
|
||||
glsl::mat4 const kTestMatrix1 = glsl::mat4(1.0f, 2.0f, 3.0f, 4.0f,
|
||||
1.0f, 2.0f, 3.0f, 4.0f,
|
||||
1.0f, 2.0f, 3.0f, 4.0f,
|
||||
1.0f, 2.0f, 3.0f, 4.0f);
|
||||
glsl::mat4 const kTestMatrix2 = glsl::mat4(4.0f, 3.0f, 2.0f, 1.0f,
|
||||
4.0f, 3.0f, 2.0f, 1.0f,
|
||||
4.0f, 3.0f, 2.0f, 1.0f,
|
||||
4.0f, 3.0f, 2.0f, 1.0f);
|
||||
glsl::mat4 const kTestMatrix1 =
|
||||
glsl::mat4(1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f);
|
||||
glsl::mat4 const kTestMatrix2 =
|
||||
glsl::mat4(4.0f, 3.0f, 2.0f, 1.0f, 4.0f, 3.0f, 2.0f, 1.0f, 4.0f, 3.0f, 2.0f, 1.0f, 4.0f, 3.0f, 2.0f, 1.0f);
|
||||
} // namespace
|
||||
|
||||
UNIT_TEST(FrameValues_SetTo)
|
||||
|
||||
@@ -38,34 +38,30 @@ UNIT_TEST(Navigator_Scale2Points)
|
||||
ScreenBase const & screen = navigator.Screen();
|
||||
TEST_EQUAL(screen.ClipRect(), m2::RectD(0, 0, 8, 4), ());
|
||||
|
||||
navigator.StartScale(screen.GtoP(m2::PointD(1, 1)),
|
||||
screen.GtoP(m2::PointD(7, 1)));
|
||||
navigator.StopScale(screen.GtoP(m2::PointD(1, 1)),
|
||||
screen.GtoP(m2::PointD(4, 1)));
|
||||
navigator.StartScale(screen.GtoP(m2::PointD(1, 1)), screen.GtoP(m2::PointD(7, 1)));
|
||||
navigator.StopScale(screen.GtoP(m2::PointD(1, 1)), screen.GtoP(m2::PointD(4, 1)));
|
||||
TEST_EQUAL(screen.ClipRect(), m2::RectD(-1, -1, 15, 7), ());
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
void CheckNavigator(df::Navigator const & nav)
|
||||
void CheckNavigator(df::Navigator const & nav)
|
||||
{
|
||||
typedef m2::PointD P;
|
||||
m2::RectD clipR = nav.Screen().ClipRect();
|
||||
|
||||
P arr[] = {clipR.LeftTop(), clipR.RightTop(), clipR.RightBottom(), clipR.LeftBottom(), clipR.Center()};
|
||||
|
||||
for (size_t i = 0; i < ARRAY_SIZE(arr); ++i)
|
||||
{
|
||||
typedef m2::PointD P;
|
||||
m2::RectD clipR = nav.Screen().ClipRect();
|
||||
|
||||
P arr[] = { clipR.LeftTop(), clipR.RightTop(),
|
||||
clipR.RightBottom(), clipR.LeftBottom(),
|
||||
clipR.Center() };
|
||||
|
||||
for (size_t i = 0; i < ARRAY_SIZE(arr); ++i)
|
||||
{
|
||||
P const & pxP = arr[i];
|
||||
P const gP = nav.PtoG(pxP);
|
||||
P const pxP2 = nav.GtoP(gP);
|
||||
TEST(AlmostEqualAbs(pxP.x, pxP2.x, 0.00001), (pxP.x, pxP2.x));
|
||||
TEST(AlmostEqualAbs(pxP.y, pxP2.y, 0.00001), (pxP.y, pxP2.y));
|
||||
}
|
||||
P const & pxP = arr[i];
|
||||
P const gP = nav.PtoG(pxP);
|
||||
P const pxP2 = nav.GtoP(gP);
|
||||
TEST(AlmostEqualAbs(pxP.x, pxP2.x, 0.00001), (pxP.x, pxP2.x));
|
||||
TEST(AlmostEqualAbs(pxP.y, pxP2.y, 0.00001), (pxP.y, pxP2.y));
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
UNIT_TEST(Navigator_G2P_P2G)
|
||||
{
|
||||
@@ -83,6 +79,6 @@ UNIT_TEST(Navigator_G2P_P2G)
|
||||
navigator.Scale(center, 3.0);
|
||||
CheckNavigator(navigator);
|
||||
|
||||
navigator.Scale(center, 1/3.0);
|
||||
navigator.Scale(center, 1 / 3.0);
|
||||
CheckNavigator(navigator);
|
||||
}
|
||||
|
||||
@@ -10,13 +10,11 @@ namespace
|
||||
bool IsSmooth(m2::SplineEx const & spline)
|
||||
{
|
||||
for (size_t i = 0, sz = spline.GetDirections().size(); i + 1 < sz; ++i)
|
||||
{
|
||||
if (!df::IsValidSplineTurn(spline.GetDirections()[i], spline.GetDirections()[i + 1]))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
UNIT_TEST(Rounding_Spline)
|
||||
{
|
||||
|
||||
@@ -19,6 +19,6 @@ UNIT_TEST(Stylist_IsHatching)
|
||||
TEST(checker(cl.GetTypeByPath({"boundary", "national_park"})), ());
|
||||
|
||||
TEST(checker(cl.GetTypeByPath({"landuse", "military", "danger_area"})), ());
|
||||
|
||||
|
||||
TEST(checker(cl.GetTypeByPath({"amenity", "prison"})), ());
|
||||
}
|
||||
|
||||
@@ -17,8 +17,7 @@ namespace
|
||||
class UserEventStreamTest : df::UserEventStream::Listener
|
||||
{
|
||||
public:
|
||||
explicit UserEventStreamTest(bool filtrateTouches)
|
||||
: m_filtrate(filtrateTouches)
|
||||
explicit UserEventStreamTest(bool filtrateTouches) : m_filtrate(filtrateTouches)
|
||||
{
|
||||
m_stream.SetTestBridge(std::bind(&UserEventStreamTest::TestBridge, this, _1));
|
||||
}
|
||||
@@ -40,16 +39,13 @@ public:
|
||||
void OnScaleEnded() override {}
|
||||
void OnTouchMapAction(df::TouchEvent::ETouchType touchType, bool isMapTouch) override {}
|
||||
void OnAnimatedScaleEnded() override {}
|
||||
bool OnNewVisibleViewport(m2::RectD const & oldViewport, m2::RectD const & newViewport,
|
||||
bool needOffset, m2::PointD & gOffset) override
|
||||
bool OnNewVisibleViewport(m2::RectD const & oldViewport, m2::RectD const & newViewport, bool needOffset,
|
||||
m2::PointD & gOffset) override
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void AddUserEvent(df::TouchEvent const & event)
|
||||
{
|
||||
m_stream.AddEvent(make_unique_dp<df::TouchEvent>(event));
|
||||
}
|
||||
void AddUserEvent(df::TouchEvent const & event) { m_stream.AddEvent(make_unique_dp<df::TouchEvent>(event)); }
|
||||
|
||||
void SetRect(m2::RectD const & r)
|
||||
{
|
||||
@@ -58,10 +54,7 @@ public:
|
||||
nullptr /* parallelAnimCreator */));
|
||||
}
|
||||
|
||||
void AddExpectation(char const * action)
|
||||
{
|
||||
m_expectation.push_back(action);
|
||||
}
|
||||
void AddExpectation(char const * action) { m_expectation.push_back(action); }
|
||||
|
||||
void RunTest()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user