Commit 394ecbb6 authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

Add failing unit test.

parent 4359f817
SET(${PROJECT_NAME}_PYTHON_TESTS SET(${PROJECT_NAME}_PYTHON_TESTS
geometric_shapes geometric_shapes
api
) )
FOREACH(TEST ${${PROJECT_NAME}_PYTHON_TESTS}) FOREACH(TEST ${${PROJECT_NAME}_PYTHON_TESTS})
......
import unittest
from test_case import TestCase
import hppfcl
hppfcl.switchToNumpyArray()
import numpy as np
class TestMainAPI(TestCase):
def test_collision(self):
capsule = hppfcl.Capsule(1.,2.)
M1 = hppfcl.Transform3f()
M2 = hppfcl.Transform3f(np.eye(3),np.array([3, 0, 0]))
req=hppfcl.CollisionRequest()
res=hppfcl.CollisionResult()
self.assertTrue(not hppfcl.collide(capsule, M1, capsule, M2, req, res))
def test_distance(self):
capsule = hppfcl.Capsule(1.,2.)
M1 = hppfcl.Transform3f()
M2 = hppfcl.Transform3f(np.eye(3),np.array([3, 0, 0]))
req=hppfcl.DistanceRequest()
res=hppfcl.DistanceResult()
self.assertTrue(hppfcl.distance(capsule, M1, capsule, M2, req, res) > 0)
if __name__ == '__main__':
unittest.main()
Supports Markdown
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