layout tests: unique ids, depth at the resolver bound
This commit is contained in:
parent
c853068288
commit
4d2414e1a1
1 changed files with 6 additions and 4 deletions
|
|
@ -650,20 +650,20 @@ fn depth() {
|
|||
let tree = bind(&mut state, &document).unwrap();
|
||||
assert!(run_default_thread(&tree).nodes.len() > 20);
|
||||
|
||||
// Every display kind at 1,024 levels lays out on a default thread. The tree is built and
|
||||
// Every display kind at 1,024 levels (the resolver STACK_BOUND, the leaf included) lays out on a default thread. The tree is built and
|
||||
// dropped on a roomy one: only layout is held to the default stack.
|
||||
for kind in KINDS {
|
||||
let nodes = std::thread::Builder::new()
|
||||
.stack_size(128 * 1024 * 1024)
|
||||
.spawn(move || {
|
||||
let document = surface_of(chain(kind, 1024));
|
||||
let document = surface_of(chain(kind, 1023));
|
||||
let tree = bind_with(&mut MemState::new(), &document, deep_limits()).unwrap();
|
||||
run_default_thread(&tree).nodes.len()
|
||||
})
|
||||
.unwrap()
|
||||
.join()
|
||||
.unwrap();
|
||||
assert_eq!(nodes, 1025, "{kind:?}");
|
||||
assert_eq!(nodes, 1024, "{kind:?}");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -695,10 +695,12 @@ fn stack_per_level() {
|
|||
#[test]
|
||||
fn extreme_values_never_panic() {
|
||||
let huge = |v: f64| px(v);
|
||||
let count = std::cell::Cell::new(0);
|
||||
let boxed_with = |mutate: &dyn Fn(&mut BoxStyle)| {
|
||||
let mut style = sized(10.0, 10.0);
|
||||
mutate(&mut style);
|
||||
bx("child", style, vec![embed("e", 5.0, 5.0)])
|
||||
count.set(count.get() + 1);
|
||||
bx(&format!("child{}", count.get()), style, vec![embed(&format!("e{}", count.get()), 5.0, 5.0)])
|
||||
};
|
||||
let root = bx("root", plain(), vec![
|
||||
boxed_with(&|s| s.size = size2(huge(3e38), huge(3e38))),
|
||||
|
|
|
|||
Loading…
Reference in a new issue