()
| 241 | |
| 242 | #[test] |
| 243 | fn test_table_init() { |
| 244 | let kind = dummy_table_type(); |
| 245 | let mut table_instance = TableInstance::new(kind); |
| 246 | |
| 247 | let init_elements = vec![TableElement::Initialized(0); 5]; |
| 248 | let result = table_instance.init(0, &init_elements); |
| 249 | |
| 250 | assert!(result.is_ok(), "Initializing table with elements failed"); |
| 251 | |
| 252 | for i in 0..5 { |
| 253 | let elem = table_instance.get(i); |
| 254 | assert!( |
| 255 | elem.is_ok() && matches!(elem.unwrap(), &TableElement::Initialized(_)), |
| 256 | "Element not initialized correctly at index {i}" |
| 257 | ); |
| 258 | } |
| 259 | } |
| 260 | } |
nothing calls this directly
no test coverage detected