Skip to content

Commit 331aac8

Browse files
authored
Merge pull request #587 from sgued/fix-docs
Fix broken tests and update CI to test more features
2 parents 692e8e0 + 1702129 commit 331aac8

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
components: miri
4949

5050
- name: Run miri
51-
run: MIRIFLAGS=-Zmiri-ignore-leaks cargo miri test
51+
run: MIRIFLAGS=-Zmiri-ignore-leaks cargo miri test --features="alloc,defmt,mpmc_large,portable-atomic-critical-section,serde,ufmt,bytes"
5252

5353
# Run cargo test
5454
test:
@@ -84,7 +84,7 @@ jobs:
8484
toolchain: stable
8585

8686
- name: Run cargo test
87-
run: cargo test
87+
run: cargo test --features="alloc,defmt,mpmc_large,portable-atomic-critical-section,serde,ufmt,bytes"
8888

8989
# Run cargo fmt --check
9090
style:

src/bytes.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,21 @@ mod tests {
6161
#[test]
6262
#[should_panic]
6363
fn buf_mut_advance_mut_out_of_bounds_view() {
64-
let vec: &mut VecView<u8, u8> = &mut Vec::<u8, 8>::new();
64+
let vec: &mut VecView<u8, u8> = &mut Vec::<u8, 8, u8>::new();
6565
unsafe { vec.advance_mut(9) };
6666
}
6767

6868
#[test]
6969
fn buf_mut_remaining_mut_view() {
70-
let vec: &mut VecView<u8, u8> = &mut Vec::<u8, 8>::new();
70+
let vec: &mut VecView<u8, u8> = &mut Vec::<u8, 8, u8>::new();
7171
assert_eq!(vec.remaining_mut(), 8);
7272
vec.push(42).unwrap();
7373
assert_eq!(vec.remaining_mut(), 7);
7474
}
7575

7676
#[test]
7777
fn buf_mut_chunk_mut_view() {
78-
let vec: &mut VecView<u8, u8> = &mut Vec::<u8, 8>::new();
78+
let vec: &mut VecView<u8, u8> = &mut Vec::<u8, 8, u8>::new();
7979
assert_eq!(vec.chunk_mut().len(), 8);
8080
unsafe { vec.advance_mut(1) };
8181
assert_eq!(vec.chunk_mut().len(), 7);

src/pool/arc.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//! # Example usage
44
//!
55
//! ```
6+
//! use core::ptr::addr_of_mut;
67
//! use heapless::{arc_pool, pool::arc::{Arc, ArcBlock}};
78
//!
89
//! arc_pool!(MyArcPool: u128);
@@ -45,6 +46,7 @@
4546
//! to the `ArcPool`. This requires an intermediate `const` value as shown below:
4647
//!
4748
//! ```
49+
//! use core::ptr::addr_of_mut;
4850
//! use heapless::{arc_pool, pool::arc::ArcBlock};
4951
//!
5052
//! arc_pool!(MyArcPool: u128);
@@ -54,7 +56,7 @@
5456
//! let blocks: &'static mut [ArcBlock<u128>] = {
5557
//! const BLOCK: ArcBlock<u128> = ArcBlock::new(); // <=
5658
//! static mut BLOCKS: [ArcBlock<u128>; POOL_CAPACITY] = [BLOCK; POOL_CAPACITY];
57-
//! unsafe { addr_of_mut!(BLOCK).as_mut().unwrap()S }
59+
//! unsafe { addr_of_mut!(BLOCKS).as_mut().unwrap() }
5860
//! };
5961
//!
6062
//! for block in blocks {

src/pool/boxed.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
//! to the `BoxPool`. This requires an intermediate `const` value as shown below:
6262
//!
6363
//! ```
64+
//! use core::ptr::addr_of_mut;
6465
//! use heapless::{box_pool, pool::boxed::BoxBlock};
6566
//!
6667
//! box_pool!(MyBoxPool: u128);

src/pool/object.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//! # Example usage
44
//!
55
//! ```
6+
//! use core::ptr::addr_of_mut;
67
//! use heapless::{object_pool, pool::object::{Object, ObjectBlock}};
78
//!
89
//! object_pool!(MyObjectPool: [u8; 128]);
@@ -46,6 +47,7 @@
4647
//! to the `ObjectPool`. This requires an intermediate `const` value as shown below:
4748
//!
4849
//! ```
50+
//! use core::ptr::addr_of_mut;
4951
//! use heapless::{object_pool, pool::object::ObjectBlock};
5052
//!
5153
//! object_pool!(MyObjectPool: [u8; 128]);
@@ -55,7 +57,7 @@
5557
//! let blocks: &'static mut [ObjectBlock<[u8; 128]>] = {
5658
//! const BLOCK: ObjectBlock<[u8; 128]> = ObjectBlock::new([0; 128]); // <=
5759
//! static mut BLOCKS: [ObjectBlock<[u8; 128]>; POOL_CAPACITY] = [BLOCK; POOL_CAPACITY];
58-
//! unsafe { addr_of_mut!(BLOCK).as_mut().unwrap()S }
60+
//! unsafe { addr_of_mut!(BLOCKS).as_mut().unwrap() }
5961
//! };
6062
//!
6163
//! for block in blocks {

0 commit comments

Comments
 (0)