aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2020-01-28 10:07:23 +0100
committerRobin Krahl <robin.krahl@ireas.org>2020-01-28 11:54:20 +0100
commitda8727996efacec4280696caefee3feecea4eae7 (patch)
tree82f410d4009b698b630a90bcfa6255c07d743a33 /tests
parent47795368c32c0c47a9c3da761c3adf0a36ca419f (diff)
downloadnitrokey-rs-da8727996efacec4280696caefee3feecea4eae7.tar.gz
nitrokey-rs-da8727996efacec4280696caefee3feecea4eae7.tar.bz2
Add String value to the Error::UnexpectedError variant
To make debugging of unexpected errors easier, this patch adds an associated String value with a description of the unexpected behavior to the UnexpectedError variant of the Error enum.
Diffstat (limited to 'tests')
-rw-r--r--tests/pws.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/pws.rs b/tests/pws.rs
index 7169695..47e9703 100644
--- a/tests/pws.rs
+++ b/tests/pws.rs
@@ -16,7 +16,7 @@ use nitrokey_test::test as test_device;
fn get_slot_name_direct(slot: u8) -> Result<String, Error> {
let ptr = unsafe { nitrokey_sys::NK_get_password_safe_slot_name(slot) };
if ptr.is_null() {
- return Err(Error::UnexpectedError);
+ return Err(Error::UnexpectedError("null pointer".to_owned()));
}
let s = unsafe { CStr::from_ptr(ptr).to_string_lossy().into_owned() };
unsafe { free(ptr as *mut c_void) };