mirror of
https://github.com/hannobraun/Fornjot
synced 2025-01-12 03:06:59 +00:00
Expect &Geometry
in ValidationCheck
method
This commit is contained in:
parent
e3c061ac98
commit
97ac5c1f75
@ -87,7 +87,10 @@ mod tests {
|
||||
let mut core = Core::new();
|
||||
|
||||
let valid = Cycle::polygon([[0., 0.], [1., 0.], [1., 1.]], &mut core);
|
||||
AdjacentHalfEdgesNotConnected::check_and_return_first_error(&valid)?;
|
||||
AdjacentHalfEdgesNotConnected::check_and_return_first_error(
|
||||
&valid,
|
||||
&core.layers.geometry,
|
||||
)?;
|
||||
|
||||
let invalid = valid.update_half_edge(
|
||||
valid.half_edges().first(),
|
||||
|
@ -1,5 +1,7 @@
|
||||
use std::fmt::Display;
|
||||
|
||||
use crate::geometry::Geometry;
|
||||
|
||||
use super::ValidationConfig;
|
||||
|
||||
/// Run a specific validation check on an object
|
||||
@ -17,7 +19,10 @@ pub trait ValidationCheck<T>: Sized {
|
||||
///
|
||||
/// This method is designed for convenience over flexibility (it is intended
|
||||
/// for use in unit tests), and thus always uses the default configuration.
|
||||
fn check_and_return_first_error(object: &T) -> Result<(), Self> {
|
||||
fn check_and_return_first_error(
|
||||
object: &T,
|
||||
_: &Geometry,
|
||||
) -> Result<(), Self> {
|
||||
let config = ValidationConfig::default();
|
||||
let mut errors = Self::check(object, &config);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user