GCC warnings. Fixed broken tests.
--HG-- branch : develop
This commit is contained in:
parent
33b6256896
commit
018fd88f25
|
@ -198,12 +198,12 @@ QPointF VEllipticalArc::GetPoint (qreal angle) const
|
|||
{
|
||||
y = -y;
|
||||
}
|
||||
else if (angle == 90)
|
||||
else if (qFuzzyCompare(angle, 90))
|
||||
{
|
||||
x = 0;
|
||||
y = d->radius2;
|
||||
}
|
||||
else if (angle == 270)
|
||||
else if (qFuzzyCompare(angle, 270))
|
||||
{
|
||||
x = 0;
|
||||
y = -d->radius2;
|
||||
|
|
|
@ -5,6 +5,11 @@
|
|||
#include "../vmisc/vabstractapplication.h"
|
||||
#include "vpointf.h"
|
||||
|
||||
#ifdef Q_CC_GNU
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Weffc++"
|
||||
#endif
|
||||
|
||||
class VEllipticalArcData : public QSharedData
|
||||
{
|
||||
public:
|
||||
|
@ -86,5 +91,9 @@ private:
|
|||
VEllipticalArcData::~VEllipticalArcData()
|
||||
{}
|
||||
|
||||
#ifdef Q_CC_GNU
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
#endif // VELLIPTICALARC_P
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "tst_vellipticalarc.h"
|
||||
#include "../vgeometry/vellipticalarc.h"
|
||||
#include "../vlayout/vabstractdetail.h"
|
||||
#include "../vmisc/logging.h"
|
||||
|
||||
#include <QtTest>
|
||||
|
||||
|
@ -232,9 +233,9 @@ void TST_VEllipticalArc::TestGetPoints1()
|
|||
VEllipticalArc arc(center, radius1, radius2, startAngle, endAngle, rotationAngle);
|
||||
|
||||
QVector<QPointF> points = arc.GetPoints();
|
||||
if (rotationAngle == 0.0)
|
||||
if (qFuzzyIsNull(rotationAngle))
|
||||
{ // equation of ellipse will be different when rotation angle isn't 0 so we can't use this test in this case
|
||||
qreal eps = 0.05;
|
||||
const qreal eps = 0.05;
|
||||
|
||||
for (int i=0; i < points.size(); ++i)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user