changeset 3259:6f9398eb902d

unit test Toolbox.SubstituteVariables
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 18 Feb 2019 20:42:21 +0100
parents 6f652c7bfc85
children 345f86fd1ac3 c3a19284ae19
files Core/Images/ImageProcessing.cpp UnitTestsSources/UnitTestsMain.cpp
diffstat 2 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Core/Images/ImageProcessing.cpp	Mon Feb 18 18:43:40 2019 +0100
+++ b/Core/Images/ImageProcessing.cpp	Mon Feb 18 20:42:21 2019 +0100
@@ -1422,7 +1422,7 @@
       nodes = 0;
       j = static_cast<int>(cpSize) - 1;
 
-      for (i = 0; i < cpSize; i++)
+      for (i = 0; i < static_cast<int>(cpSize); i++)
       {
         if ((cpy[i] < y && cpy[j] >=  y) || (cpy[j] < y && cpy[i] >= y))
         {
--- a/UnitTestsSources/UnitTestsMain.cpp	Mon Feb 18 18:43:40 2019 +0100
+++ b/UnitTestsSources/UnitTestsMain.cpp	Mon Feb 18 20:42:21 2019 +0100
@@ -1235,9 +1235,11 @@
 
   // The "PATH" environment variable should always be available on
   // machines running the unit tests
-  ASSERT_TRUE(env.find("PATH") != env.end());
+  ASSERT_TRUE(env.find("PATH") != env.end() /* Case used by UNIX */ ||
+              env.find("Path") != env.end() /* Case used by Windows */);
 
-  ASSERT_EQ("A" + env["PATH"] + "B",
+  env["PATH"] = "hello";
+  ASSERT_EQ("AhelloB",
             Toolbox::SubstituteVariables("A${PATH}B", env));
 }