[pbs-devel] [PATCH v4 pxar 1/3] tests: adapt tests to decoder interface changes
Christian Ebner
c.ebner at proxmox.com
Wed Jun 12 15:17:11 CEST 2024
The `Decoder`s `contents` method call can fail because of an added
consistency check when using split variant inputs.
Therefore, the additional error has to be handled by the callers.
Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
changes since version 3:
- not present
tests/compat.rs | 1 +
tests/simple/fs.rs | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/tests/compat.rs b/tests/compat.rs
index 8f1b778..c9e681a 100644
--- a/tests/compat.rs
+++ b/tests/compat.rs
@@ -125,6 +125,7 @@ fn test_archive() {
let mut content = Vec::new();
decoder
.contents()
+ .expect("failed to get contents from decoder")
.expect("failed to get contents for file entry")
.read_to_end(&mut content)
.expect("failed to read test file contents");
diff --git a/tests/simple/fs.rs b/tests/simple/fs.rs
index 96fcee9..39d1294 100644
--- a/tests/simple/fs.rs
+++ b/tests/simple/fs.rs
@@ -235,7 +235,7 @@ impl Entry {
PxarEntryKind::File { size, .. } => {
let mut data = Vec::new();
decoder
- .contents()
+ .contents()?
.ok_or_else(|| {
format_err!("failed to get contents for file entry: {:?}", item.path())
})?
--
2.39.2
More information about the pbs-devel
mailing list