1
Fork 0
mirror of https://github.com/redstrate/Physis.git synced 2025-04-21 20:27:46 +00:00
physis/tests/integration_test.rs
Joshua Goins ec04c13fbd Silence more dead code warnings
This is intentional, for various reasons between binrw limitations and
code that isn't used directly in Physis.
2024-06-29 09:33:23 -04:00

45 lines
1.2 KiB
Rust
Executable file

// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
// SPDX-License-Identifier: GPL-3.0-or-later
use std::env;
use std::fs::read;
use physis::common::Platform;
use physis::fiin::FileInfo;
use physis::index;
#[test]
#[cfg_attr(not(feature = "retail_game_testing"), ignore)]
fn test_index_read() {
let game_dir = env::var("FFXIV_GAME_DIR").unwrap();
index::IndexFile::from_existing(
format!("{}/game/sqpack/ffxiv/000000.win32.index", game_dir).as_str(),
);
}
#[test]
#[cfg_attr(not(feature = "retail_game_testing"), ignore)]
fn test_gamedata_extract() {
let game_dir = env::var("FFXIV_GAME_DIR").unwrap();
let mut gamedata = physis::gamedata::GameData::from_existing(
Platform::Win32,
format!("{}/game", game_dir).as_str(),
)
.unwrap();
assert!(gamedata.extract("exd/root.exl").is_some());
}
#[test]
#[cfg_attr(not(feature = "retail_game_testing"), ignore)]
fn test_fiin() {
let game_dir = env::var("FFXIV_GAME_DIR").unwrap();
let fiin_path = format!("{game_dir}/boot/fileinfo.fiin");
let fiin = FileInfo::from_existing(&read(fiin_path).unwrap()).unwrap();
assert_eq!(fiin.entries[0].file_name, "steam_api.dll");
assert_eq!(fiin.entries[1].file_name, "steam_api64.dll");
}