implements PLN-0171 variable glyph palette test coverage
This commit is contained in:
@@ -2184,6 +2184,29 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_decode_glyph_bank_rejects_mismatched_variable_serialized_size() {
|
||||
let mut entry = test_glyph_asset_entry_with_palette_count("glyphs", 16, 16, 3);
|
||||
entry.size += 1;
|
||||
|
||||
let err = match AssetManager::decode_glyph_bank_from_buffer(
|
||||
&entry,
|
||||
&test_glyph_asset_data_with_palette_count(3),
|
||||
) {
|
||||
Ok(_) => panic!("glyph decode should reject invalid serialized size"),
|
||||
Err(err) => err,
|
||||
};
|
||||
|
||||
assert_eq!(
|
||||
err,
|
||||
format!(
|
||||
"Invalid GLYPHBANK serialized size: expected {}, got {}",
|
||||
expected_glyph_payload_size(16, 16, 3),
|
||||
expected_glyph_payload_size(16, 16, 3) + 1
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_op_mode_for_glyphs_none_stages_in_memory() {
|
||||
let entry = test_glyph_asset_entry("glyphs", 16, 16);
|
||||
|
||||
Reference in New Issue
Block a user