]> gitweb.michael.orlitzky.com - spline3.git/commitdiff
Add four tests confirming that vertex swaps don't affect coefficients.
authorMichael Orlitzky <michael@orlitzky.com>
Tue, 14 Jun 2011 15:39:37 +0000 (11:39 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Tue, 14 Jun 2011 15:39:37 +0000 (11:39 -0400)
src/Tests/Tetrahedron.hs
test/TestSuite.hs

index 159acd7f95bdb11a4a583c994fcd7a0ed350a2ee..1ec4c8e6a0672e2541d383ae233b1e684b801291 100644 (file)
@@ -366,3 +366,27 @@ prop_z_rotation_doesnt_affect_top t =
       fv1 = rotate (Tetrahedron.fv t) cwz
       expr1 = top $ fv0
       expr2 = top $ fv1
+
+prop_swapping_vertices_doesnt_affect_coefficients1 :: Tetrahedron -> Bool
+prop_swapping_vertices_doesnt_affect_coefficients1 t =
+      c t 0 0 1 2 == c t' 0 0 1 2
+        where
+          t' = t { v0 = (v1 t), v1 = (v0 t) }
+
+prop_swapping_vertices_doesnt_affect_coefficients2 :: Tetrahedron -> Bool
+prop_swapping_vertices_doesnt_affect_coefficients2 t =
+      c t 0 1 1 1 == c t' 0 1 1 1
+        where
+          t' = t { v2 = (v3 t), v3 = (v2 t) }
+
+prop_swapping_vertices_doesnt_affect_coefficients3 :: Tetrahedron -> Bool
+prop_swapping_vertices_doesnt_affect_coefficients3 t =
+      c t 2 1 0 0 == c t' 2 1 0 0
+        where
+          t' = t { v2 = (v3 t), v3 = (v2 t) }
+
+prop_swapping_vertices_doesnt_affect_coefficients4 :: Tetrahedron -> Bool
+prop_swapping_vertices_doesnt_affect_coefficients4 t =
+      c t 2 0 0 1 == c t' 2 0 0 1
+        where
+          t' = t { v0 = (v3 t), v3 = (v0 t) }
index 2f2cc76d93fd0fdf18a469846ec286944bfd4777..f97df52855bc1bf95bbc7462a1214fb7934b2a5c 100644 (file)
@@ -416,6 +416,18 @@ main = do
   putStr "prop_b3_v2_always_zero... "
   quickCheckWith qc_args prop_b3_v2_always_zero
 
+  putStr "prop_swapping_vertices_doesnt_affect_coefficients1... "
+  quickCheckWith qc_args prop_swapping_vertices_doesnt_affect_coefficients1
+
+  putStr "prop_swapping_vertices_doesnt_affect_coefficients2... "
+  quickCheckWith qc_args prop_swapping_vertices_doesnt_affect_coefficients2
+
+  putStr "prop_swapping_vertices_doesnt_affect_coefficients3... "
+  quickCheckWith qc_args prop_swapping_vertices_doesnt_affect_coefficients3
+
+  putStr "prop_swapping_vertices_doesnt_affect_coefficients4... "
+  quickCheckWith qc_args prop_swapping_vertices_doesnt_affect_coefficients4
+
   putStrLn "\np. 78, (2.4)\n"
 
   putStr "prop_c3000_identity... "
@@ -427,7 +439,6 @@ main = do
   putStr "prop_c1110_identity... "
   quickCheckWith qc_args TT.prop_c1110_identity
 
-
   putStrLn "\nCardinal Tests\n"
 
   putStr "prop_ccwx_rotation_changes_direction... "