Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
tool: cargo-tarpaulin
- name: Run coverage
working-directory: iOverlay
run: cargo tarpaulin --out Lcov
run: cargo tarpaulin --features allow_multithreading --out Lcov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
Expand Down
2 changes: 1 addition & 1 deletion iOverlay/src/core/point_location.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ mod tests {

#[test]
fn random_simplified_contours_match_contains_point_in_50_by_50_space() {
for iteration in 0..256_u64 {
for iteration in 0..96_u64 {
let seed = next_test_seed(iteration);
let mut rng = TestRng::new(seed);
let contour_count = rng.range_usize(1, 4);
Expand Down
8 changes: 4 additions & 4 deletions iOverlay/src/mesh/float/outline/offset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,7 @@ mod tests {
#[test]
fn test_random_0() {
let style = OutlineStyle::new(10.0);
for _ in 0..100 {
for _ in 0..16 {
let shapes = random_float(100.0, 100).simplify_shape(FillRule::NonZero);
let base_area = shapes.area();
let outline_shapes = shapes.outline(&style);
Expand All @@ -1153,7 +1153,7 @@ mod tests {
fn test_random_1() {
let join_angle = core::f64::consts::PI / 3.0;
let style = OutlineStyle::new(10.0).line_join(LineJoin::Round(join_angle));
for _ in 0..100 {
for _ in 0..16 {
let shapes = random_float(100.0, 100).simplify_shape(FillRule::NonZero);
let base_area = shapes.area();
let outline_shapes = shapes.outline(&style);
Expand All @@ -1165,7 +1165,7 @@ mod tests {
#[test]
fn test_random_2() {
let style = OutlineStyle::new(-10.0);
for _ in 0..100 {
for _ in 0..16 {
let shapes = random_float(100.0, 100).simplify_shape(FillRule::NonZero);
let base_area = shapes.area();
let outline_shapes = shapes.outline(&style);
Expand All @@ -1178,7 +1178,7 @@ mod tests {
fn test_random_3() {
let join_angle = core::f64::consts::PI / 3.0;
let style = OutlineStyle::new(-10.0).line_join(LineJoin::Round(join_angle));
for _ in 0..100 {
for _ in 0..16 {
let shapes = random_float(100.0, 100).simplify_shape(FillRule::NonZero);
let base_area = shapes.area();
let outline_shapes = shapes.outline(&style);
Expand Down
4 changes: 2 additions & 2 deletions iOverlay/tests/critical_hypotheses_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ fn hypothesis_integer_engines_agree_near_i16_limits() {
state = state.wrapping_mul(6364136223846793005).wrapping_add(1);
((state >> 32) % 32768) as i32 - 16384
};
for case in 0..2000 {
for case in 0..512 {
let subj: Vec<_> = (0..3 + case % 8).map(|_| [next(), next()]).collect();
let clip: Vec<_> = (0..3 + case % 7).map(|_| [next(), next()]).collect();
for rule in [
Expand Down Expand Up @@ -171,7 +171,7 @@ fn hypothesis_predicates_agree_with_boolean_results_on_dense_inputs() {
state = state.wrapping_mul(6364136223846793005).wrapping_add(1);
((state >> 32) % 17) as i32 - 8
};
for case in 0..5000 {
for case in 0..1500 {
let subj: Vec<_> = (0..3 + case % 8).map(|_| IntPoint::new(next(), next())).collect();
let clip: Vec<_> = (0..3 + case % 7).map(|_| IntPoint::new(next(), next())).collect();
for fill_rule in [
Expand Down
35 changes: 17 additions & 18 deletions iOverlay/tests/dynamic_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ mod tests {
let result = graph.extract_shapes(OverlayRule::Union, &mut Default::default());
assert!(!result.is_empty());
}
a += 0.01
a += 0.1
}
r += 0.02
}
Expand Down Expand Up @@ -73,7 +73,7 @@ mod tests {
graph.validate();
let _ = graph.extract_shapes(OverlayRule::Xor, &mut Default::default());
}
a += 0.005
a += 0.05
}
}
}
Expand All @@ -100,7 +100,7 @@ mod tests {
graph.validate();
let _ = graph.extract_shapes(OverlayRule::Xor, &mut Default::default());
}
a += 0.005
a += 0.05
}
}
}
Expand All @@ -127,7 +127,7 @@ mod tests {
graph.validate();
let _ = graph.extract_shapes(OverlayRule::Xor, &mut Default::default());
}
a += 0.005
a += 0.05
}
}
}
Expand Down Expand Up @@ -257,7 +257,7 @@ mod tests {
assert!(!result.is_empty());
}
}
r += 0.001;
r += 0.005;
}
}
}
Expand Down Expand Up @@ -288,7 +288,7 @@ mod tests {
let result = graph.extract_shapes(OverlayRule::Union, &mut Default::default());
assert!(!result.is_empty());
}
a += 0.005
a += 0.05
}
r += 0.01 * s
}
Expand Down Expand Up @@ -329,20 +329,19 @@ mod tests {
fn test_11_as<I: TestInt>() {
let n = 6;
let scale = scale_for::<I>(100.0);
// random_polygon is deterministic; one case per solver and integer type is enough.
let subj_path = random_polygon::<I>(100.0, 0.0, n, scale);
let clip_path = random_polygon::<I>(100.0, 0.5 * PI, n, scale);
for &solver in SOLVERS.iter() {
for _ in 0..2000 {
let subj_path = random_polygon::<I>(100.0, 0.0, n, scale);
let clip_path = random_polygon::<I>(100.0, 0.5 * PI, n, scale);
let mut overlay = Overlay::new_custom(2 * n, Default::default(), solver);
let mut overlay = Overlay::new_custom(2 * n, Default::default(), solver);

overlay.add_contour(&subj_path, ShapeType::Subject);
overlay.add_contour(&clip_path, ShapeType::Clip);
overlay.add_contour(&subj_path, ShapeType::Subject);
overlay.add_contour(&clip_path, ShapeType::Clip);

if let Some(graph) = overlay.build_graph_view(FillRule::NonZero) {
graph.validate();
let result = graph.extract_shapes(OverlayRule::Union, &mut Default::default());
assert!(!result.is_empty());
}
if let Some(graph) = overlay.build_graph_view(FillRule::NonZero) {
graph.validate();
let result = graph.extract_shapes(OverlayRule::Union, &mut Default::default());
assert!(!result.is_empty());
}
}
}
Expand Down Expand Up @@ -403,7 +402,7 @@ mod tests {
let paths_count = 3;
let mut subj_paths = Vec::with_capacity(paths_count);

for _ in 0..100_000 {
for _ in 0..10_000 {
subj_paths.clear();
let x_range = 0..=8;
let y_range = -8..=8;
Expand Down
2 changes: 1 addition & 1 deletion iOverlay/tests/ocg_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ mod tests {

#[test]
fn test_random_self_intersections() {
for seed in 0..128 {
for seed in (0..128).step_by(8) {
random_self_intersections(seed, 1, 12);
random_self_intersections(seed ^ 0x9e37_79b9_7f4a_7c15, 2, 20);
random_self_intersections(seed ^ 0xd1b5_4a32_d192_ed03, 3, 28);
Expand Down
2 changes: 1 addition & 1 deletion iOverlay/tests/output_consistency_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fn flat_and_vector_outputs_match_shapes_with_area_filtering() {
seed = seed.wrapping_mul(6364136223846793005).wrapping_add(1);
((seed >> 32) % 41) as i32 - 20
};
for case in 0..1000 {
for case in 0..750 {
let a: Vec<_> = (0..3 + case % 8).map(|_| IntPoint::new(next(), next())).collect();
let b: Vec<_> = (0..3 + case % 9).map(|_| IntPoint::new(next(), next())).collect();
for threshold in [0, 1, 10, 50] {
Expand Down
2 changes: 1 addition & 1 deletion iOverlay/tests/predicate_cell_oracle_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fn predicates_match_filled_cells_after_contour_cancellation() {
seed = seed.wrapping_mul(6364136223846793005).wrapping_add(1);
(seed >> 32) as usize
};
for case in 0..1200 {
for case in 0..600 {
let mut contours = [Vec::new(), Vec::new()];
let mut counts = [[0_i32; 64]; 2];
for side in 0..2 {
Expand Down
5 changes: 5 additions & 0 deletions iOverlay/tests/resolved_geometry_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ fn dense_boolean_output_has_resolved_edges_and_correct_point_locations() {
let b: Vec<_> = (0..20 + case % 40)
.map(|_| IntPoint::new(next(), next()))
.collect();
// Keep 48 original inputs across the full size range. A stride of five
// retains all 3 solvers x 4 overlay rules x 4 fill rules.
if case % 5 != 0 {
continue;
}
let mut overlay = Overlay::from_subj_and_clip(&a, &b);
overlay.solver = [Solver::LIST, Solver::TREE, Solver::FRAG][case % 3];
overlay.options.ogc = true;
Expand Down
2 changes: 1 addition & 1 deletion iOverlay/tests/slice_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ mod tests {

#[test]
fn test_random_4() {
for _ in 0..50000 {
for _ in 0..10_000 {
let path = random_polygon(8, 8);
let lines = random_lines(8, 8);

Expand Down
6 changes: 3 additions & 3 deletions iOverlay/tests/stroke_coverage_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fn round_strokes_cover_vertex_disks() {
seed = seed.wrapping_mul(6364136223846793005).wrapping_add(1);
((seed >> 32) % 21) as f64 - 10.0
};
for case in 0..2000 {
for case in 0..1000 {
let path: Vec<_> = (0..3 + case % 8).map(|_| [next(), next()]).collect();
let style = StrokeStyle::new(4.0)
.math(math)
Expand Down Expand Up @@ -142,7 +142,7 @@ fn variable_strokes_cover_interpolated_disks() {
seed = seed.wrapping_mul(6364136223846793005).wrapping_add(1);
((seed >> 32) % 41) as f64 - 20.0
};
for case in 0..3000 {
for case in 0..1800 {
let path: Vec<_> = (0..2 + case % 8)
.map(|_| StrokeVertex::new([next(), next()], next() + 20.0))
.collect();
Expand Down Expand Up @@ -202,7 +202,7 @@ fn variable_strokes_do_not_fill_outside_interpolated_disks() {
seed = seed.wrapping_mul(6364136223846793005).wrapping_add(1);
((seed >> 32) % 41) as f64 - 20.0
};
for case in 0..500 {
for case in 0..350 {
let path: Vec<_> = (0..2 + case % 8)
.map(|_| StrokeVertex::new([next(), next()], next() + 20.0))
.collect();
Expand Down
Loading