From c31d51487082c6cf243ecd10da71a15a78d41add Mon Sep 17 00:00:00 2001 From: Micha White Date: Mon, 13 Feb 2023 00:18:57 -0500 Subject: Parse TinyVG files --- alligator_tvg/tests/examples/tvg/everything-32.tvg | Bin 0 -> 2637 bytes alligator_tvg/tests/examples/tvg/everything.tvg | Bin 0 -> 1447 bytes alligator_tvg/tests/examples/tvg/shield-16.tvg | Bin 0 -> 203 bytes alligator_tvg/tests/examples/tvg/shield-32.tvg | Bin 0 -> 371 bytes alligator_tvg/tests/examples/tvg/shield-8.tvg | Bin 0 -> 119 bytes alligator_tvg/tests/parse.rs | 14 ++++++++++++++ 6 files changed, 14 insertions(+) create mode 100644 alligator_tvg/tests/examples/tvg/everything-32.tvg create mode 100644 alligator_tvg/tests/examples/tvg/everything.tvg create mode 100644 alligator_tvg/tests/examples/tvg/shield-16.tvg create mode 100644 alligator_tvg/tests/examples/tvg/shield-32.tvg create mode 100644 alligator_tvg/tests/examples/tvg/shield-8.tvg create mode 100644 alligator_tvg/tests/parse.rs (limited to 'alligator_tvg/tests') diff --git a/alligator_tvg/tests/examples/tvg/everything-32.tvg b/alligator_tvg/tests/examples/tvg/everything-32.tvg new file mode 100644 index 0000000..7ea4bdd Binary files /dev/null and b/alligator_tvg/tests/examples/tvg/everything-32.tvg differ diff --git a/alligator_tvg/tests/examples/tvg/everything.tvg b/alligator_tvg/tests/examples/tvg/everything.tvg new file mode 100644 index 0000000..b211c53 Binary files /dev/null and b/alligator_tvg/tests/examples/tvg/everything.tvg differ diff --git a/alligator_tvg/tests/examples/tvg/shield-16.tvg b/alligator_tvg/tests/examples/tvg/shield-16.tvg new file mode 100644 index 0000000..aacd3ea Binary files /dev/null and b/alligator_tvg/tests/examples/tvg/shield-16.tvg differ diff --git a/alligator_tvg/tests/examples/tvg/shield-32.tvg b/alligator_tvg/tests/examples/tvg/shield-32.tvg new file mode 100644 index 0000000..a2abc92 Binary files /dev/null and b/alligator_tvg/tests/examples/tvg/shield-32.tvg differ diff --git a/alligator_tvg/tests/examples/tvg/shield-8.tvg b/alligator_tvg/tests/examples/tvg/shield-8.tvg new file mode 100644 index 0000000..57033be Binary files /dev/null and b/alligator_tvg/tests/examples/tvg/shield-8.tvg differ diff --git a/alligator_tvg/tests/parse.rs b/alligator_tvg/tests/parse.rs new file mode 100644 index 0000000..eb6e801 --- /dev/null +++ b/alligator_tvg/tests/parse.rs @@ -0,0 +1,14 @@ +use std::fs::File; + +use alligator_tvg::{Rgba16, TvgFile}; + +#[test] +fn main() { + for entry in std::fs::read_dir("tests/examples/tvg").unwrap() { + let entry = entry.unwrap().file_name(); + let entry = entry.to_string_lossy(); + let mut file = File::open(format!("./tests/examples/tvg/{}", &entry)).unwrap(); + let _: TvgFile = TvgFile::read_from(&mut file).unwrap(); + println!("{:?} succeeded!", entry); + } +} -- cgit v1.2.3