Skip to content

Commit

Permalink
Add sizeof tests (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
robert3005 authored Mar 11, 2024
1 parent ce181c4 commit 198fd56
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions vortex-array/src/dtype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,3 +299,15 @@ impl From<PType> for DType {
}
}
}

#[cfg(test)]
mod test {
use std::mem;

use crate::dtype::DType;

#[test]
fn size_of() {
assert_eq!(mem::size_of::<DType>(), 48);
}
}
12 changes: 12 additions & 0 deletions vortex-array/src/scalar/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,15 @@ impl<T: NativePType> AsBytes for T {
unsafe { std::slice::from_raw_parts(raw_ptr, std::mem::size_of::<T>()) }
}
}

#[cfg(test)]
mod test {
use std::mem;

use crate::scalar::Scalar;

#[test]
fn size_of() {
assert_eq!(mem::size_of::<Scalar>(), 80);
}
}

0 comments on commit 198fd56

Please sign in to comment.