[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #54338] New org.octave.BoxingTester Java class
From: |
Andrew Janke |
Subject: |
[Octave-bug-tracker] [bug #54338] New org.octave.BoxingTester Java class to help testing |
Date: |
Thu, 19 Jul 2018 04:18:53 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36 |
URL:
<http://savannah.gnu.org/bugs/?54338>
Summary: New org.octave.BoxingTester Java class to help
testing
Project: GNU Octave
Submitted by: apjanke
Submitted on: Thu 19 Jul 2018 08:18:52 AM UTC
Category: Libraries
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Other
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: dev
Operating System: Any
_______________________________________________________
Details:
There are a few outstanding bugs related to Octave/Java value boxing
behavior.
* https://savannah.gnu.org/bugs/index.php?54170
* https://savannah.gnu.org/bugs/index.php?53524
* https://savannah.gnu.org/bugs/index.php?51822
* https://savannah.gnu.org/bugs/index.php?51804
* https://savannah.gnu.org/bugs/index.php?48820
* https://savannah.gnu.org/bugs/index.php?48817
* https://savannah.gnu.org/bugs/index.php?42701
* and so on
Many of these are having to provide their own example Java code, which you
need to download and compile if you want to reproduce their use case.
It might be useful to have a canonical Java value-boxing test that provides a
bunch of example method signatures to run tests against, so you can have a
shared agreed-upon test context, and not have to bother compiling custom Java
code to reproduce test cases.
I've attached a changeset which defines a new org.octave.BoxingTester class
that provides several permutations of Java method signatures that you can use
to exercise the Octave/Java value boxing behavior.
Example:
octave:1> tst = javaObject ("org.octave.BoxingTester")
tst =
<Java object: org.octave.BoxingTester>
octave:2> tst.foo(42)
foo(double): (42.0)
ans = [](0x0)
octave:3> tst.foo ([42, 43])
foo(double[]): (address@hidden)
ans = [](0x0)
octave:4> tst.foo("Hello, world!")
foo(String): (Hello, world!)
ans = [](0x0)
octave:5> tst.getStringAsString
ans = Hello, world!
octave:6> class(ans)
ans = char
octave:7> tst.getStringAsObject
ans = Hello, world!
octave:8> class(ans)
ans = char
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Thu 19 Jul 2018 08:18:52 AM UTC Name: java-BoxingTester.patch Size:
11KiB By: apjanke
<http://savannah.gnu.org/bugs/download.php?file_id=44591>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?54338>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #54338] New org.octave.BoxingTester Java class to help testing,
Andrew Janke <=