fix assert_checkequal
[scilab.git] / scilab / modules / development_tools / macros / assert / assert_checkequal.sci
index 61a139f..444980c 100644 (file)
@@ -48,14 +48,13 @@ function [flag,errmsg] = assert_checkequal ( computed , expected )
         errmsg = sprintf ( gettext ( "%s: Wrong number of input arguments: %d expected.\n") , "assert_checkequal" , 2 )
         error(errmsg)
     end
-    //
+
     // Check types of variables
     if ( typeof(computed) <> typeof(expected) ) then
         errmsg = sprintf ( gettext ( "%s: Incompatible input arguments #%d and #%d: Same types expected.\n" ) , "assert_checkequal" , 1 , 2 )
         error(errmsg)
-    end
+   end
 
-    //
     // Check hypermat type
     if (typeof(computed) == "hypermat") then
         // Check on first element type
@@ -113,19 +112,21 @@ function [flag,errmsg] = assert_checkequal ( computed , expected )
             flag = %f
         end
     end
+
     if ( flag == %t ) then
+
         errmsg = ""
     else
         // Change the message if the matrix contains more than one value
         if ( size(expected,"*") == 1 ) then
-            if ( typeof(expected) == "sparse") then
+            if ( or(typeof(expected) == ["sparse", "boolean sparse"])) then
                 val = full(expected)
             else
                 val = expected
             end
             estr = string(val)
         else
-            if ( typeof(expected) == "sparse") then
+            if ( or(typeof(expected) == ["sparse", "boolean sparse"])) then
                 val = full(expected(1))
             else
                 val = expected(1)
@@ -133,14 +134,14 @@ function [flag,errmsg] = assert_checkequal ( computed , expected )
             estr = "[" + string(val) + " ...]"
         end
         if ( size(computed,"*") == 1 ) then
-            if ( typeof(computed) == "sparse") then
+            if ( or(typeof(computed) == ["sparse", "boolean sparse"])) then
                 val = full(computed)
             else
                 val = computed
             end
             cstr = string(val)
         else
-            if ( typeof(computed) == "sparse") then
+            if ( or(typeof(computed) == ["sparse", "boolean sparse"])) then
                 val = full(computed(1))
             else
                 val = computed(1)