Add error reporting to tests

This commit is contained in:
Steve Cook
2023-03-02 00:06:30 -05:00
parent 70b1ef270f
commit d2ab7de5dd
5 changed files with 52 additions and 35 deletions

View File

@@ -28,7 +28,9 @@ use std::rc::Rc;
use image::DynamicImage;
use crate::{common::GlobalHistogramBinarizer, BinaryBitmap, BufferedImageLuminanceSource, Binarizer};
use crate::{
common::GlobalHistogramBinarizer, Binarizer, BinaryBitmap, BufferedImageLuminanceSource,
};
fn getBufferedImage(fileName: &str) -> DynamicImage {
let path = format!("test_resources/blackbox/rssexpandedstacked-2/{fileName}");
@@ -36,7 +38,9 @@ fn getBufferedImage(fileName: &str) -> DynamicImage {
image::open(path).expect("load image")
}
pub(crate) fn getBinaryBitmap(fileName: &str) -> BinaryBitmap<GlobalHistogramBinarizer<BufferedImageLuminanceSource>> {
pub(crate) fn getBinaryBitmap(
fileName: &str,
) -> BinaryBitmap<GlobalHistogramBinarizer<BufferedImageLuminanceSource>> {
let bufferedImage = getBufferedImage(fileName);
BinaryBitmap::new(GlobalHistogramBinarizer::new(