From 637ca7015ef27f66b12669372ccf0d4d4f5340d3 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 7 May 2016 16:14:43 +0300 Subject: [PATCH] Unit test for the issue #485. --HG-- branch : develop --- src/test/ValentinaTest/tst_misc.cpp | 13 +++++++++++++ src/test/ValentinaTest/tst_misc.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/src/test/ValentinaTest/tst_misc.cpp b/src/test/ValentinaTest/tst_misc.cpp index fb979ca53..970a08cd2 100644 --- a/src/test/ValentinaTest/tst_misc.cpp +++ b/src/test/ValentinaTest/tst_misc.cpp @@ -28,6 +28,7 @@ #include "tst_misc.h" #include "../vmisc/def.h" +#include "../vgeometry/vgobject.h" #include @@ -153,3 +154,15 @@ void TST_Misc::TestCLocale() QCOMPARE(localized, expected); } + +//--------------------------------------------------------------------------------------------------------------------- +void TST_Misc::TestIssue485() +{ + const qreal radius = 5.6692913385826778; + const QPointF cPoint(407.9527559055118, 39.999874015748034); + const QPointF sPoint(407.9527559055118, 39.999874015748034); + + QPointF p1, p2; + const int res = VGObject::LineIntersectCircle(QPointF(), radius, QLineF(QPointF(), sPoint-cPoint), p1, p2); + QCOMPARE(res, 0); +} diff --git a/src/test/ValentinaTest/tst_misc.h b/src/test/ValentinaTest/tst_misc.h index 14f76cd47..28f8c95e2 100644 --- a/src/test/ValentinaTest/tst_misc.h +++ b/src/test/ValentinaTest/tst_misc.h @@ -47,6 +47,8 @@ private slots: void TestCLocale_data(); void TestCLocale(); + void TestIssue485(); + private: Q_DISABLE_COPY(TST_Misc) };