1
Fork 0
mirror of https://github.com/redstrate/Physis.git synced 2025-04-20 11:47:46 +00:00
physis/tests/integration_test.rs

51 lines
1.4 KiB
Rust
Raw Normal View History

// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
// SPDX-License-Identifier: GPL-3.0-or-later
2024-04-20 13:18:03 -04:00
use hmac_sha512::Hash;
use physis::patch::apply_patch;
2022-08-16 11:52:07 -04:00
use std::env;
use std::fs::{read, read_dir};
2023-09-22 19:17:24 -04:00
use std::process::Command;
2022-07-19 19:29:41 -04:00
use physis::common::Platform;
use physis::fiin::FileInfo;
use physis::index;
2024-04-20 13:18:03 -04:00
use std::collections::HashMap;
use std::path::{Path, PathBuf};
2022-07-19 19:29:41 -04:00
#[test]
#[cfg_attr(not(feature = "retail_game_testing"), ignore)]
2022-07-19 19:29:41 -04:00
fn test_index_read() {
let game_dir = env::var("FFXIV_GAME_DIR").unwrap();
2022-08-16 11:52:07 -04:00
index::IndexFile::from_existing(
format!("{}/game/sqpack/ffxiv/000000.win32.index", game_dir).as_str(),
);
2022-07-19 19:29:41 -04:00
}
#[test]
#[cfg_attr(not(feature = "retail_game_testing"), ignore)]
2022-07-19 19:29:41 -04:00
fn test_gamedata_extract() {
let game_dir = env::var("FFXIV_GAME_DIR").unwrap();
2024-04-20 13:18:03 -04:00
let mut gamedata = physis::gamedata::GameData::from_existing(
Platform::Win32,
format!("{}/game", game_dir).as_str(),
)
.unwrap();
2022-07-19 19:29:41 -04:00
assert!(gamedata.extract("exd/root.exl").is_some());
2022-08-16 11:52:07 -04:00
}
2022-10-20 11:44:54 -04:00
#[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();
2022-10-20 11:45:55 -04:00
assert_eq!(fiin.entries[0].file_name, "steam_api.dll");
assert_eq!(fiin.entries[1].file_name, "steam_api64.dll");
2022-10-20 11:44:54 -04:00
}