Browse Source

Fixed minor error

Martin Edlund 5 years ago
parent
commit
56b75411b8

+ 1 - 1
SketchAssistant/SketchAssistantWPF/GeometryCalculator.cs

@@ -26,7 +26,7 @@ namespace SketchAssistantWPF
             double AvDist = CalculateAverageDistance(l0, l1);
             double DistSim = (50 - AvDist) / 50;
             if (DistSim < 0) DistSim = 0;
-            if (CosSim < 0.5) CosSim = 0;
+            if (CosSim < 0.5 || Double.IsNaN(CosSim)) CosSim = 0;
             double output = (2 * CosSim + LenSim + DistSim) / 4;
             System.Diagnostics.Debug.WriteLine("Results: CosSim: {0}, LenSim: {1}, AvDist {2}, DistSim: {3}. Total: {4}", 
                 CosSim, LenSim, AvDist, DistSim, output);

+ 5 - 5
SketchAssistant/WhiteTests/UITest.cs

@@ -616,7 +616,7 @@ namespace WhiteTests
                 //save the occurence of an exception
                 correctExceptionThrown = true;
             }
-            catch (Exception e)
+            catch (Exception)
             {
                 //don't set success flag
             }
@@ -644,7 +644,7 @@ namespace WhiteTests
                 {
                     uut.ParseSVGInputFile(s, 10000, 10000);
                 }
-                catch (Exception e)
+                catch (Exception)
                 {
                     noExceptionThrown = false;
                 }
@@ -670,11 +670,11 @@ namespace WhiteTests
                 {
                     uut.ParseSVGInputFile(s, 10000, 10000);
                 }
-                catch (FileImporterException e)
+                catch (FileImporterException)
                 {
                     correctExceptionThrown = true;
                 }
-                catch (Exception e)
+                catch (Exception)
                 {
                 }
                 Assert.IsTrue(correctExceptionThrown);
@@ -697,7 +697,7 @@ namespace WhiteTests
         [TestMethod]
         public void StaysWithinParameters()
         {
-            Parallel.For(1,500,
+            Parallel.For(1,2500,
                 i =>
                 {
                     InternalLine l0 = DebugData.GetRandomLine(1, (uint) i);