Skip to content

Commit

Permalink
v0.1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderSchuetz97 committed Oct 12, 2024
1 parent 7532566 commit a78aaad
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "jni-simple"
version = "0.1.9"
version = "0.1.10"
edition = "2021"
license = "MIT OR Apache-2.0"
authors = ["Alexander Schütz <[email protected]>"]
Expand Down
32 changes: 32 additions & 0 deletions tests/jtype_debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,42 @@ pub fn test_float() {
assert!(format_str.contains("float=2.8123e1"), "{}", format_str);
}

#[test]
pub fn test_byte() {
let x = jtype::from(0x75i8);
let format_str = format!("{:?}", x);
println!("{}", format_str);
assert!(format_str.contains("byte=0x75"));
}

#[test]
pub fn test_short() {
let x = jtype::from(0x756i16);
let format_str = format!("{:?}", x);
println!("{}", format_str);
assert!(format_str.contains("short=0x756"));
}

#[test]
pub fn test_int() {
let x = jtype::from(0x756555i32);
let format_str = format!("{:?}", x);
println!("{}", format_str);
assert!(format_str.contains("int=0x756555"));
}

#[test]
pub fn test_long() {
let x = jtype::from(-0x7565554581458458i64);
let format_str = format!("{:?}", x);
println!("{}", format_str);
assert!(format_str.contains("long=0x8a9aaaba7eba7ba8")); //2s complement
}

#[test]
pub fn test_double() {
let x = jtype::from(756555.333221f64);
let format_str = format!("{:?}", x);
println!("{}", format_str);
assert!(format_str.contains("double=7.56555333221e5"));
}

0 comments on commit a78aaad

Please sign in to comment.