mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
rust/pv*: Unit test flag parsing
Add a unit test for flag parsing. In order to ease this test, add derive Eq to ControlFlags and Msb0Flags64. For the same test, add derive Default to CreateBootImageArgs and the structs used in it. The latter can be limited to only derive when testing to avoid confusion with any user-level default. Acked-by: Steffen Eiden <seiden@linux.ibm.com> Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com> Signed-off-by: Jakob Naucke <naucke@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
ec10654c35
commit
efdadfcdb9
@@ -34,7 +34,7 @@ pub trait Flags<T>: From<T> + for<'a> From<&'a T> {
|
||||
///
|
||||
/// Wraps an u64 to set/get individual bits
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Clone, Copy, Default, AsBytes, FromZeroes, FromBytes)]
|
||||
#[derive(Debug, Clone, Copy, Default, AsBytes, FromZeroes, FromBytes, Eq, PartialEq)]
|
||||
pub struct Msb0Flags64(U64<BigEndian>);
|
||||
impl Flags<u64> for Msb0Flags64 {
|
||||
#[track_caller]
|
||||
|
||||
Reference in New Issue
Block a user