@@ -74,11 +74,11 @@ mod tests {
74
74
75
75
#[ test]
76
76
fn test_custom_signal_handler_single_instance ( ) {
77
- let engine = HostRef :: new ( Engine :: new ( & Config :: default ( ) ) ) ;
78
- let store = HostRef :: new ( Store :: new ( & engine) ) ;
77
+ let engine = Engine :: new ( & Config :: default ( ) ) ;
78
+ let store = Store :: new ( & engine) ;
79
79
let data =
80
80
std:: fs:: read ( "tests/custom_signal_handler.wasm" ) . expect ( "failed to read wasm file" ) ;
81
- let module = HostRef :: new ( Module :: new ( & store, & data) . expect ( "failed to create module" ) ) ;
81
+ let module = Module :: new ( & store, & data) . expect ( "failed to create module" ) ;
82
82
let instance = HostRef :: new (
83
83
Instance :: new ( & store, & module, & [ ] ) . expect ( "failed to instantiate module" ) ,
84
84
) ;
@@ -104,7 +104,7 @@ mod tests {
104
104
println ! ( "calling read_out_of_bounds..." ) ;
105
105
let trap = invoke_export ( & instance, & data, "read_out_of_bounds" ) . unwrap_err ( ) ;
106
106
assert ! ( trap. root_cause( ) . to_string( ) . starts_with(
107
- "trapped: Ref( Trap { message: \" wasm trap: out of bounds memory access"
107
+ "trapped: Trap { message: \" call error: wasm trap: out of bounds memory access"
108
108
) ) ;
109
109
}
110
110
@@ -128,19 +128,18 @@ mod tests {
128
128
println ! ( "calling read_out_of_bounds..." ) ;
129
129
let trap = read_out_of_bounds_func. borrow ( ) . call ( & [ ] ) . unwrap_err ( ) ;
130
130
assert ! ( trap
131
- . borrow( )
132
131
. message( )
133
- . starts_with( "wasm trap: out of bounds memory access" ) ) ;
132
+ . starts_with( "call error: wasm trap: out of bounds memory access" ) ) ;
134
133
}
135
134
}
136
135
137
136
#[ test]
138
137
fn test_custom_signal_handler_multiple_instances ( ) {
139
- let engine = HostRef :: new ( Engine :: new ( & Config :: default ( ) ) ) ;
140
- let store = HostRef :: new ( Store :: new ( & engine) ) ;
138
+ let engine = Engine :: new ( & Config :: default ( ) ) ;
139
+ let store = Store :: new ( & engine) ;
141
140
let data =
142
141
std:: fs:: read ( "tests/custom_signal_handler.wasm" ) . expect ( "failed to read wasm file" ) ;
143
- let module = HostRef :: new ( Module :: new ( & store, & data) . expect ( "failed to create module" ) ) ;
142
+ let module = Module :: new ( & store, & data) . expect ( "failed to create module" ) ;
144
143
145
144
// Set up multiple instances
146
145
@@ -237,13 +236,13 @@ mod tests {
237
236
238
237
#[ test]
239
238
fn test_custom_signal_handler_instance_calling_another_instance ( ) {
240
- let engine = HostRef :: new ( Engine :: new ( & Config :: default ( ) ) ) ;
241
- let store = HostRef :: new ( Store :: new ( & engine) ) ;
239
+ let engine = Engine :: new ( & Config :: default ( ) ) ;
240
+ let store = Store :: new ( & engine) ;
242
241
243
242
// instance1 which defines 'read'
244
243
let data1 =
245
244
std:: fs:: read ( "tests/custom_signal_handler.wasm" ) . expect ( "failed to read wasm file" ) ;
246
- let module1 = HostRef :: new ( Module :: new ( & store, & data1) . expect ( "failed to create module" ) ) ;
245
+ let module1 = Module :: new ( & store, & data1) . expect ( "failed to create module" ) ;
247
246
let instance1: HostRef < Instance > = HostRef :: new (
248
247
Instance :: new ( & store, & module1, & [ ] ) . expect ( "failed to instantiate module" ) ,
249
248
) ;
@@ -262,7 +261,7 @@ mod tests {
262
261
// instance2 wich calls 'instance1.read'
263
262
let data2 =
264
263
std:: fs:: read ( "tests/custom_signal_handler_2.wasm" ) . expect ( "failed to read wasm file" ) ;
265
- let module2 = HostRef :: new ( Module :: new ( & store, & data2) . expect ( "failed to create module" ) ) ;
264
+ let module2 = Module :: new ( & store, & data2) . expect ( "failed to create module" ) ;
266
265
let instance2 = HostRef :: new (
267
266
Instance :: new ( & store, & module2, & [ instance1_read] )
268
267
. expect ( "failed to instantiate module" ) ,
0 commit comments