changeset 20152:8187a66039e4 stable

Don't run Java BIST tests if HAVA_JAVA is false. * ov-java.cc: use 'testif HAVE_JAVA' around BIST tests.
author Rik <rik@octave.org>
date Fri, 01 May 2015 13:37:26 -0700
parents 6446649e42c1
children 3b3579ad7e46
files libinterp/octave-value/ov-java.cc
diffstat 1 files changed, 25 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/octave-value/ov-java.cc	Fri May 01 13:11:51 2015 -0700
+++ b/libinterp/octave-value/ov-java.cc	Fri May 01 13:37:26 2015 -0700
@@ -2136,10 +2136,10 @@
 }
 
 /*
+## The tests below merely check if javaObject() works at all.  Whether it works
+## properly, i.e., creates the right values, is a matter of Java itself.
+## Create a Short and check if it really is a short, i.e., whether it overflows.
 %!testif HAVE_JAVA
-%% The tests below merely check if javaObject works at all. Whether it works
-%% properly, i.e. creates the right values, is a matter of Java itself
-%% Create a Short and check if it really is a short, i.e. whether it overflows
 %! assert (javaObject ("java.lang.Short", 40000).doubleValue < 0);
 */
 
@@ -2214,8 +2214,8 @@
 
 /*
 %!testif HAVE_JAVA
-%% Check for valid first two Java version numbers
-%! jver = strsplit (javaMethod ('getProperty', 'java.lang.System', 'java.version'), '.');
+%! ## Check for valid first two Java version numbers
+%! jver = strsplit (javaMethod ("getProperty", "java.lang.System", "java.version"), ".");
 %! assert (isfinite (str2double (jver{1})) && isfinite (str2double (jver{2})));
 */
 
@@ -2470,21 +2470,24 @@
 }
 
 /*
-## Check automatic conversion of java primitive arrays into octave types
-%!assert (javaObject ("java.lang.String", "hello").getBytes (),
-%!        int8 ([104 101 108 108 111]'))
-
-## Check automatic conversion of octave types into java primitive arrays
-## Note that uint8 are casted into int8
-%!assert (javaMethod ("binarySearch", "java.util.Arrays", [90 100 255], 255), 2)
-%!assert (javaMethod ("binarySearch", "java.util.Arrays", uint8  ([90 100 255]), uint8  (255)) < 0)
-%!assert (javaMethod ("binarySearch", "java.util.Arrays", uint8  ([90 100 128]), uint8  (128)) < 0)
-%!assert (javaMethod ("binarySearch", "java.util.Arrays", uint8  ([90 100 127]), uint8  (127)), 2)
-%!assert (javaMethod ("binarySearch", "java.util.Arrays", uint16 ([90 100 128]), uint16 (128)), 2)
-
-## Check we can create objects that wrap java literals (bug #38821)
-%!assert (class (javaObject ("java.lang.Byte", uint8 (1))), "java.lang.Byte");
-%!assert (class (javaObject ("java.lang.Byte", int8 (1))), "java.lang.Byte");
-%!assert (class (javaObject ("java.lang.Short", uint16 (1))), "java.lang.Short");
-%!assert (class (javaObject ("java.lang.Short", int16 (1))), "java.lang.Short");
+## Check automatic conversion of java primitive arrays into octave types.
+%!testif HAVE_JAVA
+%! assert (javaObject ("java.lang.String", "hello").getBytes (),
+%!         int8 ([104 101 108 108 111]'));
+
+## Check automatic conversion of octave types into java primitive arrays.
+## Note that uint8 is casted to int8.
+%!testif HAVE_JAVA
+%! assert (javaMethod ("binarySearch", "java.util.Arrays", [90 100 255], 255), 2);
+%! assert (javaMethod ("binarySearch", "java.util.Arrays", uint8 ([90 100 255]), uint8 (255)) < 0);
+%! assert (javaMethod ("binarySearch", "java.util.Arrays", uint8 ([90 100 128]), uint8 (128)) < 0);
+%! assert (javaMethod ("binarySearch", "java.util.Arrays", uint8 ([90 100 127]), uint8 (127)), 2);
+%! assert (javaMethod ("binarySearch", "java.util.Arrays", uint16 ([90 100 128]), uint16 (128)), 2);
+
+## Check we can create objects that wrap java literals (bug #38821).
+%!testif HAVE_JAVA
+%! assert (class (javaObject ("java.lang.Byte", uint8 (1))), "java.lang.Byte");
+%! assert (class (javaObject ("java.lang.Byte", int8 (1))), "java.lang.Byte");
+%! assert (class (javaObject ("java.lang.Short", uint16 (1))), "java.lang.Short");
+%! assert (class (javaObject ("java.lang.Short", int16 (1))), "java.lang.Short");
 */