reorganize tests
parent
ff10f3ca53
commit
2d18d295b8
|
@ -1,12 +0,0 @@
|
||||||
use maraiah::{durandal::image::*, marathon::pict::get_clut};
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn get_clut_must_process_this()
|
|
||||||
{
|
|
||||||
assert_eq!(get_clut(INPUT).unwrap(), (OUTPUT.to_vec(), 2056));
|
|
||||||
}
|
|
||||||
|
|
||||||
const INPUT: &'static [u8] = include_bytes!("data/clut.in");
|
|
||||||
const OUTPUT: [Color8; 256] = include!("data/clut.out");
|
|
||||||
|
|
||||||
// EOF
|
|
|
@ -1,14 +0,0 @@
|
||||||
use maraiah::{durandal::{bin, fixed::*},
|
|
||||||
marathon::map};
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn read_epnt_must_process_this()
|
|
||||||
{
|
|
||||||
assert_eq!(bin::rd_array(INPUT, map::read_epnt).unwrap(),
|
|
||||||
OUTPUT.to_vec());
|
|
||||||
}
|
|
||||||
|
|
||||||
const INPUT: &'static [u8] = include_bytes!("data/epnt.in");
|
|
||||||
const OUTPUT: [map::Point; 54] = include!("data/epnt.out");
|
|
||||||
|
|
||||||
// EOF
|
|
|
@ -1,14 +0,0 @@
|
||||||
use maraiah::marathon::machdr::*;
|
|
||||||
|
|
||||||
// TODO: missing test data for applesingle
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn macbin_must_process_this()
|
|
||||||
{
|
|
||||||
assert_eq!(check_macbin(INPUT_MACBIN), Some(128));
|
|
||||||
assert_eq!(try_mac_header(INPUT_MACBIN), 128);
|
|
||||||
}
|
|
||||||
|
|
||||||
const INPUT_MACBIN: &'static [u8] = include_bytes!("data/macbin.in");
|
|
||||||
|
|
||||||
// EOF
|
|
|
@ -0,0 +1,52 @@
|
||||||
|
use maraiah::{durandal::{bin, fixed::*}, marathon::{map, trm}};
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn read_term_must_process()
|
||||||
|
{
|
||||||
|
const INPUT: &[u8] = include_bytes!("data/term.in");
|
||||||
|
|
||||||
|
let inp = bin::rd_array(INPUT, trm::read_term).unwrap();
|
||||||
|
let out = include!("data/term.out");
|
||||||
|
|
||||||
|
// for better debug output, we iterate over each item
|
||||||
|
assert_eq!(inp.len(), out.len());
|
||||||
|
|
||||||
|
for (itrm, otrm) in inp.iter().zip(&out) {
|
||||||
|
assert_eq!(itrm.groups.len(), otrm.groups.len());
|
||||||
|
for (igrp, ogrp) in itrm.groups.iter().zip(&otrm.groups) {
|
||||||
|
assert_eq!(igrp, ogrp);
|
||||||
|
}
|
||||||
|
|
||||||
|
assert_eq!(itrm.faces.len(), otrm.faces.len());
|
||||||
|
for (ifac, ofac) in itrm.faces.iter().zip(&otrm.faces) {
|
||||||
|
assert_eq!(ifac, ofac);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn read_minf_must_process()
|
||||||
|
{
|
||||||
|
const INPUT: &[u8] = include_bytes!("data/minf.in");
|
||||||
|
|
||||||
|
let out = map::Minf{env_code: 0,
|
||||||
|
physi_id: 1,
|
||||||
|
music_id: 1,
|
||||||
|
missi_flags: map::MsnFlags::Repair,
|
||||||
|
envir_flags: map::EnvFlags::empty(),
|
||||||
|
entry_flags: map::EntFlags::Solo | map::EntFlags::CoOp,
|
||||||
|
level_name: "Waterloo Waterpark".to_string()};
|
||||||
|
|
||||||
|
assert_eq!(map::read_minf(INPUT).unwrap(), out);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn read_epnt_must_process()
|
||||||
|
{
|
||||||
|
const INPUT: &[u8] = include_bytes!("data/epnt.in");
|
||||||
|
const OUTPUT: [map::Point; 54] = include!("data/epnt.out");
|
||||||
|
|
||||||
|
assert_eq!(bin::rd_array(INPUT, map::read_epnt).unwrap(), OUTPUT.to_vec());
|
||||||
|
}
|
||||||
|
|
||||||
|
// EOF
|
|
@ -1,18 +0,0 @@
|
||||||
use maraiah::marathon::map;
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn read_minf_must_process_map0()
|
|
||||||
{
|
|
||||||
assert_eq!(map::read_minf(INPUT).unwrap(),
|
|
||||||
map::Minf{env_code: 0,
|
|
||||||
physi_id: 1,
|
|
||||||
music_id: 1,
|
|
||||||
missi_flags: map::MsnFlags::Repair,
|
|
||||||
envir_flags: map::EnvFlags::empty(),
|
|
||||||
entry_flags: map::EntFlags::Solo | map::EntFlags::CoOp,
|
|
||||||
level_name: "Waterloo Waterpark".to_string()});
|
|
||||||
}
|
|
||||||
|
|
||||||
const INPUT: &'static [u8] = include_bytes!("data/minf.in");
|
|
||||||
|
|
||||||
// EOF
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
use maraiah::{durandal::image::Color8, marathon::{machdr, pict}};
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn get_clut_must_process_this()
|
||||||
|
{
|
||||||
|
const INPUT: &[u8] = include_bytes!("data/clut.in");
|
||||||
|
const OUTPUT: [Color8; 256] = include!("data/clut.out");
|
||||||
|
|
||||||
|
assert_eq!(pict::get_clut(INPUT).unwrap(), (OUTPUT.to_vec(), 2056));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn macbin_must_process_this()
|
||||||
|
{
|
||||||
|
const INPUT: &[u8] = include_bytes!("data/macbin.in");
|
||||||
|
|
||||||
|
assert_eq!(machdr::check_macbin(INPUT), Some(128));
|
||||||
|
assert_eq!(machdr::try_mac_header(INPUT), 128);
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: missing test data for applesingle
|
||||||
|
|
||||||
|
// EOF
|
|
@ -1,27 +0,0 @@
|
||||||
use maraiah::{durandal::bin, marathon::trm};
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn read_term_must_process_map0()
|
|
||||||
{
|
|
||||||
let inp = bin::rd_array(INPUT, trm::read_term).unwrap();
|
|
||||||
let out = include!("data/term.out");
|
|
||||||
|
|
||||||
// for better debug output, we iterate over each item
|
|
||||||
assert_eq!(inp.len(), out.len());
|
|
||||||
|
|
||||||
for (itrm, otrm) in inp.iter().zip(&out) {
|
|
||||||
assert_eq!(itrm.groups.len(), otrm.groups.len());
|
|
||||||
for (igrp, ogrp) in itrm.groups.iter().zip(&otrm.groups) {
|
|
||||||
assert_eq!(igrp, ogrp);
|
|
||||||
}
|
|
||||||
|
|
||||||
assert_eq!(itrm.faces.len(), otrm.faces.len());
|
|
||||||
for (ifac, ofac) in itrm.faces.iter().zip(&otrm.faces) {
|
|
||||||
assert_eq!(ifac, ofac);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const INPUT: &'static [u8] = include_bytes!("data/term.in");
|
|
||||||
|
|
||||||
// EOF
|
|
Loading…
Reference in New Issue