Skip to content
Permalink
Browse files

try to fix test for travis

  • Loading branch information
lbartoletti authored and nyalldawson committed Jun 6, 2018
1 parent 8edfaa7 commit 2205ea644e45c0844373f157d6b46d7eb0336f85
Showing with 5 additions and 5 deletions.
  1. +5 −5 tests/src/core/testqgscadutils.cpp
@@ -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
@@ -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 ) );
}

@@ -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

0 comments on commit 2205ea6

Please sign in to comment.
You can’t perform that action at this time.