rjb 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ext/rjb.c +5 -2
- data/test/test.rb +4 -1
- metadata +1 -1
data/ext/rjb.c
CHANGED
@@ -12,10 +12,10 @@
|
|
12
12
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
13
|
* Lesser General Public License for more details.
|
14
14
|
*
|
15
|
-
* $Id: rjb.c
|
15
|
+
* $Id: rjb.c 21 2007-09-15 09:32:45Z arton $
|
16
16
|
*/
|
17
17
|
|
18
|
-
#define RJB_VERSION "1.0.
|
18
|
+
#define RJB_VERSION "1.0.8"
|
19
19
|
|
20
20
|
#include "ruby.h"
|
21
21
|
#include "st.h"
|
@@ -538,6 +538,9 @@ static VALUE jv2rv_withprim(JNIEnv* jenv, jobject o)
|
|
538
538
|
case 'c':
|
539
539
|
jv.c = (*jenv)->CallCharMethod(jenv, o, jpcvt[i].to_prim_id);
|
540
540
|
break;
|
541
|
+
case 'l':
|
542
|
+
jv.j = (*jenv)->CallLongMethod(jenv, o, jpcvt[i].to_prim_id);
|
543
|
+
break;
|
541
544
|
default:
|
542
545
|
rb_raise(rb_eRuntimeError, "no convertor defined(%d)", i);
|
543
546
|
break;
|
data/test/test.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#!/usr/local/env ruby
|
2
|
-
# $Id: test.rb
|
2
|
+
# $Id: test.rb 21 2007-09-15 09:32:45Z arton $
|
3
3
|
|
4
4
|
require 'test/unit'
|
5
5
|
require 'rjb'
|
@@ -456,6 +456,9 @@ class TestRjb < Test::Unit::TestCase
|
|
456
456
|
jByte = Rjb::import('java.lang.Byte')
|
457
457
|
assert_equal(5, jByte.valueOf('5'))
|
458
458
|
assert_equal(-6, jByte.valueOf('-6'))
|
459
|
+
jLong = Rjb::import('java.lang.Long')
|
460
|
+
assert_equal(0x7000000000000000, jLong.valueOf('8070450532247928832'))
|
461
|
+
assert_equal(-9223372036854775807, jLong.valueOf('-9223372036854775807'))
|
459
462
|
end
|
460
463
|
end
|
461
464
|
|