mirror of
https://github.com/redstrate/Physis.git
synced 2025-04-22 20:57:46 +00:00
This is to make way for another dat module (for the stuff under the user folder.) This kind of re-organization was inevitable anyway, and I gave the structs new SqPack-y names to fit their new home.
45 lines
1.3 KiB
Rust
Executable file
45 lines
1.3 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::sqpack::SqPackIndex;
|
|
|
|
#[test]
|
|
#[cfg_attr(not(feature = "retail_game_testing"), ignore)]
|
|
fn test_index_read() {
|
|
let game_dir = env::var("FFXIV_GAME_DIR").unwrap();
|
|
|
|
SqPackIndex::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");
|
|
}
|