summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Messick <ericm@nanorex.com>2008-09-23 20:02:11 +0000
committerEric Messick <ericm@nanorex.com>2008-09-23 20:02:11 +0000
commit367b5a2f476235a7d81968bcb29dd043fdb0ac3a (patch)
tree5dd569e27bd459b294e5ec7ba7373164c9c64ea5
parent209e9ef0dbab68dc36412cc2f97c82889b0100fd (diff)
downloadnanoengineer-theirix-367b5a2f476235a7d81968bcb29dd043fdb0ac3a.tar.gz
nanoengineer-theirix-367b5a2f476235a7d81968bcb29dd043fdb0ac3a.zip
never run __cmp__ in samevals
-rwxr-xr-xcad/src/geometry/VQT.py5
-rwxr-xr-xcad/src/samevalshelp.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/cad/src/geometry/VQT.py b/cad/src/geometry/VQT.py
index 2d38532ab..d0403af13 100755
--- a/cad/src/geometry/VQT.py
+++ b/cad/src/geometry/VQT.py
@@ -684,6 +684,11 @@ if __name__ == '__main__':
assert not (q1 == q2), "different quats equal!" # this bug was fixed on 070227
assert q1 != V(0, 0, 0) # this did print_compact_traceback after that was fixed; now that's fixed too
# can't work yet: assert q2 * 2 == 2 * q2
+
+ # this means you have to run this from cad/src as ./ExecSubDir.py geometry/VQT.py
+ from utilities.Comparison import same_vals
+ q3 = Q(1, 0, 0, 0)
+ assert same_vals( q1, q3 ), "BUG: not same_vals( Q(1,0,0,0), Q(1,0,0,0) )"
print "tests done"
# end
diff --git a/cad/src/samevalshelp.c b/cad/src/samevalshelp.c
index 6c2e24a85..4bae33d19 100755
--- a/cad/src/samevalshelp.c
+++ b/cad/src/samevalshelp.c
@@ -175,7 +175,6 @@ _same_vals_helper(PyObject *v1, PyObject *v2)
printf(" (rich comparison)");
printf("\n");
});
-#endif
if (typ1->tp_compare != NULL) {
int i;
@@ -185,6 +184,7 @@ _same_vals_helper(PyObject *v1, PyObject *v2)
return i != 0;
}
}
+#endif
if (PyObject_RichCompareBool(v1, v2, Py_EQ) == 1)
return 0;
return 1;