Mercurial > octave-nkf
changeset 15835:609863321972
maint: merge away extra head on default branch
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 21 Dec 2012 16:17:13 -0500 |
parents | 93516992ee34 (diff) f366e9948259 (current diff) |
children | 48a75e6884ec |
files | |
diffstat | 2 files changed, 18 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/octave-value/ov-java.cc Fri Dec 21 16:11:33 2012 -0500 +++ b/libinterp/octave-value/ov-java.cc Fri Dec 21 16:17:13 2012 -0500 @@ -1978,6 +1978,14 @@ #endif } +/* +%!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); +*/ + DEFUN (javaMethod, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{ret} =} javaMethod (@var{methodname}, @var{obj})\n\ @@ -2046,6 +2054,13 @@ #endif } +/* +%!testif HAVE_JAVA +%% 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}))); +*/ + DEFUN (__java_get__, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} __java_get__ (@var{obj}, @var{name})\n\
--- a/scripts/java/javamem.m Fri Dec 21 16:11:33 2012 -0500 +++ b/scripts/java/javamem.m Fri Dec 21 16:17:13 2012 -0500 @@ -70,9 +70,9 @@ rt = javaMethod ("getRuntime", "java.lang.Runtime"); rt.gc; jvmem = cell (3, 1); - jvmem{1} = rt.maxMemory ().doubleValue (); - jvmem{2} = rt.totalMemory ().doubleValue (); - jvmem{3} = rt.freeMemory ().doubleValue (); + jvmem{1} = rt.maxMemory (); + jvmem{2} = rt.totalMemory (); + jvmem{3} = rt.freeMemory (); if (nargout == 0) printf ("\nJava virtual machine (JVM) memory info:\n");