Skip to content

Commit

Permalink
fix(tests/lib.rs): Make different data size for 32 and 64 bit binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
kanav99 committed Apr 12, 2021
1 parent 103cf7d commit c2e2827
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ use self_encryption::{
ChunkDetails, DataMap, SelfEncryptionError, SelfEncryptor, MAX_CHUNK_SIZE,
};

const DATA_SIZE: usize = 20 * 1024 * 1024;
const DATA_SIZE: usize = (if cfg!(target_pointer_width = "32") { 4 } else { 20 }) * 1024 * 1024;

#[tokio::test]
async fn new_read() -> Result<(), SelfEncryptionError> {
Expand Down Expand Up @@ -291,7 +291,7 @@ async fn write_random_sizes_at_random_positions() -> Result<(), SelfEncryptionEr
// pieces may overlap or leave gaps in the file. Gaps should be filled with 0s when read back.
async fn write_random_sizes_out_of_sequence_with_gaps_and_overlaps(
) -> Result<(), SelfEncryptionError> {
let parts = 20usize;
let parts: usize = if cfg!(target_pointer_width = "32") { 4 } else { 20 };
assert!((DATA_SIZE / MAX_CHUNK_SIZE) as u64 >= parts as u64);
let mut rng = new_test_rng()?;
let mut total_size = 0;
Expand Down

0 comments on commit c2e2827

Please sign in to comment.