fix tests

gui-branch
an 2019-04-01 08:29:51 -04:00
parent 67426eea3b
commit d5d91c1134
10 changed files with 649 additions and 228 deletions

View File

@ -28,14 +28,14 @@ pub fn to_pnts(v: &Vec<Endpoint>) -> Vec<pnts::Point>
/// A pre-processed point in world-space.
#[cfg_attr(feature = "serde_obj", derive(serde::Serialize))]
#[derive(Debug, Eq, PartialEq)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct Endpoint
{
flags: EndpointFlags,
hei_hi: Unit,
hei_lo: Unit,
pos: pnts::Point,
support: u16,
pub flags: EndpointFlags,
pub hei_hi: Unit,
pub hei_lo: Unit,
pub pos: pnts::Point,
pub support: u16,
}
bitflags! {

View File

@ -1,56 +0,0 @@
[
map::Point{x: Unit::from_bits(5120), y: Unit::from_bits(4096)},
map::Point{x: Unit::from_bits(6144), y: Unit::from_bits(4096)},
map::Point{x: Unit::from_bits(7168), y: Unit::from_bits(5120)},
map::Point{x: Unit::from_bits(7168), y: Unit::from_bits(6144)},
map::Point{x: Unit::from_bits(6144), y: Unit::from_bits(7168)},
map::Point{x: Unit::from_bits(5120), y: Unit::from_bits(7168)},
map::Point{x: Unit::from_bits(4096), y: Unit::from_bits(6144)},
map::Point{x: Unit::from_bits(4096), y: Unit::from_bits(5120)},
map::Point{x: Unit::from_bits(4608), y: Unit::from_bits(3072)},
map::Point{x: Unit::from_bits(3072), y: Unit::from_bits(4608)},
map::Point{x: Unit::from_bits(6656), y: Unit::from_bits(3072)},
map::Point{x: Unit::from_bits(8192), y: Unit::from_bits(4608)},
map::Point{x: Unit::from_bits(8192), y: Unit::from_bits(6656)},
map::Point{x: Unit::from_bits(6656), y: Unit::from_bits(8192)},
map::Point{x: Unit::from_bits(4608), y: Unit::from_bits(8192)},
map::Point{x: Unit::from_bits(3072), y: Unit::from_bits(6656)},
map::Point{x: Unit::from_bits(1536), y: Unit::from_bits(13312)},
map::Point{x: Unit::from_bits(9728), y: Unit::from_bits(13312)},
map::Point{x: Unit::from_bits(1536), y: Unit::from_bits(63488)},
map::Point{x: Unit::from_bits(9728), y: Unit::from_bits(63488)},
map::Point{x: Unit::from_bits(13312), y: Unit::from_bits(1536)},
map::Point{x: Unit::from_bits(13312), y: Unit::from_bits(9728)},
map::Point{x: Unit::from_bits(63488), y: Unit::from_bits(1536)},
map::Point{x: Unit::from_bits(63488), y: Unit::from_bits(9728)},
map::Point{x: Unit::from_bits(5120), y: Unit::from_bits(13312)},
map::Point{x: Unit::from_bits(5120), y: Unit::from_bits(14336)},
map::Point{x: Unit::from_bits(6144), y: Unit::from_bits(13312)},
map::Point{x: Unit::from_bits(6144), y: Unit::from_bits(14336)},
map::Point{x: Unit::from_bits(5120), y: Unit::from_bits(63488)},
map::Point{x: Unit::from_bits(5120), y: Unit::from_bits(62464)},
map::Point{x: Unit::from_bits(4096), y: Unit::from_bits(62464)},
map::Point{x: Unit::from_bits(4096), y: Unit::from_bits(61440)},
map::Point{x: Unit::from_bits(7168), y: Unit::from_bits(61440)},
map::Point{x: Unit::from_bits(7168), y: Unit::from_bits(62464)},
map::Point{x: Unit::from_bits(6144), y: Unit::from_bits(62464)},
map::Point{x: Unit::from_bits(6144), y: Unit::from_bits(63488)},
map::Point{x: Unit::from_bits(13312), y: Unit::from_bits(5120)},
map::Point{x: Unit::from_bits(14336), y: Unit::from_bits(5120)},
map::Point{x: Unit::from_bits(14336), y: Unit::from_bits(6144)},
map::Point{x: Unit::from_bits(13312), y: Unit::from_bits(6144)},
map::Point{x: Unit::from_bits(63488), y: Unit::from_bits(5120)},
map::Point{x: Unit::from_bits(62464), y: Unit::from_bits(5120)},
map::Point{x: Unit::from_bits(62464), y: Unit::from_bits(4096)},
map::Point{x: Unit::from_bits(61440), y: Unit::from_bits(4096)},
map::Point{x: Unit::from_bits(61440), y: Unit::from_bits(7168)},
map::Point{x: Unit::from_bits(62464), y: Unit::from_bits(7168)},
map::Point{x: Unit::from_bits(62464), y: Unit::from_bits(6144)},
map::Point{x: Unit::from_bits(63488), y: Unit::from_bits(6144)},
map::Point{x: Unit::from_bits(61440), y: Unit::from_bits(7680)},
map::Point{x: Unit::from_bits(62464), y: Unit::from_bits(7680)},
map::Point{x: Unit::from_bits(62464), y: Unit::from_bits(13312)},
map::Point{x: Unit::from_bits(61440), y: Unit::from_bits(8704)},
map::Point{x: Unit::from_bits(57344), y: Unit::from_bits(8704)},
map::Point{x: Unit::from_bits(57344), y: Unit::from_bits(13312)}
]

56
tests/data/map/epnt.out.1 Normal file
View File

@ -0,0 +1,56 @@
[
map::pnts::Point{x: Unit::from_bits(5120), y: Unit::from_bits(4096)},
map::pnts::Point{x: Unit::from_bits(6144), y: Unit::from_bits(4096)},
map::pnts::Point{x: Unit::from_bits(7168), y: Unit::from_bits(5120)},
map::pnts::Point{x: Unit::from_bits(7168), y: Unit::from_bits(6144)},
map::pnts::Point{x: Unit::from_bits(6144), y: Unit::from_bits(7168)},
map::pnts::Point{x: Unit::from_bits(5120), y: Unit::from_bits(7168)},
map::pnts::Point{x: Unit::from_bits(4096), y: Unit::from_bits(6144)},
map::pnts::Point{x: Unit::from_bits(4096), y: Unit::from_bits(5120)},
map::pnts::Point{x: Unit::from_bits(4608), y: Unit::from_bits(3072)},
map::pnts::Point{x: Unit::from_bits(3072), y: Unit::from_bits(4608)},
map::pnts::Point{x: Unit::from_bits(6656), y: Unit::from_bits(3072)},
map::pnts::Point{x: Unit::from_bits(8192), y: Unit::from_bits(4608)},
map::pnts::Point{x: Unit::from_bits(8192), y: Unit::from_bits(6656)},
map::pnts::Point{x: Unit::from_bits(6656), y: Unit::from_bits(8192)},
map::pnts::Point{x: Unit::from_bits(4608), y: Unit::from_bits(8192)},
map::pnts::Point{x: Unit::from_bits(3072), y: Unit::from_bits(6656)},
map::pnts::Point{x: Unit::from_bits(1536), y: Unit::from_bits(13312)},
map::pnts::Point{x: Unit::from_bits(9728), y: Unit::from_bits(13312)},
map::pnts::Point{x: Unit::from_bits(1536), y: Unit::from_bits(63488)},
map::pnts::Point{x: Unit::from_bits(9728), y: Unit::from_bits(63488)},
map::pnts::Point{x: Unit::from_bits(13312), y: Unit::from_bits(1536)},
map::pnts::Point{x: Unit::from_bits(13312), y: Unit::from_bits(9728)},
map::pnts::Point{x: Unit::from_bits(63488), y: Unit::from_bits(1536)},
map::pnts::Point{x: Unit::from_bits(63488), y: Unit::from_bits(9728)},
map::pnts::Point{x: Unit::from_bits(5120), y: Unit::from_bits(13312)},
map::pnts::Point{x: Unit::from_bits(5120), y: Unit::from_bits(14336)},
map::pnts::Point{x: Unit::from_bits(6144), y: Unit::from_bits(13312)},
map::pnts::Point{x: Unit::from_bits(6144), y: Unit::from_bits(14336)},
map::pnts::Point{x: Unit::from_bits(5120), y: Unit::from_bits(63488)},
map::pnts::Point{x: Unit::from_bits(5120), y: Unit::from_bits(62464)},
map::pnts::Point{x: Unit::from_bits(4096), y: Unit::from_bits(62464)},
map::pnts::Point{x: Unit::from_bits(4096), y: Unit::from_bits(61440)},
map::pnts::Point{x: Unit::from_bits(7168), y: Unit::from_bits(61440)},
map::pnts::Point{x: Unit::from_bits(7168), y: Unit::from_bits(62464)},
map::pnts::Point{x: Unit::from_bits(6144), y: Unit::from_bits(62464)},
map::pnts::Point{x: Unit::from_bits(6144), y: Unit::from_bits(63488)},
map::pnts::Point{x: Unit::from_bits(13312), y: Unit::from_bits(5120)},
map::pnts::Point{x: Unit::from_bits(14336), y: Unit::from_bits(5120)},
map::pnts::Point{x: Unit::from_bits(14336), y: Unit::from_bits(6144)},
map::pnts::Point{x: Unit::from_bits(13312), y: Unit::from_bits(6144)},
map::pnts::Point{x: Unit::from_bits(63488), y: Unit::from_bits(5120)},
map::pnts::Point{x: Unit::from_bits(62464), y: Unit::from_bits(5120)},
map::pnts::Point{x: Unit::from_bits(62464), y: Unit::from_bits(4096)},
map::pnts::Point{x: Unit::from_bits(61440), y: Unit::from_bits(4096)},
map::pnts::Point{x: Unit::from_bits(61440), y: Unit::from_bits(7168)},
map::pnts::Point{x: Unit::from_bits(62464), y: Unit::from_bits(7168)},
map::pnts::Point{x: Unit::from_bits(62464), y: Unit::from_bits(6144)},
map::pnts::Point{x: Unit::from_bits(63488), y: Unit::from_bits(6144)},
map::pnts::Point{x: Unit::from_bits(61440), y: Unit::from_bits(7680)},
map::pnts::Point{x: Unit::from_bits(62464), y: Unit::from_bits(7680)},
map::pnts::Point{x: Unit::from_bits(62464), y: Unit::from_bits(13312)},
map::pnts::Point{x: Unit::from_bits(61440), y: Unit::from_bits(8704)},
map::pnts::Point{x: Unit::from_bits(57344), y: Unit::from_bits(8704)},
map::pnts::Point{x: Unit::from_bits(57344), y: Unit::from_bits(13312)}
]

434
tests/data/map/epnt.out.2 Normal file
View File

@ -0,0 +1,434 @@
[
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SAME_HEIGHT |
map::epnt::EndpointFlags::TRANSPARENT,
hei_hi: Unit::from_bits(0),
hei_lo: Unit::from_bits(9216),
pos: map::pnts::Point{x: Unit::from_bits(5120), y: Unit::from_bits(4096)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SAME_HEIGHT |
map::epnt::EndpointFlags::TRANSPARENT,
hei_hi: Unit::from_bits(0),
hei_lo: Unit::from_bits(9216),
pos: map::pnts::Point{x: Unit::from_bits(6144), y: Unit::from_bits(4096)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SAME_HEIGHT |
map::epnt::EndpointFlags::TRANSPARENT,
hei_hi: Unit::from_bits(0),
hei_lo: Unit::from_bits(9216),
pos: map::pnts::Point{x: Unit::from_bits(7168), y: Unit::from_bits(5120)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SAME_HEIGHT |
map::epnt::EndpointFlags::TRANSPARENT,
hei_hi: Unit::from_bits(0),
hei_lo: Unit::from_bits(9216),
pos: map::pnts::Point{x: Unit::from_bits(7168), y: Unit::from_bits(6144)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SAME_HEIGHT |
map::epnt::EndpointFlags::TRANSPARENT,
hei_hi: Unit::from_bits(0),
hei_lo: Unit::from_bits(9216),
pos: map::pnts::Point{x: Unit::from_bits(6144), y: Unit::from_bits(7168)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SAME_HEIGHT |
map::epnt::EndpointFlags::TRANSPARENT,
hei_hi: Unit::from_bits(0),
hei_lo: Unit::from_bits(9216),
pos: map::pnts::Point{x: Unit::from_bits(5120), y: Unit::from_bits(7168)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SAME_HEIGHT |
map::epnt::EndpointFlags::TRANSPARENT,
hei_hi: Unit::from_bits(0),
hei_lo: Unit::from_bits(9216),
pos: map::pnts::Point{x: Unit::from_bits(4096), y: Unit::from_bits(6144)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SAME_HEIGHT |
map::epnt::EndpointFlags::TRANSPARENT,
hei_hi: Unit::from_bits(0),
hei_lo: Unit::from_bits(9216),
pos: map::pnts::Point{x: Unit::from_bits(4096), y: Unit::from_bits(5120)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SAME_HEIGHT |
map::epnt::EndpointFlags::TRANSPARENT,
hei_hi: Unit::from_bits(0),
hei_lo: Unit::from_bits(9216),
pos: map::pnts::Point{x: Unit::from_bits(4608), y: Unit::from_bits(3072)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SAME_HEIGHT |
map::epnt::EndpointFlags::TRANSPARENT,
hei_hi: Unit::from_bits(0),
hei_lo: Unit::from_bits(9216),
pos: map::pnts::Point{x: Unit::from_bits(3072), y: Unit::from_bits(4608)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SAME_HEIGHT |
map::epnt::EndpointFlags::TRANSPARENT,
hei_hi: Unit::from_bits(0),
hei_lo: Unit::from_bits(9216),
pos: map::pnts::Point{x: Unit::from_bits(6656), y: Unit::from_bits(3072)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SAME_HEIGHT |
map::epnt::EndpointFlags::TRANSPARENT,
hei_hi: Unit::from_bits(0),
hei_lo: Unit::from_bits(9216),
pos: map::pnts::Point{x: Unit::from_bits(8192), y: Unit::from_bits(4608)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SAME_HEIGHT |
map::epnt::EndpointFlags::TRANSPARENT,
hei_hi: Unit::from_bits(0),
hei_lo: Unit::from_bits(9216),
pos: map::pnts::Point{x: Unit::from_bits(8192), y: Unit::from_bits(6656)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SAME_HEIGHT |
map::epnt::EndpointFlags::TRANSPARENT,
hei_hi: Unit::from_bits(0),
hei_lo: Unit::from_bits(9216),
pos: map::pnts::Point{x: Unit::from_bits(6656), y: Unit::from_bits(8192)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SAME_HEIGHT |
map::epnt::EndpointFlags::TRANSPARENT,
hei_hi: Unit::from_bits(0),
hei_lo: Unit::from_bits(9216),
pos: map::pnts::Point{x: Unit::from_bits(4608), y: Unit::from_bits(8192)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SAME_HEIGHT |
map::epnt::EndpointFlags::TRANSPARENT,
hei_hi: Unit::from_bits(0),
hei_lo: Unit::from_bits(9216),
pos: map::pnts::Point{x: Unit::from_bits(3072), y: Unit::from_bits(6656)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: -Unit::from_bits(9216),
hei_lo: Unit::from_bits(9216),
pos: map::pnts::Point{x: Unit::from_bits(1536), y: Unit::from_bits(13312)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: -Unit::from_bits(9216),
hei_lo: Unit::from_bits(9216),
pos: map::pnts::Point{x: Unit::from_bits(9728), y: Unit::from_bits(13312)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: -Unit::from_bits(9216),
hei_lo: Unit::from_bits(9216),
pos: map::pnts::Point{x: Unit::from_bits(1536), y: -Unit::from_bits(2048)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: -Unit::from_bits(9216),
hei_lo: Unit::from_bits(9216),
pos: map::pnts::Point{x: Unit::from_bits(9728), y: -Unit::from_bits(2048)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: -Unit::from_bits(9216),
hei_lo: Unit::from_bits(9216),
pos: map::pnts::Point{x: Unit::from_bits(13312), y: Unit::from_bits(1536)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: -Unit::from_bits(9216),
hei_lo: Unit::from_bits(9216),
pos: map::pnts::Point{x: Unit::from_bits(13312), y: Unit::from_bits(9728)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: -Unit::from_bits(9216),
hei_lo: Unit::from_bits(9216),
pos: map::pnts::Point{x: -Unit::from_bits(2048), y: Unit::from_bits(1536)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: -Unit::from_bits(9216),
hei_lo: Unit::from_bits(9216),
pos: map::pnts::Point{x: -Unit::from_bits(2048), y: Unit::from_bits(9728)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: -Unit::from_bits(9216),
hei_lo: -Unit::from_bits(8192),
pos: map::pnts::Point{x: Unit::from_bits(5120), y: Unit::from_bits(13312)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: -Unit::from_bits(9216),
hei_lo: -Unit::from_bits(8192),
pos: map::pnts::Point{x: Unit::from_bits(5120), y: Unit::from_bits(14336)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: -Unit::from_bits(9216),
hei_lo: -Unit::from_bits(8192),
pos: map::pnts::Point{x: Unit::from_bits(6144), y: Unit::from_bits(13312)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: -Unit::from_bits(9216),
hei_lo: -Unit::from_bits(8192),
pos: map::pnts::Point{x: Unit::from_bits(6144), y: Unit::from_bits(14336)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: Unit::from_bits(1024),
hei_lo: Unit::from_bits(2047),
pos: map::pnts::Point{x: Unit::from_bits(5120), y: -Unit::from_bits(2048)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: Unit::from_bits(1024),
hei_lo: Unit::from_bits(2047),
pos: map::pnts::Point{x: Unit::from_bits(5120), y: -Unit::from_bits(3072)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: Unit::from_bits(1024),
hei_lo: Unit::from_bits(2047),
pos: map::pnts::Point{x: Unit::from_bits(4096), y: -Unit::from_bits(3072)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: Unit::from_bits(1024),
hei_lo: Unit::from_bits(2047),
pos: map::pnts::Point{x: Unit::from_bits(4096), y: -Unit::from_bits(4096)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: Unit::from_bits(1024),
hei_lo: Unit::from_bits(2047),
pos: map::pnts::Point{x: Unit::from_bits(7168), y: -Unit::from_bits(4096)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: Unit::from_bits(1024),
hei_lo: Unit::from_bits(2047),
pos: map::pnts::Point{x: Unit::from_bits(7168), y: -Unit::from_bits(3072)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: Unit::from_bits(1024),
hei_lo: Unit::from_bits(2047),
pos: map::pnts::Point{x: Unit::from_bits(6144), y: -Unit::from_bits(3072)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: Unit::from_bits(1024),
hei_lo: Unit::from_bits(2047),
pos: map::pnts::Point{x: Unit::from_bits(6144), y: -Unit::from_bits(2048)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: -Unit::from_bits(9216),
hei_lo: -Unit::from_bits(8192),
pos: map::pnts::Point{x: Unit::from_bits(13312), y: Unit::from_bits(5120)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: -Unit::from_bits(9216),
hei_lo: -Unit::from_bits(8192),
pos: map::pnts::Point{x: Unit::from_bits(14336), y: Unit::from_bits(5120)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: -Unit::from_bits(9216),
hei_lo: -Unit::from_bits(8192),
pos: map::pnts::Point{x: Unit::from_bits(14336), y: Unit::from_bits(6144)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: -Unit::from_bits(9216),
hei_lo: -Unit::from_bits(8192),
pos: map::pnts::Point{x: Unit::from_bits(13312), y: Unit::from_bits(6144)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: Unit::from_bits(1024),
hei_lo: Unit::from_bits(2047),
pos: map::pnts::Point{x: -Unit::from_bits(2048), y: Unit::from_bits(5120)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: Unit::from_bits(1024),
hei_lo: Unit::from_bits(2047),
pos: map::pnts::Point{x: -Unit::from_bits(3072), y: Unit::from_bits(5120)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: Unit::from_bits(1024),
hei_lo: Unit::from_bits(2047),
pos: map::pnts::Point{x: -Unit::from_bits(3072), y: Unit::from_bits(4096)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: Unit::from_bits(1024),
hei_lo: Unit::from_bits(2047),
pos: map::pnts::Point{x: -Unit::from_bits(4096), y: Unit::from_bits(4096)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: Unit::from_bits(1024),
hei_lo: Unit::from_bits(1024),
pos: map::pnts::Point{x: -Unit::from_bits(4096), y: Unit::from_bits(7168)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: Unit::from_bits(1024),
hei_lo: Unit::from_bits(1024),
pos: map::pnts::Point{x: -Unit::from_bits(3072), y: Unit::from_bits(7168)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: Unit::from_bits(1024),
hei_lo: Unit::from_bits(2047),
pos: map::pnts::Point{x: -Unit::from_bits(3072), y: Unit::from_bits(6144)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: Unit::from_bits(1024),
hei_lo: Unit::from_bits(2047),
pos: map::pnts::Point{x: -Unit::from_bits(2048), y: Unit::from_bits(6144)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: Unit::from_bits(1024),
hei_lo: Unit::from_bits(1024),
pos: map::pnts::Point{x: -Unit::from_bits(4096), y: Unit::from_bits(7680)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: Unit::from_bits(1024),
hei_lo: Unit::from_bits(1024),
pos: map::pnts::Point{x: -Unit::from_bits(3072), y: Unit::from_bits(7680)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: Unit::from_bits(1024),
hei_lo: Unit::from_bits(2047),
pos: map::pnts::Point{x: -Unit::from_bits(3072), y: Unit::from_bits(13312)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: Unit::from_bits(1024),
hei_lo: Unit::from_bits(2047),
pos: map::pnts::Point{x: -Unit::from_bits(4096), y: Unit::from_bits(8704)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: Unit::from_bits(1024),
hei_lo: Unit::from_bits(2047),
pos: map::pnts::Point{x: -Unit::from_bits(8192), y: Unit::from_bits(8704)},
support: 0
},
map::epnt::Endpoint{
flags: map::epnt::EndpointFlags::SOLID |
map::epnt::EndpointFlags::SAME_HEIGHT,
hei_hi: Unit::from_bits(1024),
hei_lo: Unit::from_bits(2047),
pos: map::pnts::Point{x: -Unit::from_bits(8192), y: Unit::from_bits(13312)},
support: 0
},
]

9
tests/data/map/minf.out Normal file
View File

@ -0,0 +1,9 @@
map::minf::Minf{
texture_id: 0,
physics_id: 1,
skypict_id: 1,
miss_flags: map::minf::MsnFlags::REPAIR,
envi_flags: map::minf::EnvFlags::empty(),
entr_flags: map::minf::EntFlags::SOLO | map::minf::EntFlags::CO_OP,
level_name: "Waterloo Waterpark".to_owned()
}

View File

@ -1,144 +1,144 @@
vec![
trm::Terminal {
map::term::Terminal {
lines: 22,
groups: vec![
trm::Group {
flags: trm::GroupFlags::empty(),
ttype: trm::GroupType::Unfinished,
map::trmg::Group {
flags: map::trmg::GroupFlags::empty(),
ttype: map::trmg::GroupType::Unfinished,
lines: 0,
text: "".to_string()
text: "".to_owned()
},
trm::Group {
flags: trm::GroupFlags::empty(),
ttype: trm::GroupType::Logon(1600),
map::trmg::Group {
flags: map::trmg::GroupFlags::empty(),
ttype: map::trmg::GroupType::Logon(1600),
lines: 1,
text: "\n".to_string()
text: "\n".to_owned()
},
trm::Group {
flags: trm::GroupFlags::empty(),
ttype: trm::GroupType::Pict(10011),
map::trmg::Group {
flags: map::trmg::GroupFlags::empty(),
ttype: map::trmg::GroupType::Pict(10011),
lines: 22,
text: "~text interface terminal malfunction error ~2992dud\n\nThings have gone terribly awry. Until now, I thought myself immortal, but now I know that is not true. There are things that can destroy me with the ease that I slaughtered the Pfhor naval garrison and the Western Arm of their Battle Group Seven. But in their final gasp they used a weapon that I thought they had retired, even Tycho tried to keep them from using it.\n\nNow I fear what that weapon has unleashed will destroy us. I once boasted to be able to count the atoms in a cloud, to understand them all, predict them, and so did I predict you, but this new chaos is entirely terrible, mindless, obeying rules that I don\'t comprehend. And it is hungry.\n\n".to_string()
text: "~text interface terminal malfunction error ~2992dud\n\nThings have gone terribly awry. Until now, I thought myself immortal, but now I know that is not true. There are things that can destroy me with the ease that I slaughtered the Pfhor naval garrison and the Western Arm of their Battle Group Seven. But in their final gasp they used a weapon that I thought they had retired, even Tycho tried to keep them from using it.\n\nNow I fear what that weapon has unleashed will destroy us. I once boasted to be able to count the atoms in a cloud, to understand them all, predict them, and so did I predict you, but this new chaos is entirely terrible, mindless, obeying rules that I don\'t comprehend. And it is hungry.\n\n".to_owned()
},
trm::Group {
flags: trm::GroupFlags::empty(),
ttype: trm::GroupType::Pict(10005),
map::trmg::Group {
flags: map::trmg::GroupFlags::empty(),
ttype: map::trmg::GroupType::Pict(10005),
lines: 21,
text: "~text interface terminal malfunction error ~2992dud\n\nIt\'s too bad, perhaps if I could have delayed the Pfhor from using their weapon, I could have sent you to explore the ruins of Lh\'owon, perhaps what you found would give us the answers that we now need so desparately: how to stop this chaos, the purpose of the station on which you\'re currently standing, and why the chaos hasn\'t come here yet.\n\nBut with each moment the chaos grows, I am doomed to die here, after so many triumphs. I have detected one ship nearby, which I can only guess is being commanded by Tycho. The Pfhor have entered the station, and if you can find a way onto their ship, you may be able to escape. To escape. To escape.\n\n".to_string()
text: "~text interface terminal malfunction error ~2992dud\n\nIt\'s too bad, perhaps if I could have delayed the Pfhor from using their weapon, I could have sent you to explore the ruins of Lh\'owon, perhaps what you found would give us the answers that we now need so desparately: how to stop this chaos, the purpose of the station on which you\'re currently standing, and why the chaos hasn\'t come here yet.\n\nBut with each moment the chaos grows, I am doomed to die here, after so many triumphs. I have detected one ship nearby, which I can only guess is being commanded by Tycho. The Pfhor have entered the station, and if you can find a way onto their ship, you may be able to escape. To escape. To escape.\n\n".to_owned()
},
trm::Group {
flags: trm::GroupFlags::empty(),
ttype: trm::GroupType::Pict(10006),
map::trmg::Group {
flags: map::trmg::GroupFlags::empty(),
ttype: map::trmg::GroupType::Pict(10006),
lines: 21,
text: "~text interface terminal malfunction error ~2992dud\n\nIt\'s too bad, perhaps if I could have delayed the Pfhor from using their weapon, I could have sent you to explore the ruins of Lh\'owon, perhaps what you found would give us the answers that we now need so desparately: how to stop this chaos, the purpose of the station on which you\'re currently standing, and why the chaos hasn\'t come here yet.\n\nBut with each moment the chaos grows, I am doomed to die here, after so many triumphs. I have detected one ship nearby, which I can only guess is being commanded by Tycho. The Pfhor have entered the station, and if you can find a way onto their ship, you may be able to escape. To escape. To escape.\n\n".to_string()
text: "~text interface terminal malfunction error ~2992dud\n\nIt\'s too bad, perhaps if I could have delayed the Pfhor from using their weapon, I could have sent you to explore the ruins of Lh\'owon, perhaps what you found would give us the answers that we now need so desparately: how to stop this chaos, the purpose of the station on which you\'re currently standing, and why the chaos hasn\'t come here yet.\n\nBut with each moment the chaos grows, I am doomed to die here, after so many triumphs. I have detected one ship nearby, which I can only guess is being commanded by Tycho. The Pfhor have entered the station, and if you can find a way onto their ship, you may be able to escape. To escape. To escape.\n\n".to_owned()
},
trm::Group {
flags: trm::GroupFlags::empty(),
ttype: trm::GroupType::Logoff(1600),
map::trmg::Group {
flags: map::trmg::GroupFlags::empty(),
ttype: map::trmg::GroupType::Logoff(1600),
lines: 1,
text: "\n".to_string()
text: "\n".to_owned()
}
],
faces: vec![]
},
trm::Terminal {
map::term::Terminal {
lines: 22,
groups: vec![
trm::Group {
flags: trm::GroupFlags::empty(),
ttype: trm::GroupType::Unfinished,
map::trmg::Group {
flags: map::trmg::GroupFlags::empty(),
ttype: map::trmg::GroupType::Unfinished,
lines: 0,
text: "".to_string()
text: "".to_owned()
},
trm::Group {
flags: trm::GroupFlags::empty(),
ttype: trm::GroupType::Logon(1610),
map::trmg::Group {
flags: map::trmg::GroupFlags::empty(),
ttype: map::trmg::GroupType::Logon(1610),
lines: 1,
text: "\n".to_string()
text: "\n".to_owned()
},
trm::Group {
flags: trm::GroupFlags::empty(),
ttype: trm::GroupType::Pict(10008),
map::trmg::Group {
flags: map::trmg::GroupFlags::empty(),
ttype: map::trmg::GroupType::Pict(10008),
lines: 14,
text: "\n\n\nspurious interrupt\nunauthorized access\ninformation contained\n\n<header>\ninformation retrieval aspect 30-f\n<body>\n~eibat weapo` 3941\nsiklicar 21`perie1ces\nclwaa\n\n".to_string()
text: "\n\n\nspurious interrupt\nunauthorized access\ninformation contained\n\n<header>\ninformation retrieval aspect 30-f\n<body>\n~eibat weapo` 3941\nsiklicar 21`perie1ces\nclwaa\n\n".to_owned()
},
trm::Group {
flags: trm::GroupFlags::empty(),
ttype: trm::GroupType::Logoff(1610),
map::trmg::Group {
flags: map::trmg::GroupFlags::empty(),
ttype: map::trmg::GroupType::Logoff(1610),
lines: 1,
text: "\n".to_string()
text: "\n".to_owned()
}
],
faces: vec![]
},
trm::Terminal {
map::term::Terminal {
lines: 22,
groups: vec![
trm::Group {
flags: trm::GroupFlags::empty(),
ttype: trm::GroupType::Unfinished,
map::trmg::Group {
flags: map::trmg::GroupFlags::empty(),
ttype: map::trmg::GroupType::Unfinished,
lines: 0,
text: "".to_string()
text: "".to_owned()
},
trm::Group {
flags: trm::GroupFlags::empty(),
ttype: trm::GroupType::Logon(1619),
map::trmg::Group {
flags: map::trmg::GroupFlags::empty(),
ttype: map::trmg::GroupType::Logon(1619),
lines: 1,
text: "".to_string()
text: "".to_owned()
},
trm::Group {
flags: trm::GroupFlags::empty(),
ttype: trm::GroupType::Pict(10007),
map::trmg::Group {
flags: map::trmg::GroupFlags::empty(),
ttype: map::trmg::GroupType::Pict(10007),
lines: 16,
text: "\n\n\nthousands are sailing\nthe same self\t\tthe only self\n\nself willed the peril of a thousand fates\n\na line of infinite ends\t\tfinite finishing\nthe one remains oblique and pure\n\narching to the single point of consciousness\n\nfind yourself\nstarting back\n".to_string()
text: "\n\n\nthousands are sailing\nthe same self\t\tthe only self\n\nself willed the peril of a thousand fates\n\na line of infinite ends\t\tfinite finishing\nthe one remains oblique and pure\n\narching to the single point of consciousness\n\nfind yourself\nstarting back\n".to_owned()
},
trm::Group {
flags: trm::GroupFlags::empty(),
ttype: trm::GroupType::Logoff(1619),
map::trmg::Group {
flags: map::trmg::GroupFlags::empty(),
ttype: map::trmg::GroupType::Logoff(1619),
lines: 1,
text: "".to_string()
text: "".to_owned()
},
trm::Group {
flags: trm::GroupFlags::empty(),
ttype: trm::GroupType::TeleInter(1),
map::trmg::Group {
flags: map::trmg::GroupFlags::empty(),
ttype: map::trmg::GroupType::TeleInter(1),
lines: 1,
text: "".to_string()
text: "".to_owned()
}
],
faces: vec![
trm::Face {
map::trmf::Face {
start: 6,
face: 0,
color: 1
}
]
},
trm::Terminal {
map::term::Terminal {
lines: 22,
groups: vec![
trm::Group {
flags: trm::GroupFlags::empty(),
ttype: trm::GroupType::Unfinished,
map::trmg::Group {
flags: map::trmg::GroupFlags::empty(),
ttype: map::trmg::GroupType::Unfinished,
lines: 0,
text: "".to_string()
text: "".to_owned()
},
trm::Group {
flags: trm::GroupFlags::empty(),
ttype: trm::GroupType::Logon(1619),
map::trmg::Group {
flags: map::trmg::GroupFlags::empty(),
ttype: map::trmg::GroupType::Logon(1619),
lines: 1,
text: "".to_string()
text: "".to_owned()
},
trm::Group {
flags: trm::GroupFlags::empty(),
ttype: trm::GroupType::Pict(10007),
map::trmg::Group {
flags: map::trmg::GroupFlags::empty(),
ttype: map::trmg::GroupType::Pict(10007),
lines: 84,
text: "534954210001000034EE724C6175020000000016\n000000001E48617473204F666620746F20456967\n6874204E696E657465656E2E736974946AAA0000\n0000000000000000000000000000000000000000\n00000000FFFFFFFF53495444534954210100AE1A\nCAD4AE1ACAD40000000000003468000000000000\n34680000CAF90000000000004A21534954210001\n00003468724C617502000000001600000D0D1A48\n617473204F666620746F204569676874204E696E\n657465656E0001537E94897D0000000000000000\n000000000000000000000000000000000000FFFF\nFFFF7363653232362EB00100AE1AA710AE1ACAC4\n0000087A0000738C0000057100002E7177DCF747\n000000000000EFB60B005D796C65E775CA8EB023\n47B984114E5646B8114E5847B8E498849F479E93\nE347FBB5EC08CB8F30B24A23C7098B3CCBC31B2D\nC2093D4EB81EDE2897F09530326087377E86279C\n3C7BF192A31CCFC988BFD7D993A747669C1C2313\n4638E164CA927072FC24CF8F1CA79EFC0566A33C\n2F3D0302A02F3BC28D3C2748648403AF029F2380\n95318331965FC5D8227C99FD62F78617DE1918ED\n6EC311B368530FEB69375AA82C5BBDE3E0F0D1E2\n5ECE8BC343C5DE23CEC07071CF91417BD8B60737\n984CFF8E1EB2BBBB376DF816BA3E622FCFCBF867\nBE5EFD7981B1A3A7A0FA3DAD4BF36516D4BEC4DA\nD8BC5A8D6A79F00A6B79A051D916AA871D7F88CA\nB550178D9602E760B7F656A37A1EA1CC05D4968B\nFA92BD9CBD3C775FCD6EB0E566B38335535C772C\n7C5B483D065BF2E01E1DF71E61F53CE46C03D782\n7D0BD3B7FB1B6CCB186BCE0D33B66EBD7061EB56\n6676754D4E7675B14CA170FD7AA1A0592727B52D\n8C9D3E8D1DC61E3BA6DD626CDF3E1D55C6D6AFC7\nBE9831B031B6249F1F1FC7A53D9FBF74097BC7DA\nB5E3E31B37B2A55D5DE3E36082E207D3F26A6E5F\n7785162791F485EF70EEA6BC5D702E70EAAF5A9C\nD7852983F8477AFE2AAD4824485C7000FBAE552A\nF5F6F6CFF2BCE3F2332072DC599E8A8CE74BF50B\n6DFE8DCC64CC4F85E13A759E87206765BF55DADD\nE086CB1B22C7CFF4734780516B7D63A565F5BEEE\nC9F857DA3C45AB7C40AC534F5B1677B8F0A4544A\nCAC86BA8BB6424718366556724DCF727AC7269DB\n9A0B57AF5E11DEEFF4DC1F944D7CB75CEA4D4BF9\n4FAC7E47F3C63F532101BBEF9E7FEBFC9713BB4A\n80C5093D798D96D4606319167881FA9E96A8C817\nE270A9F48113FE454FDCA045896F5B5C48F51DE5\n93C83F6B95B78BF03AADBC05915120643C818374\nB917DCA4A5B7B42D5FC16E15DFA2A76628839400\n6746524E53A62665FCC3DC1A4E5353B1B84EEBC0\n51B3ACBE9B9419EEB7635CA7AC72052453963508\n12C1BC3A59292D4BA4904122EC3EA29AF0827BD4\n069B284A258B53481076384B591548DF8B6F6A43\n8413C4B78981A02326AA0A518107C20B536A438E\n02901E32404F2912149CDC1F92CEB3C4AAE2FB64\nAA44A594F347A9CA4F860D3482F48240A9C80BEE\n5247E272217C8E8C925233C492BA326A32A54EE4\n0BCD61EF97440B1A77995507C664AAC2818C5C22\n83D0E7FBEF50CE75C22A17C09830AC8E8008EF1E\n99AE13DCD7668AF00EA2E387C10CE5A41825DF1B\nADD336734CC4B364F8DE0C3543D3771DE8483CAF\nE679506A26521BE78B789A0C11CE472F441EE3DA\n3465234908629D4A06C9FBD494334801B232709B\nB2BE47910F01C6949AA5B6314A22A450ABD1C954\n3AC74604658BC67C71B2A21444EC324F5AA3B364\n9E295590B9B1FEC191F2765871B6B473AA54AEC0\n8A2A4768D9899433F860564B7D9052E5BC729BCC\nDAE13E6839B3DDB62B2E1FA8D3818E1AAA432176\n2AB2079087D5480252C703A2041F643751A2DC1F\nD6ECDE4A83323E0A2745E452758F3223659D1778\n3EFA37B52591EB8EDEA7BCF47C118E090FED78D0\nA4C44F79DEE64E00FF7D81B60852CAD704BA5404\n88BFC8A0BE3D585673454366E74A20BC49CC6FF0\n9C00A1A4A82EDB43D48737D7F60E0CCDF91201A5\n5A1D622C58825E4182337050071011C751C94821\nC94910016AA8F8FA5C13E5E228503034554D6A9F\nE24E8522FDD210A10E3DEAA5011715083ACFE9C6\n10217AA136E25CA3FCA748915D215A760E084D37\n7F2E802781D35AFD090751297CA1DBDC918A6A3E\nDAE51A757C464CA602C522FF243CB2F0CA393EFF\nD27A9CC3C08349FCF4145971B9D17A3EE2F8F1C2\nEB10A7FFF6C73FF806E3FEFD53C0287F38D1A91F\n9B6BD83E66BCB6735B19042B766EDBBB07986773\n65EDDBFC3C5368368B2C7760EE8800E21DFB933E\nAD280D8DBCF9B65DDC32A2FF317875C8191AFC1F\n000E00EB37EAB4CECBEBECBC0CCF06793DBD2EB3\n".to_string()
text: "534954210001000034EE724C6175020000000016\n000000001E48617473204F666620746F20456967\n6874204E696E657465656E2E736974946AAA0000\n0000000000000000000000000000000000000000\n00000000FFFFFFFF53495444534954210100AE1A\nCAD4AE1ACAD40000000000003468000000000000\n34680000CAF90000000000004A21534954210001\n00003468724C617502000000001600000D0D1A48\n617473204F666620746F204569676874204E696E\n657465656E0001537E94897D0000000000000000\n000000000000000000000000000000000000FFFF\nFFFF7363653232362EB00100AE1AA710AE1ACAC4\n0000087A0000738C0000057100002E7177DCF747\n000000000000EFB60B005D796C65E775CA8EB023\n47B984114E5646B8114E5847B8E498849F479E93\nE347FBB5EC08CB8F30B24A23C7098B3CCBC31B2D\nC2093D4EB81EDE2897F09530326087377E86279C\n3C7BF192A31CCFC988BFD7D993A747669C1C2313\n4638E164CA927072FC24CF8F1CA79EFC0566A33C\n2F3D0302A02F3BC28D3C2748648403AF029F2380\n95318331965FC5D8227C99FD62F78617DE1918ED\n6EC311B368530FEB69375AA82C5BBDE3E0F0D1E2\n5ECE8BC343C5DE23CEC07071CF91417BD8B60737\n984CFF8E1EB2BBBB376DF816BA3E622FCFCBF867\nBE5EFD7981B1A3A7A0FA3DAD4BF36516D4BEC4DA\nD8BC5A8D6A79F00A6B79A051D916AA871D7F88CA\nB550178D9602E760B7F656A37A1EA1CC05D4968B\nFA92BD9CBD3C775FCD6EB0E566B38335535C772C\n7C5B483D065BF2E01E1DF71E61F53CE46C03D782\n7D0BD3B7FB1B6CCB186BCE0D33B66EBD7061EB56\n6676754D4E7675B14CA170FD7AA1A0592727B52D\n8C9D3E8D1DC61E3BA6DD626CDF3E1D55C6D6AFC7\nBE9831B031B6249F1F1FC7A53D9FBF74097BC7DA\nB5E3E31B37B2A55D5DE3E36082E207D3F26A6E5F\n7785162791F485EF70EEA6BC5D702E70EAAF5A9C\nD7852983F8477AFE2AAD4824485C7000FBAE552A\nF5F6F6CFF2BCE3F2332072DC599E8A8CE74BF50B\n6DFE8DCC64CC4F85E13A759E87206765BF55DADD\nE086CB1B22C7CFF4734780516B7D63A565F5BEEE\nC9F857DA3C45AB7C40AC534F5B1677B8F0A4544A\nCAC86BA8BB6424718366556724DCF727AC7269DB\n9A0B57AF5E11DEEFF4DC1F944D7CB75CEA4D4BF9\n4FAC7E47F3C63F532101BBEF9E7FEBFC9713BB4A\n80C5093D798D96D4606319167881FA9E96A8C817\nE270A9F48113FE454FDCA045896F5B5C48F51DE5\n93C83F6B95B78BF03AADBC05915120643C818374\nB917DCA4A5B7B42D5FC16E15DFA2A76628839400\n6746524E53A62665FCC3DC1A4E5353B1B84EEBC0\n51B3ACBE9B9419EEB7635CA7AC72052453963508\n12C1BC3A59292D4BA4904122EC3EA29AF0827BD4\n069B284A258B53481076384B591548DF8B6F6A43\n8413C4B78981A02326AA0A518107C20B536A438E\n02901E32404F2912149CDC1F92CEB3C4AAE2FB64\nAA44A594F347A9CA4F860D3482F48240A9C80BEE\n5247E272217C8E8C925233C492BA326A32A54EE4\n0BCD61EF97440B1A77995507C664AAC2818C5C22\n83D0E7FBEF50CE75C22A17C09830AC8E8008EF1E\n99AE13DCD7668AF00EA2E387C10CE5A41825DF1B\nADD336734CC4B364F8DE0C3543D3771DE8483CAF\nE679506A26521BE78B789A0C11CE472F441EE3DA\n3465234908629D4A06C9FBD494334801B232709B\nB2BE47910F01C6949AA5B6314A22A450ABD1C954\n3AC74604658BC67C71B2A21444EC324F5AA3B364\n9E295590B9B1FEC191F2765871B6B473AA54AEC0\n8A2A4768D9899433F860564B7D9052E5BC729BCC\nDAE13E6839B3DDB62B2E1FA8D3818E1AAA432176\n2AB2079087D5480252C703A2041F643751A2DC1F\nD6ECDE4A83323E0A2745E452758F3223659D1778\n3EFA37B52591EB8EDEA7BCF47C118E090FED78D0\nA4C44F79DEE64E00FF7D81B60852CAD704BA5404\n88BFC8A0BE3D585673454366E74A20BC49CC6FF0\n9C00A1A4A82EDB43D48737D7F60E0CCDF91201A5\n5A1D622C58825E4182337050071011C751C94821\nC94910016AA8F8FA5C13E5E228503034554D6A9F\nE24E8522FDD210A10E3DEAA5011715083ACFE9C6\n10217AA136E25CA3FCA748915D215A760E084D37\n7F2E802781D35AFD090751297CA1DBDC918A6A3E\nDAE51A757C464CA602C522FF243CB2F0CA393EFF\nD27A9CC3C08349FCF4145971B9D17A3EE2F8F1C2\nEB10A7FFF6C73FF806E3FEFD53C0287F38D1A91F\n9B6BD83E66BCB6735B19042B766EDBBB07986773\n65EDDBFC3C5368368B2C7760EE8800E21DFB933E\nAD280D8DBCF9B65DDC32A2FF317875C8191AFC1F\n000E00EB37EAB4CECBEBECBC0CCF06793DBD2EB3\n".to_owned()
},
trm::Group {
flags: trm::GroupFlags::empty(),
ttype: trm::GroupType::Logoff(1619),
map::trmg::Group {
flags: map::trmg::GroupFlags::empty(),
ttype: map::trmg::GroupType::Logoff(1619),
lines: 1,
text: "".to_string()
text: "".to_owned()
}
],
faces: vec![]

View File

@ -5,58 +5,84 @@ include!("data/rand.rs");
#[test]
fn read_minf_must_process()
{
const INPUT: &[u8] = include_bytes!("data/map/minf.in");
let inp = include_bytes!("data/map/minf.in");
let out = include!("data/map/minf.out");
let out = map::Minf{texture_id: 0,
physics_id: 1,
skypict_id: 1,
miss_flags: map::MsnFlags::REPAIR,
envi_flags: map::EnvFlags::empty(),
entr_flags: map::EntFlags::SOLO | map::EntFlags::CO_OP,
level_name: "Waterloo Waterpark".to_string()};
assert_eq!(map::read_minf(INPUT).unwrap(), out);
assert_eq!(map::minf::read(inp).unwrap(), out);
}
#[test]
fn read_epnt_must_process()
{
const INPUT: &[u8] = include_bytes!("data/map/epnt.in");
const OUTPUT: [map::Point; 54] = include!("data/map/epnt.out");
let inp = include_bytes!("data/map/epnt.in");
assert_eq!(bin::rd_array(INPUT, map::read_epnt).unwrap(), OUTPUT.to_vec());
let inp = bin::rd_array(inp, map::epnt::read).unwrap();
let out = include!("data/map/epnt.out.2").to_vec();
assert_eq!(inp, out);
let inp = map::epnt::to_pnts(&inp);
let out = include!("data/map/epnt.out.1").to_vec();
assert_eq!(inp, out);
}
#[test]
fn read_term_must_process()
{
let inp = include_bytes!("data/map/term.in");
let out = include!("data/map/term.out");
let inp = bin::rd_array(inp, map::term::read).unwrap();
// 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 map_must_not_process()
{
for inp in &RANDOM {
assert!(map::read_minf(inp).is_err());
assert!(map::read_old_minf(inp).is_err());
assert!(bin::rd_array(inp, map::read_lins).is_err());
assert!(bin::rd_array(inp, map::read_lite).is_err());
assert!(bin::rd_array(inp, map::read_medi).is_err());
assert!(bin::rd_array(inp, map::read_note).is_err());
assert!(bin::rd_array(inp, map::read_objs).is_err());
assert!(bin::rd_array(inp, map::read_plat).is_err());
assert!(bin::rd_array(inp, map::read_poly).is_err());
assert!(bin::rd_array(inp, map::read_sids).is_err());
assert!(bin::rd_array(inp, map::read_old_lite).is_err());
assert!(bin::rd_array(inp, map::read_old_poly).is_err());
assert!(bin::rd_array(inp, map::read_old_sids).is_err());
map::minf::read(inp).err().unwrap();
map::minf::read_old(inp).err().unwrap();
bin::rd_array(inp, map::lins::read).err().unwrap();
bin::rd_array(inp, map::lite::read).err().unwrap();
bin::rd_array(inp, map::medi::read).err().unwrap();
bin::rd_array(inp, map::note::read).err().unwrap();
bin::rd_array(inp, map::objs::read).err().unwrap();
bin::rd_array(inp, map::plat::read).err().unwrap();
bin::rd_array(inp, map::poly::read).err().unwrap();
bin::rd_array(inp, map::sids::read).err().unwrap();
bin::rd_array(inp, map::term::read).err().unwrap();
bin::rd_array(inp, map::trmg::read).err().unwrap();
bin::rd_array(inp, map::lite::read_old).err().unwrap();
bin::rd_array(inp, map::poly::read_old).err().unwrap();
bin::rd_array(inp, map::sids::read_old).err().unwrap();
}
}
#[test]
#[allow(unused_must_use)]
fn map_must_not_panic()
{
for inp in &RANDOM {
bin::rd_array(inp, map::read_ambi);
bin::rd_array(inp, map::read_bonk);
bin::rd_array(inp, map::read_epnt);
bin::rd_array(inp, map::read_iidx);
bin::rd_array(inp, map::read_plac);
drop(bin::rd_array(inp, map::ambi::read));
drop(bin::rd_array(inp, map::bonk::read));
drop(bin::rd_array(inp, map::epnt::read));
drop(bin::rd_array(inp, map::iidx::read));
drop(bin::rd_array(inp, map::plac::read));
drop(bin::rd_array(inp, map::trmf::read));
}
}

View File

@ -6,19 +6,18 @@ include!("data/rand.rs");
fn phy_must_not_process()
{
for inp in &RANDOM {
assert!(bin::rd_array(inp, phy::read_fxpx).is_err());
assert!(bin::rd_array(inp, phy::read_mnpx).is_err());
assert!(bin::rd_array(inp, phy::read_prpx).is_err());
assert!(bin::rd_array(inp, phy::read_wppx).is_err());
bin::rd_array(inp, phy::fxpx::read).err().unwrap();
bin::rd_array(inp, phy::mnpx::read).err().unwrap();
bin::rd_array(inp, phy::prpx::read).err().unwrap();
bin::rd_array(inp, phy::wppx::read).err().unwrap();
}
}
#[test]
#[allow(unused_must_use)]
fn phy_must_not_panic()
{
for inp in &RANDOM {
bin::rd_array(inp, phy::read_pxpx);
drop(bin::rd_array(inp, phy::pxpx::read));
}
}

View File

@ -1,47 +0,0 @@
use maraiah::{durandal::bin, marathon::trm};
include!("data/rand.rs");
#[test]
fn read_term_must_process()
{
const INPUT: &[u8] = include_bytes!("data/trm/term.in");
let inp = bin::rd_array(INPUT, trm::read_term).unwrap();
let out = include!("data/trm/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 trm_must_not_process()
{
for inp in &RANDOM {
assert!(bin::rd_array(inp, trm::read_group).is_err());
assert!(bin::rd_array(inp, trm::read_term).is_err());
}
}
#[test]
#[allow(unused_must_use)]
fn trm_must_not_panic()
{
for inp in &RANDOM {
bin::rd_array(inp, trm::read_face);
}
}
// EOF