diff options
author | David Pursell <dpursell@google.com> | 2023-11-28 15:40:43 -0800 |
---|---|---|
committer | David Pursell <dpursell@google.com> | 2023-11-29 08:30:32 -0800 |
commit | 0315b332ebb61c2ae667e4005033753d4255c3f7 (patch) | |
tree | 3f57220940dc92ea4fd356fc4ce3f8d674322aea /rust/tests/verify_tests.rs | |
parent | d495b9cfc30a4cac3fdbb40c73716b2615f0e6c3 (diff) | |
download | avb-0315b332ebb61c2ae667e4005033753d4255c3f7.tar.gz |
libavb_rs: export Result types
We have a few error types that are commonly going to be wrapped in
Results; define and export those Result types here to simplify common
usage.
Bug: b/290110273
Test: atest libavb_rs_test libavb_rs_uuid_test
Change-Id: I6bae0f0e0bcb836899e6f93dc8c0ec1d3509d84e
Diffstat (limited to 'rust/tests/verify_tests.rs')
-rw-r--r-- | rust/tests/verify_tests.rs | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/rust/tests/verify_tests.rs b/rust/tests/verify_tests.rs index 416e0ec..13d4912 100644 --- a/rust/tests/verify_tests.rs +++ b/rust/tests/verify_tests.rs @@ -17,6 +17,7 @@ use crate::test_ops::TestOps; use avb::{ slot_verify, HashtreeErrorMode, IoError, SlotVerifyData, SlotVerifyError, SlotVerifyFlags, + SlotVerifyResult, }; use std::{ffi::CString, fs}; #[cfg(feature = "uuid")] @@ -50,9 +51,7 @@ fn test_ops_one_image_one_vbmeta() -> TestOps { } /// Calls `slot_verify()` using standard args for `test_ops_one_image_one_vbmeta()` setup. -fn verify_one_image_one_vbmeta<'a>( - ops: &'a mut TestOps, -) -> Result<SlotVerifyData<'a>, SlotVerifyError<'a>> { +fn verify_one_image_one_vbmeta(ops: &mut TestOps) -> SlotVerifyResult<SlotVerifyData> { slot_verify( ops, &[&CString::new(TEST_PARTITION_NAME).unwrap()], @@ -74,9 +73,7 @@ fn test_ops_two_images_one_vbmeta() -> TestOps { } /// Calls `slot_verify()` using standard args for `test_ops_two_images_one_vbmeta()` setup. -fn verify_two_images_one_vbmeta<'a>( - ops: &'a mut TestOps, -) -> Result<SlotVerifyData<'a>, SlotVerifyError<'a>> { +fn verify_two_images_one_vbmeta(ops: &mut TestOps) -> SlotVerifyResult<SlotVerifyData> { slot_verify( ops, &[ @@ -102,9 +99,7 @@ fn test_ops_boot_partition() -> TestOps { } /// Calls `slot_verify()` using standard args for `test_ops_boot_partition()` setup. -fn verify_boot_partition<'a>( - ops: &'a mut TestOps, -) -> Result<SlotVerifyData<'a>, SlotVerifyError<'a>> { +fn verify_boot_partition(ops: &mut TestOps) -> SlotVerifyResult<SlotVerifyData> { slot_verify( ops, &[&CString::new("boot").unwrap()], @@ -133,9 +128,7 @@ fn test_ops_persistent_digest(image: Vec<u8>) -> TestOps { } /// Calls `slot_verify()` using standard args for `test_ops_persistent_digest()` setup. -fn verify_persistent_digest<'a>( - ops: &'a mut TestOps, -) -> Result<SlotVerifyData<'a>, SlotVerifyError<'a>> { +fn verify_persistent_digest(ops: &mut TestOps) -> SlotVerifyResult<SlotVerifyData> { slot_verify( ops, &[&CString::new(TEST_PARTITION_PERSISTENT_DIGEST_NAME).unwrap()], |