Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
try to fix test for travis
  • Loading branch information
lbartoletti authored and nyalldawson committed Jul 16, 2018
1 parent 8edfaa7 commit 2205ea6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/src/core/testqgscadutils.cpp
Expand Up @@ -207,22 +207,22 @@ void TestQgsCadUtils::testCommonAngle()
// without common angle
QgsCadUtils::AlignMapPointOutput res0 = QgsCadUtils::alignMapPoint( QgsPointXY( 40, 20.1 ), context );
QVERIFY( res0.valid );
QCOMPARE( res0.softLockCommonAngle, -1 );
QCOMPARE( res0.softLockCommonAngle, -1.0 );
QCOMPARE( res0.finalMapPoint, QgsPointXY( 40, 20.1 ) );

// common angle
context.commonAngleConstraint = QgsCadUtils::AlignMapPointConstraint( true, false, 90 );
QgsCadUtils::AlignMapPointOutput res1 = QgsCadUtils::alignMapPoint( QgsPointXY( 40, 20.1 ), context );
QVERIFY( res1.valid );
QCOMPARE( res1.softLockCommonAngle, 0 );
QCOMPARE( res1.softLockCommonAngle, 0.0 );
QCOMPARE( res1.finalMapPoint, QgsPointXY( 40, 20 ) );

// common angle + angle (make sure that angle constraint has priority)
context.commonAngleConstraint = QgsCadUtils::AlignMapPointConstraint( true, false, 90 );
context.angleConstraint = QgsCadUtils::AlignMapPointConstraint( true, false, 45 );
QgsCadUtils::AlignMapPointOutput res2 = QgsCadUtils::alignMapPoint( QgsPointXY( 40, 20.1 ), context );
QVERIFY( res2.valid );
QCOMPARE( res2.softLockCommonAngle, -1 );
QCOMPARE( res2.softLockCommonAngle, -1.0 );
QCOMPARE( res2.finalMapPoint, QgsPointXY( 35.05, 25.05 ) );

// common angle rel
Expand All @@ -231,7 +231,7 @@ void TestQgsCadUtils::testCommonAngle()
context.cadPointList[1] = QgsPointXY( 40, 20 );
QgsCadUtils::AlignMapPointOutput res3 = QgsCadUtils::alignMapPoint( QgsPointXY( 50.1, 29.9 ), context );
QVERIFY( res3.valid );
QCOMPARE( res3.softLockCommonAngle, 90 );
QCOMPARE( res3.softLockCommonAngle, 90.0 );
QCOMPARE( res3.finalMapPoint, QgsPointXY( 50, 30 ) );
}

Expand All @@ -242,7 +242,7 @@ void TestQgsCadUtils::testDistance()
// without distance constraint
QgsCadUtils::AlignMapPointOutput res0 = QgsCadUtils::alignMapPoint( QgsPointXY( 45, 20 ), context );
QVERIFY( res0.valid );
QCOMPARE( res0.softLockCommonAngle, -1 );
QCOMPARE( res0.softLockCommonAngle, -1.0 );
QCOMPARE( res0.finalMapPoint, QgsPointXY( 45, 20 ) );

// dist
Expand Down

0 comments on commit 2205ea6

Please sign in to comment.