()
| 455 | |
| 456 | #[test] |
| 457 | fn draw_plane_nzz_fails_on_wrong_input() { |
| 458 | let mut surf = Surface::new(); |
| 459 | let res = surf.draw_plane_nzz(&[0.0, 0.0], &[1.0, 1.0], 0.0, 1.0, 0.0, 1.0, 2, 2); |
| 460 | assert_eq!(res.err(), Some("p.len() and n.len() must be equal to 3")); |
| 461 | let res = surf.draw_plane_nzz(&[0.0, 0.0, 0.0], &[1.0, 1.0], 0.0, 1.0, 0.0, 1.0, 2, 2); |
| 462 | assert_eq!(res.err(), Some("p.len() and n.len() must be equal to 3")); |
| 463 | |
| 464 | let res = surf.draw_plane_nzz(&[0.0, 0.0, 0.0], &[1.0, 1.0, 0.0], 0.0, 1.0, 0.0, 1.0, 2, 2); |
| 465 | assert_eq!(res.err(), Some("the z-component of the normal vector cannot be zero")); |
| 466 | |
| 467 | let res = surf.draw_plane_nzz(&[0.0, 0.0, 0.0], &[1.0, 1.0, 1.0], 0.0, 1.0, 0.0, 1.0, 1, 2); |
| 468 | assert_eq!(res.err(), Some("nx and ny must be ≥ 2")); |
| 469 | let res = surf.draw_plane_nzz(&[0.0, 0.0, 0.0], &[1.0, 1.0, 1.0], 0.0, 1.0, 0.0, 1.0, 2, 1); |
| 470 | assert_eq!(res.err(), Some("nx and ny must be ≥ 2")); |
| 471 | } |
| 472 | |
| 473 | #[test] |
| 474 | fn draw_plane_nzz_works() { |
nothing calls this directly
no test coverage detected