Skip to content

Commit 5752e90

Browse files
committed
uefi-test-runner: Switch from static assertion to test function for consistency
1 parent a6b9f85 commit 5752e90

File tree

5 files changed

+9
-10
lines changed

5 files changed

+9
-10
lines changed

Cargo.lock

Lines changed: 0 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ bitflags = "2.0.0"
2424
log = { version = "0.4.5", default-features = false }
2525
ptr_meta = { version = "0.3.0", default-features = false, features = ["derive"] }
2626
uguid = "2.2.1"
27-
static_assertions = "1.1.0"
2827

2928
[patch.crates-io]
3029
uefi = { path = "uefi" }

uefi-raw/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ rust-version = "1.85.1"
2121
[dependencies]
2222
bitflags.workspace = true
2323
uguid.workspace = true
24-
static_assertions.workspace = true
2524

2625
[package.metadata.docs.rs]
2726
rustdoc-args = ["--cfg", "docsrs"]

uefi-test-runner/src/proto/pci/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ pub fn test() {
88
root_bridge::test_mapping();
99
root_bridge::test_copy();
1010
root_bridge::test_config();
11+
root_bridge::test_attributes();
12+
root_bridge::test_sizes();
1113
}

uefi-test-runner/src/proto/pci/root_bridge.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ use uefi::boot::{OpenProtocolAttributes, OpenProtocolParams, ScopedProtocol, ima
55
use uefi::proto::ProtocolPointer;
66
use uefi::proto::pci::PciIoAddress;
77
use uefi::proto::pci::root_bridge::{AttributeReport, PciRootBridgeIo};
8-
use uefi::{Handle, println};
8+
use uefi::Handle;
9+
use uefi_raw::protocol::pci::resource::QWordAddressSpaceDescriptor;
910
use uefi_raw::protocol::pci::root_bridge::{
1011
PciRootBridgeIoProtocolAttribute, PciRootBridgeIoProtocolOperation,
1112
};
@@ -237,6 +238,11 @@ pub fn test_attributes() {
237238
}
238239
}
239240

241+
pub fn test_sizes() {
242+
assert_eq!(size_of::<QWordAddressSpaceDescriptor>(), 0x2E);
243+
assert_eq!(size_of::<PciIoAddress>(), size_of::<u64>());
244+
}
245+
240246
fn get_open_protocol<P: ProtocolPointer + ?Sized>(handle: Handle) -> ScopedProtocol<P> {
241247
let open_opts = OpenProtocolParams {
242248
handle,

0 commit comments

Comments
 (0)