Skip to content

Commit ee4c267

Browse files
committed
feat: implement Reflection.getCallerClass()
1 parent e2aaeda commit ee4c267

File tree

11 files changed

+120
-82
lines changed

11 files changed

+120
-82
lines changed

ristretto_vm/src/instruction/byte.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ mod test {
5454
use ristretto_classloader::ConcurrentVec;
5555

5656
#[test]
57-
fn test_baload() -> crate::Result<()> {
57+
fn test_baload() -> Result<()> {
5858
let stack = &mut OperandStack::with_max_size(2);
5959
let array = Reference::ByteArray(ConcurrentVec::from(vec![42]));
6060
stack.push_object(Some(array))?;
@@ -66,7 +66,7 @@ mod test {
6666
}
6767

6868
#[test]
69-
fn test_baload_invalid_value() -> crate::Result<()> {
69+
fn test_baload_invalid_value() -> Result<()> {
7070
let stack = &mut OperandStack::with_max_size(2);
7171
let object = Reference::IntArray(ConcurrentVec::from(vec![42]));
7272
stack.push_object(Some(object))?;
@@ -83,7 +83,7 @@ mod test {
8383
}
8484

8585
#[test]
86-
fn test_baload_invalid_index() -> crate::Result<()> {
86+
fn test_baload_invalid_index() -> Result<()> {
8787
let stack = &mut OperandStack::with_max_size(2);
8888
let array = Reference::ByteArray(ConcurrentVec::from(vec![42]));
8989
stack.push_object(Some(array))?;
@@ -94,7 +94,7 @@ mod test {
9494
}
9595

9696
#[test]
97-
fn test_baload_null_pointer() -> crate::Result<()> {
97+
fn test_baload_null_pointer() -> Result<()> {
9898
let stack = &mut OperandStack::with_max_size(2);
9999
stack.push_object(None)?;
100100
stack.push_int(0)?;
@@ -104,7 +104,7 @@ mod test {
104104
}
105105

106106
#[test]
107-
fn test_bastore() -> crate::Result<()> {
107+
fn test_bastore() -> Result<()> {
108108
let stack = &mut OperandStack::with_max_size(3);
109109
let array = Reference::ByteArray(ConcurrentVec::from(vec![3]));
110110
stack.push_object(Some(array))?;
@@ -116,7 +116,7 @@ mod test {
116116
}
117117

118118
#[test]
119-
fn test_bastore_invalid_value() -> crate::Result<()> {
119+
fn test_bastore_invalid_value() -> Result<()> {
120120
let stack = &mut OperandStack::with_max_size(3);
121121
let object = Reference::IntArray(ConcurrentVec::from(vec![42]));
122122
stack.push_object(Some(object))?;
@@ -134,7 +134,7 @@ mod test {
134134
}
135135

136136
#[test]
137-
fn test_bastore_invalid_index() -> crate::Result<()> {
137+
fn test_bastore_invalid_index() -> Result<()> {
138138
let stack = &mut OperandStack::with_max_size(3);
139139
let array = Reference::ByteArray(ConcurrentVec::from(vec![3]));
140140
stack.push_object(Some(array))?;
@@ -146,7 +146,7 @@ mod test {
146146
}
147147

148148
#[test]
149-
fn test_bastore_null_pointer() -> crate::Result<()> {
149+
fn test_bastore_null_pointer() -> Result<()> {
150150
let stack = &mut OperandStack::with_max_size(3);
151151
stack.push_object(None)?;
152152
stack.push_int(0)?;

ristretto_vm/src/instruction/char.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ mod test {
5454
use ristretto_classloader::ConcurrentVec;
5555

5656
#[test]
57-
fn test_caload() -> crate::Result<()> {
57+
fn test_caload() -> Result<()> {
5858
let stack = &mut OperandStack::with_max_size(2);
5959
let array = Reference::CharArray(ConcurrentVec::from(vec![42]));
6060
stack.push_object(Some(array))?;
@@ -66,7 +66,7 @@ mod test {
6666
}
6767

6868
#[test]
69-
fn test_caload_invalid_value() -> crate::Result<()> {
69+
fn test_caload_invalid_value() -> Result<()> {
7070
let stack = &mut OperandStack::with_max_size(2);
7171
let object = Reference::IntArray(ConcurrentVec::from(vec![42]));
7272
stack.push_object(Some(object))?;
@@ -83,7 +83,7 @@ mod test {
8383
}
8484

8585
#[test]
86-
fn test_caload_invalid_index() -> crate::Result<()> {
86+
fn test_caload_invalid_index() -> Result<()> {
8787
let stack = &mut OperandStack::with_max_size(2);
8888
let array = Reference::CharArray(ConcurrentVec::from(vec![42]));
8989
stack.push_object(Some(array))?;
@@ -94,7 +94,7 @@ mod test {
9494
}
9595

9696
#[test]
97-
fn test_caload_null_pointer() -> crate::Result<()> {
97+
fn test_caload_null_pointer() -> Result<()> {
9898
let stack = &mut OperandStack::with_max_size(2);
9999
stack.push_object(None)?;
100100
stack.push_int(0)?;
@@ -104,7 +104,7 @@ mod test {
104104
}
105105

106106
#[test]
107-
fn test_castore() -> crate::Result<()> {
107+
fn test_castore() -> Result<()> {
108108
let stack = &mut OperandStack::with_max_size(3);
109109
let array = Reference::CharArray(ConcurrentVec::from(vec![3]));
110110
stack.push_object(Some(array))?;
@@ -116,7 +116,7 @@ mod test {
116116
}
117117

118118
#[test]
119-
fn test_castore_invalid_value() -> crate::Result<()> {
119+
fn test_castore_invalid_value() -> Result<()> {
120120
let stack = &mut OperandStack::with_max_size(3);
121121
let object = Reference::IntArray(ConcurrentVec::from(vec![42]));
122122
stack.push_object(Some(object))?;
@@ -134,7 +134,7 @@ mod test {
134134
}
135135

136136
#[test]
137-
fn test_castore_invalid_index() -> crate::Result<()> {
137+
fn test_castore_invalid_index() -> Result<()> {
138138
let stack = &mut OperandStack::with_max_size(3);
139139
let array = Reference::CharArray(ConcurrentVec::from(vec![3]));
140140
stack.push_object(Some(array))?;
@@ -146,7 +146,7 @@ mod test {
146146
}
147147

148148
#[test]
149-
fn test_castore_null_pointer() -> crate::Result<()> {
149+
fn test_castore_null_pointer() -> Result<()> {
150150
let stack = &mut OperandStack::with_max_size(3);
151151
stack.push_object(None)?;
152152
stack.push_int(0)?;

0 commit comments

Comments
 (0)