8000 Fix macos version and add asserts to int test by jczuluag · Pull Request #120 · jrgerber/smbios-lib · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix macos version and add asserts to int test #120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/smbios_ci.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
name: smbioslib_ci

on:
push:
branches: [ main ]
workflow_dispatch:
workflow_call:
pull_request:
branches: [ main ]
types: [ labeled ]
branches: main

env:
CARGO_TERM_COLOR: always

jobs:
build:
if: ${{ github.event.label.name == 'Ready for Review' }} || github.event_name == 'push'
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
os: [macos-13, ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@v2
- name: Build
run: cargo build --verbose
run: cargo build
- name: OS version
run: uname -a
- name: Run tests
run: cargo test --verbose
run: cargo test
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ Specification 3.7.0](https://www.dmtf.org/sites/default/files/standards/document
In early development.

The current development stage is to finalize the API design.

## Dependencies
* Windows
* libc = "^0.2"
* libc
* MacOS
* libc = "^0.2"
* mach2 = "^0.4.1"
* core-foundation = "~0.9"
* core-foundation-sys = "~0.8"
* io-kit-sys = "^0.4.0"
* libc
* mach2
* core-foundation
* core-foundation-sys
* io-kit-sys

## Security
This library design follows a strict security mantra: *"Never trust the input"*.
Expand All @@ -59,7 +59,7 @@ fn retrieve_system_uuid() {
Some(uuid) => println!("System Information UUID == {:?}", uuid),
None => println!("No System Information (Type 1) structure found with a UUID field"),
},
Err(err) => println!("failure: {:?}", err),
Err(err) => assert!(false, "Failure: {:?}", err)
}
}
```
Expand All @@ -84,7 +84,7 @@ fn print_all_memory_devices() {
println!("{:#?}", memory_device);
}
}
Err(err) => println!("failure: {:?}", err),
Err(err) => assert!(false, "Failure: {:?}", err),
}
}
```
Expand Down Expand Up @@ -129,7 +129,7 @@ fn struct_struct_association() {
}
None => println!("No Memory Device (Type 17) structure found"),
},
Err(err) => println!("failure: {:?}", err),
Err(err) => assert!(false, "Failure: {:?}", err)
}
}
```
Expand Down
12 changes: 6 additions & 6 deletions tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fn retrieve_system_uuid() {
Some(uuid) => println!("System Information UUID == {:?}", uuid),
None => println!("No System Information (Type 1) structure found with a UUID field"),
},
Err(err) => println!("failure: {:?}", err),
Err(err) => assert!(false, "Failure: {:?}", err)
}
}

Expand All @@ -29,8 +29,8 @@ fn print_all_memory_devices() {
for memory_device in data.collect::<SMBiosMemoryDevice>() {
println!("{:#?}", memory_device);
}
}
Err(err) => println!("failure: {:?}", err),
},
Err(err) => assert!(false, "Failure: {:?}", err)
}
}

Expand All @@ -51,7 +51,7 @@ fn struct_struct_association() {
}
None => println!("No Memory Device (Type 17) structure found"),
},
Err(err) => println!("failure: {:?}", err),
Err(err) => assert!(false, "Failure: {:?}", err)
}
}

Expand All @@ -68,15 +68,15 @@ fn find_first_cpu() {
}
None => println!("No Processor Information (Type 4) structure found that is a CPU with a populated socket"),
},
Err(err) => println!("Table load failure: {:?}", err),
Err(err) => assert!(false, "Failure: {:?}", err)
}
}

/// Test filter() - finds all populated memory sockets
#[test]
fn find_installed_memory() {
match table_load_from_device() {
Err(err) => println!("Table load failure: {:?}", err),
Err(err) => assert!(false, "Failure: {:?}", err),
Ok(data) => data
.filter(
|memory_device: &SMBiosMemoryDevice| match memory_device.size() {
Expand Down
Loading
0