mirror of https://codeberg.org/topola/topola.git
tests: update reference value in THT diode bridge rectifier test
This commit is contained in:
parent
817fd5e57f
commit
31bc9a9447
|
|
@ -145,12 +145,18 @@ pub fn assert_band_length(
|
|||
board: &Board<impl AccessMesadata>,
|
||||
source: &str,
|
||||
target: &str,
|
||||
length: f64,
|
||||
epsilon: f64,
|
||||
expected_length: f64,
|
||||
rel_err: f64,
|
||||
) {
|
||||
let band = board.band_between_pins(source, target).unwrap();
|
||||
let band_length = band.0.ref_(board.layout().drawing()).length();
|
||||
assert!((band_length - length).abs() < epsilon);
|
||||
assert!(
|
||||
(band_length - expected_length).abs() < expected_length * rel_err,
|
||||
"band_length = {}, expected_length = {}, epsilon = {}",
|
||||
band_length,
|
||||
expected_length,
|
||||
rel_err
|
||||
);
|
||||
}
|
||||
|
||||
fn unionfind(autorouter: &mut Autorouter<impl AccessMesadata>) -> UnionFind<NodeIndex<usize>> {
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ fn test_tht_diode_bridge_rectifier() {
|
|||
|
||||
common::assert_single_layer_groundless_autoroute(&mut autorouter, "F.Cu");
|
||||
//common::assert_number_of_conncomps(&mut autorouter, 4);
|
||||
common::assert_band_length(autorouter.board(), "J2-2", "D4-2", 15500.0, 0.5);
|
||||
common::assert_band_length(autorouter.board(), "J2-2", "D4-2", 15900.0, 0.01);
|
||||
|
||||
let mut invoker = Invoker::new(autorouter);
|
||||
let result = invoker.execute(Command::PlaceVia(ViaWeight {
|
||||
|
|
|
|||
Loading…
Reference in New Issue