# HG changeset patch # User Ben Abbott # Date 1327929752 18000 # Node ID 2633baa831e2d31307b7841729dad3143fb861f2 # Parent b4d7de953066dc312bdfea0bf610e4035261eb75 Fix qhull tests. * convhulln.cc: Matlab uses "Qt" for num dimensions < 5 and "Qt Qx" otherwise. Test modified to verify "Qt" is the default option for nd = 3, and to assert the correct result. diff --git a/src/DLD-FUNCTIONS/convhulln.cc b/src/DLD-FUNCTIONS/convhulln.cc --- a/src/DLD-FUNCTIONS/convhulln.cc +++ b/src/DLD-FUNCTIONS/convhulln.cc @@ -268,11 +268,16 @@ /* %!testif HAVE_QHULL %! cube = [0 0 0;1 0 0;1 1 0;0 1 0;0 0 1;1 0 1;1 1 1;0 1 1]; -%! [h, v] = convhulln (cube); -%! assert (size (h), [6 4]); -%! h = sortrows (sort (h, 2), [1:4]); -%! assert (h, [1 2 3 4; 1 2 5 6; 1 4 5 8; 2 3 6 7; 3 4 7 8; 5 6 7 8]); +%! [h, v] = convhulln (cube, "Qt"); +%! assert (size (h), [12 3]); +%! h = sortrows (sort (h, 2), [1:3]); +%! assert (h, [1 2 4; 1 2 6; 1 4 8; 1 5 6; 1 5 8; 2 3 4; 2 3 7; 2 6 7; 3 4 7; 4 7 8; 5 6 7; 5 7 8]); %! assert (v, 1, 10*eps); +%! [h2, v2] = convhulln (cube); % Test defaut option = "Qt" +%! assert (size (h2), size (h)) +%! h2 = sortrows (sort (h2, 2), [1:3]); +%! assert (h2, h); +%! assert (v2, v, 10*eps); %!testif HAVE_QHULL %! cube = [0 0 0;1 0 0;1 1 0;0 1 0;0 0 1;1 0 1;1 1 1;0 1 1];