MCPcopy Create free account
hub / github.com/cpmech/plotpy / draw_plane_nzz_fails_on_wrong_input

Function draw_plane_nzz_fails_on_wrong_input

src/surface_geometry.rs:457–471  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 1

draw_plane_nzzMethod · 0.80

Tested by

no test coverage detected