use ifc_lite_processing::{
process_geometry_streaming_with_options_and_bootstrap, QuickMetadataBootstrap, StreamingOptions,
};
const FIXTURE: &str = concat!(
env!("CARGO_MANIFEST_DIR"),
"/../geometry/tests/fixtures/issue_1910_storey_shell_geometry.ifc"
);
fn read_fixture() -> Vec<u8> {
std::fs::read(FIXTURE).expect("issue_1910 storey fixture must be present")
}
#[test]
fn bootstrap_path_still_schedules_and_meshes_the_container_geometry() {
let content = read_fixture();
let mut captured: Option<QuickMetadataBootstrap> = None;
let options = StreamingOptions {
emit_quick_metadata_bootstrap: true,
..Default::default()
};
let result = process_geometry_streaming_with_options_and_bootstrap(
&content,
options,
|_, _, _| {},
|_| {},
|b| captured = Some(b.clone()),
);
let storey_mesh = result
.meshes
.iter()
.find(|m| m.express_id == 40)
.unwrap_or_else(|| {
let seen: Vec<(u32, &str)> = result
.meshes
.iter()
.map(|m| (m.express_id, m.ifc_type.as_str()))
.collect();
panic!(
"with emit_quick_metadata_bootstrap on, IFCBUILDINGSTOREY #40's \
geometry job must still be scheduled and meshed via the \
instance-level exception; got meshes {seen:?}"
)
});
assert!(
!storey_mesh.positions.is_empty() && !storey_mesh.indices.is_empty(),
"the container's mesh must have real geometry, not an empty placeholder"
);
let boot = captured.expect("a quick-metadata bootstrap should be emitted");
assert!(
boot.entity_count > 0,
"the bootstrap should have scanned the fixture's entities"
);
}