<feed xmlns='http://www.w3.org/2005/Atom'>
<title>nitrokey-rs/tests/util, branch v0.7.0</title>
<subtitle>Rust interface to libnitrokey</subtitle>
<id>https://git.ireas.org/nitrokey-rs/atom?h=v0.7.0</id>
<link rel='self' href='https://git.ireas.org/nitrokey-rs/atom?h=v0.7.0'/>
<link rel='alternate' type='text/html' href='https://git.ireas.org/nitrokey-rs/'/>
<updated>2019-02-05T14:48:24Z</updated>
<entry>
<title>Revert "Refactor User and Admin to use a mutable reference"</title>
<updated>2019-02-05T14:48:24Z</updated>
<author>
<name>Robin Krahl</name>
<email>robin.krahl@ireas.org</email>
</author>
<published>2019-02-05T12:47:24Z</published>
<link rel='alternate' type='text/html' href='https://git.ireas.org/nitrokey-rs/commit/?id=83641ca0518e4c766c63e40d0787e4f0b436652a'/>
<id>urn:sha1:83641ca0518e4c766c63e40d0787e4f0b436652a</id>
<content type='text'>
This reverts commit 0972bbe82623c3d9649b6023d8f50d304aa0cde6.
</content>
</entry>
<entry>
<title>Remove PIN constants from tests</title>
<updated>2019-02-04T00:30:25Z</updated>
<author>
<name>Robin Krahl</name>
<email>robin.krahl@ireas.org</email>
</author>
<published>2019-02-04T00:29:11Z</published>
<link rel='alternate' type='text/html' href='https://git.ireas.org/nitrokey-rs/commit/?id=606177a61de39ba5e96390d63cff536f895d8c39'/>
<id>urn:sha1:606177a61de39ba5e96390d63cff536f895d8c39</id>
<content type='text'>
In a previous commit, we introduced the DEFAULT_{ADMIN,USER}_PIN
constants.  Therefore we no longer need in the {ADMIN,USER}_PASSWORD
constants in the util module for the tests.
</content>
</entry>
<entry>
<title>Refactor User and Admin to use a mutable reference</title>
<updated>2019-02-02T10:25:02Z</updated>
<author>
<name>Robin Krahl</name>
<email>robin.krahl@ireas.org</email>
</author>
<published>2019-01-28T14:24:12Z</published>
<link rel='alternate' type='text/html' href='https://git.ireas.org/nitrokey-rs/commit/?id=0972bbe82623c3d9649b6023d8f50d304aa0cde6'/>
<id>urn:sha1:0972bbe82623c3d9649b6023d8f50d304aa0cde6</id>
<content type='text'>
In the initial nitrokey-rs implementation, the Admin and the User struct
take the Device by value to make sure that the user cannot initiate a
second authentication while this first is still active (which would
invalidate the temporary password).  Now we realized that this is not
necessary – taking a mutable reference has the same effect, but leads to
a much cleaner API.

This patch refactors the Admin and User structs – and all dependent code
– to use a mutable reference instead of a Device value.
</content>
</entry>
<entry>
<title>Add assert_any_ok macro to unit tests</title>
<updated>2019-01-28T19:48:33Z</updated>
<author>
<name>Robin Krahl</name>
<email>robin.krahl@ireas.org</email>
</author>
<published>2019-01-28T19:45:40Z</published>
<link rel='alternate' type='text/html' href='https://git.ireas.org/nitrokey-rs/commit/?id=d1262390573b758ac4aa610eff96a1b5dcb9f3d6'/>
<id>urn:sha1:d1262390573b758ac4aa610eff96a1b5dcb9f3d6</id>
<content type='text'>
Sometimes we cannot use assert_ok! as we can’t compare the Ok value (or
do not want to).  For these cases, this patch adds the new assert_any_ok
macro to use instead of assert!(x.is_ok()).  The advantage is that the
error information is not discarded but printed in a helpful error
message.
</content>
</entry>
<entry>
<title>Add unwrap_ok macro to replace unwrap in unit tests</title>
<updated>2019-01-28T19:40:49Z</updated>
<author>
<name>Robin Krahl</name>
<email>robin.krahl@ireas.org</email>
</author>
<published>2019-01-28T19:40:49Z</published>
<link rel='alternate' type='text/html' href='https://git.ireas.org/nitrokey-rs/commit/?id=52df93249f27ae803bada0451d7380bc3d596007'/>
<id>urn:sha1:52df93249f27ae803bada0451d7380bc3d596007</id>
<content type='text'>
The unwrap error message is not very useful.  This patch adds the
unwrap_ok macro that is basically the same as unwrap but prints a more
readable error message.
</content>
</entry>
<entry>
<title>Add license and copyright information</title>
<updated>2019-01-23T15:33:26Z</updated>
<author>
<name>Robin Krahl</name>
<email>robin.krahl@ireas.org</email>
</author>
<published>2019-01-23T15:33:26Z</published>
<link rel='alternate' type='text/html' href='https://git.ireas.org/nitrokey-rs/commit/?id=fdb7bac3063e62776bfc13f184cf786da19f42d1'/>
<id>urn:sha1:fdb7bac3063e62776bfc13f184cf786da19f42d1</id>
<content type='text'>
This patch adds license and copyright information to all files to make
nitrokey-rs compliant with the REUSE practices [0].

[0] https://reuse.software/practices/2.0/
</content>
</entry>
<entry>
<title>Check specific error codes in the tests</title>
<updated>2019-01-20T21:15:29Z</updated>
<author>
<name>Robin Krahl</name>
<email>robin.krahl@ireas.org</email>
</author>
<published>2019-01-17T14:21:44Z</published>
<link rel='alternate' type='text/html' href='https://git.ireas.org/nitrokey-rs/commit/?id=d87859975dc158919ecd5bf11a1111a2da5fcb30'/>
<id>urn:sha1:d87859975dc158919ecd5bf11a1111a2da5fcb30</id>
<content type='text'>
If possible, check specific error codes instead of `is_err()`.  This
makes the code more readable and catches bugs resulting in the wrong
error code.  Also, using the assert_*_err and assert_ok macros yields
error messages containing the expected and the actual value.

To be able to use these macros with the `get_password_safe` method, we
also have to implement `Debug` for `PasswordSafe` and `Device`.
</content>
</entry>
<entry>
<title>Refactor library errors into LibraryError enum</title>
<updated>2019-01-20T21:08:50Z</updated>
<author>
<name>Robin Krahl</name>
<email>robin.krahl@ireas.org</email>
</author>
<published>2019-01-17T12:47:52Z</published>
<link rel='alternate' type='text/html' href='https://git.ireas.org/nitrokey-rs/commit/?id=5e258d26b55af6bed7c316b1c7ac12e20946702d'/>
<id>urn:sha1:5e258d26b55af6bed7c316b1c7ac12e20946702d</id>
<content type='text'>
Previously, library errors were part of the CommandError enum.  As
command errors and library errors are two different error types, they
should be split into two enums.
</content>
</entry>
<entry>
<title>Add assert_cmd_err and assert_ok macros to tests</title>
<updated>2019-01-20T21:08:26Z</updated>
<author>
<name>Robin Krahl</name>
<email>robin.krahl@ireas.org</email>
</author>
<published>2019-01-17T03:49:13Z</published>
<link rel='alternate' type='text/html' href='https://git.ireas.org/nitrokey-rs/commit/?id=c43b63b70ee32f9fa8e980d89eff5383931f5c39'/>
<id>urn:sha1:c43b63b70ee32f9fa8e980d89eff5383931f5c39</id>
<content type='text'>
These macros allow easier comparisions using the new error type.  This
patch fixes all tests and updates nitrokey-test to 0.2.0 so that it
integrates with the new error structure.

Some tests may still fail until CommunicationError::NotConnected is
actually returned.
</content>
</entry>
<entry>
<title>Move the update PIN from tests/util to tests/device</title>
<updated>2019-01-12T15:03:32Z</updated>
<author>
<name>Robin Krahl</name>
<email>robin.krahl@ireas.org</email>
</author>
<published>2019-01-12T15:00:11Z</published>
<link rel='alternate' type='text/html' href='https://git.ireas.org/nitrokey-rs/commit/?id=87e742b4746e1dc261825f0ca87c64a1ea454b1d'/>
<id>urn:sha1:87e742b4746e1dc261825f0ca87c64a1ea454b1d</id>
<content type='text'>
The update PIN is only used in the Storage tests, so it is moved from
the common tests/util module to the tests/device module.  This fixes
compiler warnings when compiling the other test modules.
</content>
</entry>
</feed>
