diff libinterp/octave-value/ov-class.cc @ 23405:32ec90068be5

use %!testif runtime tests to properly skip java tests * ov-class.cc, ov-java.cc, ov-typeinfo.cc, fieldnames.m, methods.m, javachk.m, usejava.m: Use runtime test in %!testif line to skip if JVM is not available instead of checking inside the test itself. This way the test will be properly reported as skipped instead of passed.
author John W. Eaton <jwe@octave.org>
date Mon, 17 Apr 2017 17:44:56 -0400
parents 778fdffc09df
children c452180ab672
line wrap: on
line diff
--- a/libinterp/octave-value/ov-class.cc	Mon Apr 17 21:28:55 2017 +0200
+++ b/libinterp/octave-value/ov-class.cc	Mon Apr 17 17:44:56 2017 -0400
@@ -1740,10 +1740,7 @@
 %!assert (class (1.1), "double")
 %!assert (class (single (1.1)), "single")
 %!assert (class (uint8 (1)), "uint8")
-%!testif HAVE_JAVA
-%! if (! usejava ("jvm"))
-%!   return;
-%! endif
+%!testif HAVE_JAVA; usejava ("jvm")
 %! jobj = javaObject ("java.lang.StringBuffer");
 %! assert (class (jobj), "java.lang.StringBuffer");
 
@@ -1846,10 +1843,7 @@
 %!assert (isa ({1, 2}, "cell"))
 %!assert (isa ({1, 2}, {"numeric", "integer", "cell"}), [false false true])
 
-%!testif HAVE_JAVA
-%! if (! usejava ("jvm"))
-%!   return;
-%! endif
+%!testif HAVE_JAVA; usejava ("jvm")
 %! ## The first and last assert() are equal on purpose.  The assert() in
 %! ## the middle with an invalid class name will cause the java code to
 %! ## throw exceptions which we then must clear properly (or all other calls