Skip to content

Commit

Permalink
A
Browse files Browse the repository at this point in the history
  • Loading branch information
al8n committed Sep 10, 2024
1 parent 9e542a7 commit 09e480f
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 22 deletions.
2 changes: 1 addition & 1 deletion ci/miri_sb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ rustup toolchain install nightly --component miri
rustup override set nightly
cargo miri setup

export MIRIFLAGS="-Zmiri-strict-provenance -Zmiri-disable-isolation -Zmiri-symbolic-alignment-check"
export MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-symbolic-alignment-check"

cargo miri test --tests --target x86_64-unknown-linux-gnu --all-features
# cargo miri test --tests --target aarch64-unknown-linux-gnu #crossbeam_utils has problem on this platform
Expand Down
2 changes: 1 addition & 1 deletion ci/miri_sb_generic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ rustup toolchain install nightly --component miri
rustup override set nightly
cargo miri setup

export MIRIFLAGS="-Zmiri-strict-provenance -Zmiri-disable-isolation -Zmiri-symbolic-alignment-check"
export MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-symbolic-alignment-check"

cargo miri test --tests --all-features
2 changes: 1 addition & 1 deletion ci/miri_tb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ rustup toolchain install nightly --component miri
rustup override set nightly
cargo miri setup

export MIRIFLAGS="-Zmiri-strict-provenance -Zmiri-disable-isolation -Zmiri-symbolic-alignment-check -Zmiri-tree-borrows"
export MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-symbolic-alignment-check -Zmiri-tree-borrows"

cargo miri test --tests --target x86_64-unknown-linux-gnu --all-features
# cargo miri test --tests --target aarch64-unknown-linux-gnu #crossbeam_utils has problem on this platform
Expand Down
2 changes: 1 addition & 1 deletion ci/miri_tb_generic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ rustup toolchain install nightly --component miri
rustup override set nightly
cargo miri setup

export MIRIFLAGS="-Zmiri-strict-provenance -Zmiri-disable-isolation -Zmiri-symbolic-alignment-check -Zmiri-tree-borrows"
export MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-symbolic-alignment-check -Zmiri-tree-borrows"

cargo miri test --tests --all-features
20 changes: 11 additions & 9 deletions src/swmr/wal/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use crate::tests::*;

use super::*;

const MB: u32 = 1024 * 1024;

#[test]
fn test_construct_inmemory() {
construct_inmemory::<OrderWal<Ascend, Crc32>>();
Expand Down Expand Up @@ -38,12 +40,12 @@ fn test_construct_with_small_capacity_map_file() {

#[test]
fn test_insert_inmemory() {
insert(OrderWal::new(Builder::new().with_capacity(1024 * 1024)).unwrap());
insert(OrderWal::new(Builder::new().with_capacity(MB)).unwrap());
}

#[test]
fn test_insert_map_anon() {
insert(OrderWal::map_anon(Builder::new().with_capacity(1024 * 1024)).unwrap());
insert(OrderWal::map_anon(Builder::new().with_capacity(MB)).unwrap());
}

#[test]
Expand All @@ -55,7 +57,7 @@ fn test_insert_map_file() {
dir.path().join("test_swmr_insert_map_file"),
Builder::new(),
OpenOptions::new()
.create_new(Some(1024 * 1024))
.create_new(Some(MB))
.write(true)
.read(true),
)
Expand All @@ -65,12 +67,12 @@ fn test_insert_map_file() {

#[test]
fn test_iter_inmemory() {
iter(OrderWal::new(Builder::new().with_capacity(1024 * 1024)).unwrap());
iter(OrderWal::new(Builder::new().with_capacity(MB)).unwrap());
}

#[test]
fn test_iter_map_anon() {
iter(OrderWal::map_anon(Builder::new().with_capacity(1024 * 1024)).unwrap());
iter(OrderWal::map_anon(Builder::new().with_capacity(MB)).unwrap());
}

#[test]
Expand All @@ -82,7 +84,7 @@ fn test_iter_map_file() {
dir.path().join("test_swmr_iter_map_file"),
Builder::new(),
OpenOptions::new()
.create_new(Some(1024 * 1024))
.create_new(Some(MB))
.write(true)
.read(true),
)
Expand All @@ -92,12 +94,12 @@ fn test_iter_map_file() {

#[test]
fn test_range_inmemory() {
range(OrderWal::new(Builder::new().with_capacity(1024 * 1024)).unwrap());
range(OrderWal::new(Builder::new().with_capacity(MB)).unwrap());
}

#[test]
fn test_range_map_anon() {
range(OrderWal::map_anon(Builder::new().with_capacity(1024 * 1024)).unwrap());
range(OrderWal::map_anon(Builder::new().with_capacity(MB)).unwrap());
}

#[test]
Expand All @@ -109,7 +111,7 @@ fn test_range_map_file() {
dir.path().join("test_swmr_range_map_file"),
Builder::new(),
OpenOptions::new()
.create_new(Some(1024 * 1024))
.create_new(Some(MB))
.write(true)
.read(true),
)
Expand Down
20 changes: 11 additions & 9 deletions src/unsync/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use crate::tests::*;

use super::*;

const MB: u32 = 1024 * 1024;

#[test]
fn test_construct_inmemory() {
construct_inmemory::<OrderWal<Ascend, Crc32>>();
Expand Down Expand Up @@ -38,12 +40,12 @@ fn test_construct_with_small_capacity_map_file() {

#[test]
fn test_insert_inmemory() {
insert(OrderWal::new(Builder::new().with_capacity(1024 * 1024)).unwrap());
insert(OrderWal::new(Builder::new().with_capacity(MB)).unwrap());
}

#[test]
fn test_insert_map_anon() {
insert(OrderWal::map_anon(Builder::new().with_capacity(1024 * 1024)).unwrap());
insert(OrderWal::map_anon(Builder::new().with_capacity(MB)).unwrap());
}

#[test]
Expand All @@ -55,7 +57,7 @@ fn test_insert_map_file() {
dir.path().join("test_unsync_insert_map_file"),
Builder::new(),
OpenOptions::new()
.create_new(Some(1024 * 1024))
.create_new(Some(MB))
.write(true)
.read(true),
)
Expand All @@ -65,12 +67,12 @@ fn test_insert_map_file() {

#[test]
fn test_iter_inmemory() {
iter(OrderWal::new(Builder::new().with_capacity(1024 * 1024)).unwrap());
iter(OrderWal::new(Builder::new().with_capacity(MB)).unwrap());
}

#[test]
fn test_iter_map_anon() {
iter(OrderWal::map_anon(Builder::new().with_capacity(1024 * 1024)).unwrap());
iter(OrderWal::map_anon(Builder::new().with_capacity(MB)).unwrap());
}

#[test]
Expand All @@ -82,7 +84,7 @@ fn test_iter_map_file() {
dir.path().join("test_unsync_iter_map_file"),
Builder::new(),
OpenOptions::new()
.create_new(Some(1024 * 1024))
.create_new(Some(MB))
.write(true)
.read(true),
)
Expand All @@ -92,12 +94,12 @@ fn test_iter_map_file() {

#[test]
fn test_range() {
range(OrderWal::new(Builder::new().with_capacity(1024 * 1024)).unwrap());
range(OrderWal::new(Builder::new().with_capacity(MB)).unwrap());
}

#[test]
fn test_range_map_anon() {
range(OrderWal::map_anon(Builder::new().with_capacity(1024 * 1024)).unwrap());
range(OrderWal::map_anon(Builder::new().with_capacity(MB)).unwrap());
}

#[test]
Expand All @@ -109,7 +111,7 @@ fn test_range_map_file() {
dir.path().join("test_unsync_range_map_file"),
Builder::new(),
OpenOptions::new()
.create_new(Some(1024 * 1024))
.create_new(Some(MB))
.write(true)
.read(true),
)
Expand Down

0 comments on commit 09e480f

Please sign in to comment.