mirror of
https://github.com/redstrate/Physis.git
synced 2025-04-26 06:07:45 +00:00
Test the replace_vertices function
This commit is contained in:
parent
d75296f4d2
commit
840fb21ba0
1 changed files with 20 additions and 0 deletions
20
src/model.rs
20
src/model.rs
|
@ -990,6 +990,26 @@ mod tests {
|
||||||
assert_eq!(mdl.model_data, old_mdl.model_data);
|
assert_eq!(mdl.model_data, old_mdl.model_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_update_vertices() {
|
||||||
|
let mut d = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
|
||||||
|
d.push("resources/tests");
|
||||||
|
d.push("c0201e0038_top_zeroed.mdl");
|
||||||
|
|
||||||
|
let mut mdl = MDL::from_existing(&read(d).unwrap()).unwrap();
|
||||||
|
let old_mdl = mdl.clone();
|
||||||
|
|
||||||
|
for l in 0..old_mdl.lods.len() {
|
||||||
|
for p in 0..old_mdl.lods[l].parts.len() {
|
||||||
|
mdl.replace_vertices(l, p, &old_mdl.lods[l].parts[p].vertices, &old_mdl.lods[l].parts[p].indices, &old_mdl.lods[l].parts[p].submeshes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// There should be no changes
|
||||||
|
assert_eq!(mdl.file_header, old_mdl.file_header);
|
||||||
|
assert_eq!(mdl.model_data, old_mdl.model_data);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_parsing() {
|
fn test_parsing() {
|
||||||
let mut d = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
|
let mut d = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
|
||||||
|
|
Loading…
Add table
Reference in a new issue