Permalink
Browse files

scilab: implement test bools

  • Loading branch information...
1 parent 4aa870c commit 68cb49600d407e6af5a3c74e387d3d02abd84188 @smarchetto smarchetto committed Feb 17, 2014
Showing with 20 additions and 0 deletions.
  1. +20 −0 Examples/test-suite/scilab/bools_runme.sci
@@ -0,0 +1,20 @@
+exec("swigtest.start", -1);
+
+function checkBool(bool_val, expected_bool_val)
+ if typeof(bool_val) <> "boolean" then swigtesterror(); end
+ if bool_val <> expected_bool_val then swigtesterror(); end
+endfunction
+
+checkBool(constbool_get(), %f);
+
+checkBool(bool1_get(), %t);
+checkBool(bool2_get(), %f);
+
+checkBool(bo(%t), %t);
+checkBool(bo(%f), %f);
+
+bs = new_BoolStructure();
+checkBool(BoolStructure_m_bool1_get(bs), %t);
+checkBool(BoolStructure_m_bool2_get(bs), %f);
+
+exec("swigtest.quit", -1);

0 comments on commit 68cb496

Please sign in to comment.