Skip to content

Commit a391241

Browse files
authored
Add PFD1 to PFD4 deserialization tests (#258)
### Checklist * [X] I have read the [Contributor Guide](../CONTRIBUTING.md) * [X] I have read and agree to the [Code of Conduct](../CODE_OF_CONDUCT.md) * [X] I have added a description of my changes and why I'd like them included in the section below ### Description of Changes Add tests of puffin file de-serialization. This add tests for `FrameData` PFD1 to PFD4 formats. ### Related Issues This should help avoid breaking during refactoring (like PR #239).
1 parent 23304f8 commit a391241

5 files changed

Lines changed: 33 additions & 0 deletions

File tree

puffin/src/profile_view.rs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,3 +441,36 @@ impl FrameStats {
441441
self.total_ram_used = 0;
442442
}
443443
}
444+
445+
#[cfg(all(test, feature = "serialization"))]
446+
mod tests {
447+
use super::FrameView;
448+
449+
#[test]
450+
fn read_pfd4_file() -> anyhow::Result<()> {
451+
let mut file = std::fs::File::open("tests/data/capture_PFD4.puffin")?;
452+
let _ = FrameView::read(&mut file)?;
453+
Ok(())
454+
}
455+
456+
#[test]
457+
fn read_pfd3_file() -> anyhow::Result<()> {
458+
let mut file = std::fs::File::open("tests/data/capture_PFD3.puffin")?;
459+
let _ = FrameView::read(&mut file)?;
460+
Ok(())
461+
}
462+
463+
#[test]
464+
fn read_pfd2_file() -> anyhow::Result<()> {
465+
let mut file = std::fs::File::open("tests/data/capture_PFD2.puffin")?;
466+
let _ = FrameView::read(&mut file)?;
467+
Ok(())
468+
}
469+
470+
#[test]
471+
fn read_pfd1_file() -> anyhow::Result<()> {
472+
let mut file = std::fs::File::open("tests/data/capture_PFD1.puffin")?;
473+
let _ = FrameView::read(&mut file)?;
474+
Ok(())
475+
}
476+
}
6.23 KB
Binary file not shown.
7.98 KB
Binary file not shown.
8.21 KB
Binary file not shown.
6.73 KB
Binary file not shown.

0 commit comments

Comments
 (0)