Skip to content

Commit

Permalink
augh fix incorrect test
Browse files Browse the repository at this point in the history
  • Loading branch information
alecjacobson committed Feb 6, 2023
1 parent 1dd2312 commit 34f8205
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import platform

import igl
import igl.copyleft.cgal
import numpy as np
import scipy as sp
import scipy.sparse as csc
Expand Down Expand Up @@ -490,7 +491,7 @@ def test_read_dmat(self):
# sparse matrix, no flag attribute
def test_vector_area_matrix(self):
a = igl.vector_area_matrix(self.f)
self.assertEqual(a.dtype, self.f.dtype)
self.assertEqual(a.dtype, "float64")
self.assertEqual(a.shape[0], a.shape[1])
self.assertEqual(a.shape[0], self.v.shape[0]*2)

Expand Down Expand Up @@ -2463,8 +2464,16 @@ def test_flip_edge(self):
emap.dtype == self.f1.dtype)
self.assertTrue(np.array(ue2e).dtype == self.f1.dtype)

# copyleft.cgal
def test_convex_hull(self):
V = np.array([[0,0,0],[1,0,0],[0,1,0],[0,0,1]],dtype="float64")
F = igl.copyleft.cgal.convex_hull(V)
F = np.sort(F)
F = F[np.lexsort(F.T[::-1],axis=0)]
F_gt = np.array([[0, 1, 2], [0, 1, 3], [0, 2, 3], [1, 2, 3]],dtype="int64")
self.assertTrue((F == F_gt).all())

if __name__ == '__main__':
if len(sys.argv) > 1:
TestBasic.test_data_path = os.path.join(sys.argv.pop(),'')
if 'TEST_DATA_PATH' in os.environ:
TestBasic.test_data_path = os.path.join(os.environ['TEST_DATA_PATH'],'')
unittest.main()

0 comments on commit 34f8205

Please sign in to comment.