#[test]
fn test_mutable_archive_operations() {
use std::path::Path;
use wow_mpq::MutableArchive;
let test_mpq = Path::new("tests/fixtures/test.mpq");
if test_mpq.exists() {
match MutableArchive::open(test_mpq) {
Ok(mut archive) => {
println!("Successfully opened archive for modification");
match archive.remove_file("nonexistent.txt") {
Ok(_) => println!("Remove returned success"),
Err(e) => println!("Remove file error: {e:?}"),
}
match archive.rename_file("old.txt", "new.txt") {
Ok(_) => println!("Rename returned success"),
Err(e) => println!("Rename file error: {e:?}"),
}
match archive.compact() {
Ok(stats) => println!("Compact returned: {stats:?}"),
Err(e) => println!("Compact error: {e:?}"),
}
}
Err(e) => {
println!("Could not open test MPQ for modification: {e:?}");
println!("This is expected if no test MPQ exists");
}
}
} else {
println!("No test MPQ file found at {test_mpq:?}");
println!("Skipping MutableArchive tests");
}
}
#[test]
fn test_stormlib_ffi_symbols_exist() {
}
#[test]
fn print_ffi_usage_example() {
println!("\nStormLib FFI Usage Example:");
println!("---------------------------");
println!("// C code example:");
println!("#include <StormLib.h>");
println!();
println!("HANDLE archive = NULL;");
println!("if (SFileCreateArchive(\"test.mpq\", MPQ_CREATE_ARCHIVE_V2, 1000, &archive)) {{");
println!(" SFileAddFile(archive, \"data.txt\", \"DATA\\\\data.txt\", 0);");
println!(" SFileCloseArchive(archive);");
println!("}}");
println!();
println!("Note: Due to current architecture limitations, some operations on");
println!("MutableArchive may return ERROR_NOT_SUPPORTED (50).");
}