Skip to content

Commit

Permalink
WIP fix the few tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dkm committed Aug 27, 2020
1 parent 1a6c896 commit b51c5fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
15 changes: 0 additions & 15 deletions src/epd2in13_v2/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,18 +291,3 @@ impl traits::Command for Command {
self as u8
}
}

#[cfg(test)]
mod tests {
use super::Command;
use crate::traits::Command as CommandTrait;

#[test]
fn command_addr() {
assert_eq!(Command::DRIVER_OUTPUT_CONTROL.address(), 0x01);

assert_eq!(Command::SET_RAM_X_ADDRESS_COUNTER.address(), 0x4E);

assert_eq!(Command::NOP.address(), 0xFF);
}
}
8 changes: 4 additions & 4 deletions src/epd2in13_v2/graphics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ mod tests {
#[test]
fn graphics_size() {
let display = Display2in13::default();
assert_eq!(display.buffer().len(), 48000);
assert_eq!(display.buffer().len(), 4000);
}

// test default background color on all bytes
Expand Down Expand Up @@ -98,7 +98,7 @@ mod tests {
let mut display = Display2in13::default();
display.set_rotation(DisplayRotation::Rotate90);

let _ = Line::new(Point::new(0, 792), Point::new(0, 799))
let _ = Line::new(Point::new(0, (WIDTH-8) as i32), Point::new(0, (WIDTH-1) as i32))
.into_styled(PrimitiveStyle::with_stroke(Black, 1))
.draw(&mut display);

Expand All @@ -116,7 +116,7 @@ mod tests {
let mut display = Display2in13::default();
display.set_rotation(DisplayRotation::Rotate180);

let _ = Line::new(Point::new(792, 479), Point::new(799, 479))
let _ = Line::new(Point::new((WIDTH - 8) as i32, (HEIGHT - 1) as i32), Point::new((WIDTH - 1) as i32, (HEIGHT - 1) as i32))
.into_styled(PrimitiveStyle::with_stroke(Black, 1))
.draw(&mut display);

Expand All @@ -134,7 +134,7 @@ mod tests {
let mut display = Display2in13::default();
display.set_rotation(DisplayRotation::Rotate270);

let _ = Line::new(Point::new(479, 0), Point::new(479, 7))
let _ = Line::new(Point::new((HEIGHT - 1) as i32, 0), Point::new((HEIGHT - 1) as i32, 7))
.into_styled(PrimitiveStyle::with_stroke(Black, 1))
.draw(&mut display);

Expand Down

0 comments on commit b51c5fe

Please sign in to comment.