Skip to content

Commit

Permalink
Check the size of Evoxel.
Browse files Browse the repository at this point in the history
  • Loading branch information
kpreid committed Oct 27, 2023
1 parent 13cd33b commit a6d7982
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions all-is-cubes/src/block/evaluated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,19 @@ mod tests {
use super::*;
use crate::block::{AnimationHint, Block, Resolution, Resolution::R2, AIR};
use pretty_assertions::assert_eq;
use std::mem::size_of;

/// `Evoxel`s are stored in large quantity, so we should think carefully any time we
/// might make it bigger. Or maybe even try to make it smaller.
#[test]
fn evoxel_size() {
assert_eq!(
size_of::<Evoxel>(),
(4 + 3) * size_of::<f32>() // colors
+ 2 // flags
+ 2 // padding
)
}

#[test]
fn visible_or_animated() {
Expand Down

0 comments on commit a6d7982

Please sign in to comment.