Commit f0ba28fe authored by Graham, Aaron's avatar Graham, Aaron
Browse files

Add test for averageVertexDistance

parent 5abb6cc6
Pipeline #156453 passed with stage
in 2 minutes and 7 seconds
......@@ -50,6 +50,7 @@ REGISTER_SUBTEST('%subtractSubVolume',testSubtractSubVol)
REGISTER_SUBTEST('Operator(==)',testEquivalence)
REGISTER_SUBTEST('Assignment(=)',testAssignment)
REGISTER_SUBTEST('RotateClockwise',testRotateClockwise)
REGISTER_SUBTEST('averageVertexDistance',testAverageVertexDistance)
FINALIZE_TEST()
!
......@@ -3079,4 +3080,24 @@ SUBROUTINE testRotateClockwise()
ENDSUBROUTINE testRotateClockwise
!
!-------------------------------------------------------------------------------
SUBROUTINE testAverageVertexDistance()
TYPE(PointType) :: testPoint
TYPE(PolygonType) :: testPoly
COMPONENT_TEST('Default Origin')
testPoly%nVert=4
ALLOCATE(testPoly%vert(4))
CALL testPoly%vert(1)%init(DIM=2,COORD=[SQRT(0.5_SRK),SQRT(0.5_SRK)])
CALL testPoly%vert(2)%init(DIM=2,COORD=2.0_SRK*[SQRT(0.5_SRK),SQRT(0.5_SRK)])
CALL testPoly%vert(3)%init(DIM=2,COORD=3.0_SRK*[SQRT(0.5_SRK),SQRT(0.5_SRK)])
CALL testPoly%vert(4)%init(DIM=2,COORD=4.0_SRK*[SQRT(0.5_SRK),SQRT(0.5_SRK)])
ASSERT_APPROXEQA(testPoly%averageVertexDistance(),2.5_SRK,'distance')
COMPONENT_TEST('Provided Origin')
CALL testPoint%init(DIM=2,COORD=[SQRT(2.0_SRK),SQRT(2.0_SRK)])
ASSERT_APPROXEQA(testPoly%averageVertexDistance(testPoint),1.0_SRK,'distance')
ENDSUBROUTINE testAverageVertexDistance
!
ENDPROGRAM testGeom_Poly
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment