diff --git a/psogc_quest_tool/src/convert.rs b/psogc_quest_tool/src/convert.rs index b974c4b..a2fb535 100644 --- a/psogc_quest_tool/src/convert.rs +++ b/psogc_quest_tool/src/convert.rs @@ -329,7 +329,7 @@ mod tests { let dat_save_path = tmp_dir.path().join("quest58.dat"); let args = &[ - "../psoutils/test-assets/q058-ret-gc.online.qst".to_string(), + "../test-assets/q058-ret-gc.online.qst".to_string(), "raw_bindat".to_string(), bin_save_path.to_string_lossy().into_owned(), dat_save_path.to_string_lossy().into_owned(), @@ -346,7 +346,7 @@ mod tests { let dat_save_path = tmp_dir.path().join("quest58.dat"); let args = &[ - "../psoutils/test-assets/q058-ret-gc.offline.qst".to_string(), + "../test-assets/q058-ret-gc.offline.qst".to_string(), "prs_bindat".to_string(), bin_save_path.to_string_lossy().into_owned(), dat_save_path.to_string_lossy().into_owned(), @@ -362,8 +362,8 @@ mod tests { let qst_save_path = tmp_dir.path().join("quest58.qst"); let args = &[ - "../psoutils/test-assets/q058-ret-gc.bin".to_string(), - "../psoutils/test-assets/q058-ret-gc.dat".to_string(), + "../test-assets/q058-ret-gc.bin".to_string(), + "../test-assets/q058-ret-gc.dat".to_string(), "online_qst".to_string(), qst_save_path.to_string_lossy().into_owned(), ]; @@ -377,8 +377,8 @@ mod tests { let qst_save_path = tmp_dir.path().join("quest58.qst"); let args = &[ - "../psoutils/test-assets/q058-ret-gc.uncompressed.bin".to_string(), - "../psoutils/test-assets/q058-ret-gc.uncompressed.dat".to_string(), + "../test-assets/q058-ret-gc.uncompressed.bin".to_string(), + "../test-assets/q058-ret-gc.uncompressed.dat".to_string(), "offline_qst".to_string(), qst_save_path.to_string_lossy().into_owned(), ]; diff --git a/psogc_quest_tool/src/info.rs b/psogc_quest_tool/src/info.rs index e05dbc0..a4cb344 100644 --- a/psogc_quest_tool/src/info.rs +++ b/psogc_quest_tool/src/info.rs @@ -188,15 +188,15 @@ mod tests { #[test] pub fn succeeds_with_single_file_arg() { - let args = &["../psoutils/test-assets/q058-ret-gc.online.qst".to_string()]; + let args = &["../test-assets/q058-ret-gc.online.qst".to_string()]; assert_ok!(quest_info(args)); } #[test] pub fn succeeds_with_two_file_args() { let args = &[ - "../psoutils/test-assets/q058-ret-gc.bin".to_string(), - "../psoutils/test-assets/q058-ret-gc.dat".to_string(), + "../test-assets/q058-ret-gc.bin".to_string(), + "../test-assets/q058-ret-gc.dat".to_string(), ]; assert_ok!(quest_info(args)); } @@ -204,8 +204,8 @@ mod tests { #[test] pub fn fails_when_bin_dat_file_args_in_wrong_order() { let args = &[ - "../psoutils/test-assets/q058-ret-gc.dat".to_string(), - "../psoutils/test-assets/q058-ret-gc.bin".to_string(), + "../test-assets/q058-ret-gc.dat".to_string(), + "../test-assets/q058-ret-gc.bin".to_string(), ]; assert_matches!(quest_info(args), Err(_)); } diff --git a/psoutils/src/quest.rs b/psoutils/src/quest.rs index 61a26f6..aadddf0 100644 --- a/psoutils/src/quest.rs +++ b/psoutils/src/quest.rs @@ -148,41 +148,41 @@ mod tests { #[test] pub fn can_load_from_compressed_bindat_files() { - let bin_path = Path::new("test-assets/q058-ret-gc.bin"); - let dat_path = Path::new("test-assets/q058-ret-gc.dat"); + let bin_path = Path::new("../test-assets/q058-ret-gc.bin"); + let dat_path = Path::new("../test-assets/q058-ret-gc.dat"); assert_ok!(Quest::from_bindat_files(bin_path, dat_path)); } #[test] pub fn can_load_from_uncompressed_bindat_files() { - let bin_path = Path::new("test-assets/q058-ret-gc.uncompressed.bin"); - let dat_path = Path::new("test-assets/q058-ret-gc.uncompressed.dat"); + let bin_path = Path::new("../test-assets/q058-ret-gc.uncompressed.bin"); + let dat_path = Path::new("../test-assets/q058-ret-gc.uncompressed.dat"); assert_ok!(Quest::from_bindat_files(bin_path, dat_path)); } #[test] pub fn can_load_from_offline_qst_file() { - let path = Path::new("test-assets/q058-ret-gc.offline.qst"); + let path = Path::new("../test-assets/q058-ret-gc.offline.qst"); assert_ok!(Quest::from_qst_file(path)); } #[test] pub fn can_load_from_online_qst_file() { - let path = Path::new("test-assets/q058-ret-gc.online.qst"); + let path = Path::new("../test-assets/q058-ret-gc.online.qst"); assert_ok!(Quest::from_qst_file(path)); } #[test] pub fn can_create_from_qst_struct() { - let qst = QuestQst::from_file(Path::new("test-assets/q058-ret-gc.online.qst")).unwrap(); + let qst = QuestQst::from_file(Path::new("../test-assets/q058-ret-gc.online.qst")).unwrap(); assert_ok!(Quest::from_qst(qst)); } #[test] pub fn can_save_to_compressed_bindat_files() -> Result<(), QuestError> { let quest = Quest::from_bindat_files( - Path::new("test-assets/q058-ret-gc.bin"), - Path::new("test-assets/q058-ret-gc.dat"), + Path::new("../test-assets/q058-ret-gc.bin"), + Path::new("../test-assets/q058-ret-gc.dat"), )?; let tmp_dir = TempDir::new()?; let bin_save_path = tmp_dir.path().join("quest58.bin"); @@ -196,8 +196,8 @@ mod tests { #[test] pub fn can_save_to_uncompressed_bindat_files() -> Result<(), QuestError> { let quest = Quest::from_bindat_files( - Path::new("test-assets/q058-ret-gc.bin"), - Path::new("test-assets/q058-ret-gc.dat"), + Path::new("../test-assets/q058-ret-gc.bin"), + Path::new("../test-assets/q058-ret-gc.dat"), )?; let tmp_dir = TempDir::new()?; let bin_save_path = tmp_dir.path().join("quest58.bin"); @@ -211,8 +211,8 @@ mod tests { #[test] pub fn can_save_to_qst_file() -> Result<(), QuestError> { let quest = Quest::from_bindat_files( - Path::new("test-assets/q058-ret-gc.bin"), - Path::new("test-assets/q058-ret-gc.dat"), + Path::new("../test-assets/q058-ret-gc.bin"), + Path::new("../test-assets/q058-ret-gc.dat"), )?; let tmp_dir = TempDir::new()?; let qst_save_path = tmp_dir.path().join("quest58.qst"); diff --git a/psoutils/src/quest/bin.rs b/psoutils/src/quest/bin.rs index c7eb9e2..8af9c21 100644 --- a/psoutils/src/quest/bin.rs +++ b/psoutils/src/quest/bin.rs @@ -374,7 +374,7 @@ pub mod tests { #[test] pub fn read_compressed_quest_58_bin() -> Result<(), QuestBinError> { - let path = Path::new("test-assets/q058-ret-gc.bin"); + let path = Path::new("../test-assets/q058-ret-gc.bin"); let bin = QuestBin::from_compressed_file(&path)?; validate_quest_58_bin(&bin); Ok(()) @@ -382,7 +382,7 @@ pub mod tests { #[test] pub fn write_compressed_quest_58_bin() -> Result<(), QuestBinError> { - let data = include_bytes!("../../test-assets/q058-ret-gc.bin"); + let data = include_bytes!("../../../test-assets/q058-ret-gc.bin"); let bin = QuestBin::from_compressed_bytes(data)?; let tmp_dir = TempDir::new()?; let bin_path = tmp_dir.path().join("quest58.bin"); @@ -394,7 +394,7 @@ pub mod tests { #[test] pub fn read_uncompressed_quest_58_bin() -> Result<(), QuestBinError> { - let path = Path::new("test-assets/q058-ret-gc.uncompressed.bin"); + let path = Path::new("../test-assets/q058-ret-gc.uncompressed.bin"); let bin = QuestBin::from_uncompressed_file(&path)?; validate_quest_58_bin(&bin); Ok(()) @@ -402,7 +402,7 @@ pub mod tests { #[test] pub fn write_uncompressed_quest_58_bin() -> Result<(), QuestBinError> { - let data = include_bytes!("../../test-assets/q058-ret-gc.bin"); + let data = include_bytes!("../../../test-assets/q058-ret-gc.bin"); let bin = QuestBin::from_compressed_bytes(data)?; let tmp_dir = TempDir::new()?; let bin_path = tmp_dir.path().join("quest58.bin"); @@ -414,7 +414,7 @@ pub mod tests { #[test] pub fn read_compressed_quest_118_bin() -> Result<(), QuestBinError> { - let path = Path::new("test-assets/q118-vr-gc.bin"); + let path = Path::new("../test-assets/q118-vr-gc.bin"); let bin = QuestBin::from_compressed_file(&path)?; validate_quest_118_bin(&bin); Ok(()) @@ -422,7 +422,7 @@ pub mod tests { #[test] pub fn write_compressed_quest_118_bin() -> Result<(), QuestBinError> { - let data = include_bytes!("../../test-assets/q118-vr-gc.bin"); + let data = include_bytes!("../../../test-assets/q118-vr-gc.bin"); let bin = QuestBin::from_compressed_bytes(data)?; let tmp_dir = TempDir::new()?; let bin_path = tmp_dir.path().join("quest118.bin"); @@ -434,7 +434,7 @@ pub mod tests { #[test] pub fn read_uncompressed_quest_118_bin() -> Result<(), QuestBinError> { - let path = Path::new("test-assets/q118-vr-gc.uncompressed.bin"); + let path = Path::new("../test-assets/q118-vr-gc.uncompressed.bin"); let bin = QuestBin::from_uncompressed_file(&path)?; validate_quest_118_bin(&bin); Ok(()) @@ -442,7 +442,7 @@ pub mod tests { #[test] pub fn write_uncompressed_quest_118_bin() -> Result<(), QuestBinError> { - let data = include_bytes!("../../test-assets/q118-vr-gc.bin"); + let data = include_bytes!("../../../test-assets/q118-vr-gc.bin"); let bin = QuestBin::from_compressed_bytes(data)?; let tmp_dir = TempDir::new()?; let bin_path = tmp_dir.path().join("quest118.bin"); diff --git a/psoutils/src/quest/dat.rs b/psoutils/src/quest/dat.rs index 13c18fd..b7901d4 100644 --- a/psoutils/src/quest/dat.rs +++ b/psoutils/src/quest/dat.rs @@ -572,7 +572,7 @@ pub mod tests { #[test] pub fn read_compressed_quest_58_dat() -> Result<(), QuestDatError> { - let path = Path::new("test-assets/q058-ret-gc.dat"); + let path = Path::new("../test-assets/q058-ret-gc.dat"); let dat = QuestDat::from_compressed_file(&path)?; validate_quest_58_dat(&dat); Ok(()) @@ -580,7 +580,7 @@ pub mod tests { #[test] pub fn write_compressed_quest_58_dat() -> Result<(), QuestDatError> { - let data = include_bytes!("../../test-assets/q058-ret-gc.dat"); + let data = include_bytes!("../../../test-assets/q058-ret-gc.dat"); let dat = QuestDat::from_compressed_bytes(data)?; let tmp_dir = TempDir::new()?; let dat_path = tmp_dir.path().join("quest58.dat"); @@ -592,7 +592,7 @@ pub mod tests { #[test] pub fn read_uncompressed_quest_58_dat() -> Result<(), QuestDatError> { - let path = Path::new("test-assets/q058-ret-gc.uncompressed.dat"); + let path = Path::new("../test-assets/q058-ret-gc.uncompressed.dat"); let dat = QuestDat::from_uncompressed_file(&path)?; validate_quest_58_dat(&dat); Ok(()) @@ -600,7 +600,7 @@ pub mod tests { #[test] pub fn write_uncompressed_quest_58_dat() -> Result<(), QuestDatError> { - let data = include_bytes!("../../test-assets/q058-ret-gc.dat"); + let data = include_bytes!("../../../test-assets/q058-ret-gc.dat"); let dat = QuestDat::from_compressed_bytes(data)?; let tmp_dir = TempDir::new()?; let dat_path = tmp_dir.path().join("quest58.dat"); @@ -612,7 +612,7 @@ pub mod tests { #[test] pub fn read_compressed_quest_118_dat() -> Result<(), QuestDatError> { - let path = Path::new("test-assets/q118-vr-gc.dat"); + let path = Path::new("../test-assets/q118-vr-gc.dat"); let dat = QuestDat::from_compressed_file(&path)?; validate_quest_118_dat(&dat); Ok(()) @@ -620,7 +620,7 @@ pub mod tests { #[test] pub fn write_compressed_quest_118_dat() -> Result<(), QuestDatError> { - let data = include_bytes!("../../test-assets/q118-vr-gc.dat"); + let data = include_bytes!("../../../test-assets/q118-vr-gc.dat"); let dat = QuestDat::from_compressed_bytes(data)?; let tmp_dir = TempDir::new()?; let dat_path = tmp_dir.path().join("quest118.dat"); @@ -632,7 +632,7 @@ pub mod tests { #[test] pub fn read_uncompressed_quest_118_dat() -> Result<(), QuestDatError> { - let path = Path::new("test-assets/q118-vr-gc.uncompressed.dat"); + let path = Path::new("../test-assets/q118-vr-gc.uncompressed.dat"); let dat = QuestDat::from_uncompressed_file(&path)?; validate_quest_118_dat(&dat); Ok(()) @@ -640,7 +640,7 @@ pub mod tests { #[test] pub fn write_uncompressed_quest_118_dat() -> Result<(), QuestDatError> { - let data = include_bytes!("../../test-assets/q118-vr-gc.dat"); + let data = include_bytes!("../../../test-assets/q118-vr-gc.dat"); let dat = QuestDat::from_compressed_bytes(data)?; let tmp_dir = TempDir::new()?; let dat_path = tmp_dir.path().join("quest118.dat"); diff --git a/psoutils/src/quest/qst.rs b/psoutils/src/quest/qst.rs index b9ce17a..e91637e 100644 --- a/psoutils/src/quest/qst.rs +++ b/psoutils/src/quest/qst.rs @@ -546,10 +546,10 @@ mod tests { #[test] pub fn read_quest_58_qst_from_file() -> Result<(), QuestQstError> { - let qst = QuestQst::from_file(Path::new("test-assets/q058-ret-gc.online.qst"))?; + let qst = QuestQst::from_file(Path::new("../test-assets/q058-ret-gc.online.qst"))?; validate_quest_58_qst(&qst, 1438, 15097, true)?; - let qst = QuestQst::from_file(Path::new("test-assets/q058-ret-gc.offline.qst"))?; + let qst = QuestQst::from_file(Path::new("../test-assets/q058-ret-gc.offline.qst"))?; validate_quest_58_qst(&qst, 1571, 15105, false)?; Ok(()) @@ -557,8 +557,8 @@ mod tests { #[test] pub fn write_quest_58_qst_to_file() -> Result<(), QuestQstError> { - let online_data = include_bytes!("../../test-assets/q058-ret-gc.online.qst"); - let offline_data = include_bytes!("../../test-assets/q058-ret-gc.offline.qst"); + let online_data = include_bytes!("../../../test-assets/q058-ret-gc.online.qst"); + let offline_data = include_bytes!("../../../test-assets/q058-ret-gc.offline.qst"); let tmp_dir = TempDir::new()?; @@ -581,10 +581,10 @@ mod tests { #[test] pub fn read_quest_118_qst_from_file() -> Result<(), QuestQstError> { - let qst = QuestQst::from_file(Path::new("test-assets/q118-vr-gc.online.qst"))?; + let qst = QuestQst::from_file(Path::new("../test-assets/q118-vr-gc.online.qst"))?; validate_quest_118_qst(&qst, 14208, 11802, true)?; - let qst = QuestQst::from_file(Path::new("test-assets/q118-vr-gc.offline.qst"))?; + let qst = QuestQst::from_file(Path::new("../test-assets/q118-vr-gc.offline.qst"))?; validate_quest_118_qst(&qst, 14801, 11810, false)?; Ok(()) @@ -592,8 +592,8 @@ mod tests { #[test] pub fn write_quest_118_qst_to_file() -> Result<(), QuestQstError> { - let online_data = include_bytes!("../../test-assets/q118-vr-gc.online.qst"); - let offline_data = include_bytes!("../../test-assets/q118-vr-gc.offline.qst"); + let online_data = include_bytes!("../../../test-assets/q118-vr-gc.online.qst"); + let offline_data = include_bytes!("../../../test-assets/q118-vr-gc.offline.qst"); let tmp_dir = TempDir::new()?; @@ -616,8 +616,8 @@ mod tests { #[test] pub fn create_qst_from_quest_58_bindat_files() -> Result<(), QuestQstError> { - let mut bin = QuestBin::from_compressed_file(Path::new("test-assets/q058-ret-gc.bin"))?; - let dat = QuestDat::from_compressed_file(Path::new("test-assets/q058-ret-gc.dat"))?; + let mut bin = QuestBin::from_compressed_file(Path::new("../test-assets/q058-ret-gc.bin"))?; + let dat = QuestDat::from_compressed_file(Path::new("../test-assets/q058-ret-gc.dat"))?; let qst = QuestQst::from_bindat(&bin, &dat)?; validate_quest_58_qst(&qst, 1565, 15507, true)?; @@ -631,8 +631,8 @@ mod tests { #[test] pub fn create_qst_from_quest_118_bindat_files() -> Result<(), QuestQstError> { - let mut bin = QuestBin::from_compressed_file(Path::new("test-assets/q118-vr-gc.bin"))?; - let dat = QuestDat::from_compressed_file(Path::new("test-assets/q118-vr-gc.dat"))?; + let mut bin = QuestBin::from_compressed_file(Path::new("../test-assets/q118-vr-gc.bin"))?; + let dat = QuestDat::from_compressed_file(Path::new("../test-assets/q118-vr-gc.dat"))?; let qst = QuestQst::from_bindat(&bin, &dat)?; validate_quest_118_qst(&qst, 14794, 12277, true)?; @@ -938,7 +938,7 @@ mod tests { #[test] pub fn error_when_qst_does_not_contain_both_bin_and_dat_packets() { - let qst = QuestQst::from_file(Path::new("test-assets/q058-ret-gc.online.qst")).unwrap(); + let qst = QuestQst::from_file(Path::new("../test-assets/q058-ret-gc.online.qst")).unwrap(); // write only the bin header+data packets into a buffer which we will then read a qst from let mut bytes = Cursor::new(Vec::new()); qst.bin_header.write_bytes(&mut bytes).unwrap(); @@ -955,7 +955,7 @@ mod tests { #[test] pub fn error_when_qst_header_packet_ids_do_not_all_match() { - let qst = QuestQst::from_file(Path::new("test-assets/q058-ret-gc.online.qst")).unwrap(); + let qst = QuestQst::from_file(Path::new("../test-assets/q058-ret-gc.online.qst")).unwrap(); let mut bytes = qst.to_bytes().unwrap(); // packet id is the very first byte. switch it to the wrong type @@ -969,7 +969,7 @@ mod tests { #[test] pub fn error_when_qst_data_packet_ids_do_not_all_match() { - let qst = QuestQst::from_file(Path::new("test-assets/q058-ret-gc.online.qst")).unwrap(); + let qst = QuestQst::from_file(Path::new("../test-assets/q058-ret-gc.online.qst")).unwrap(); let mut bytes = qst.to_bytes().unwrap(); // switch packet id of the first data packet to the wrong type diff --git a/psoutils/test-assets/q058-ret-gc.bin b/test-assets/q058-ret-gc.bin similarity index 100% rename from psoutils/test-assets/q058-ret-gc.bin rename to test-assets/q058-ret-gc.bin diff --git a/psoutils/test-assets/q058-ret-gc.dat b/test-assets/q058-ret-gc.dat similarity index 100% rename from psoutils/test-assets/q058-ret-gc.dat rename to test-assets/q058-ret-gc.dat diff --git a/psoutils/test-assets/q058-ret-gc.offline.qst b/test-assets/q058-ret-gc.offline.qst similarity index 100% rename from psoutils/test-assets/q058-ret-gc.offline.qst rename to test-assets/q058-ret-gc.offline.qst diff --git a/psoutils/test-assets/q058-ret-gc.online.qst b/test-assets/q058-ret-gc.online.qst similarity index 100% rename from psoutils/test-assets/q058-ret-gc.online.qst rename to test-assets/q058-ret-gc.online.qst diff --git a/psoutils/test-assets/q058-ret-gc.uncompressed.bin b/test-assets/q058-ret-gc.uncompressed.bin similarity index 100% rename from psoutils/test-assets/q058-ret-gc.uncompressed.bin rename to test-assets/q058-ret-gc.uncompressed.bin diff --git a/psoutils/test-assets/q058-ret-gc.uncompressed.dat b/test-assets/q058-ret-gc.uncompressed.dat similarity index 100% rename from psoutils/test-assets/q058-ret-gc.uncompressed.dat rename to test-assets/q058-ret-gc.uncompressed.dat diff --git a/psoutils/test-assets/q118-vr-gc.bin b/test-assets/q118-vr-gc.bin similarity index 100% rename from psoutils/test-assets/q118-vr-gc.bin rename to test-assets/q118-vr-gc.bin diff --git a/psoutils/test-assets/q118-vr-gc.dat b/test-assets/q118-vr-gc.dat similarity index 100% rename from psoutils/test-assets/q118-vr-gc.dat rename to test-assets/q118-vr-gc.dat diff --git a/psoutils/test-assets/q118-vr-gc.offline.qst b/test-assets/q118-vr-gc.offline.qst similarity index 100% rename from psoutils/test-assets/q118-vr-gc.offline.qst rename to test-assets/q118-vr-gc.offline.qst diff --git a/psoutils/test-assets/q118-vr-gc.online.qst b/test-assets/q118-vr-gc.online.qst similarity index 100% rename from psoutils/test-assets/q118-vr-gc.online.qst rename to test-assets/q118-vr-gc.online.qst diff --git a/psoutils/test-assets/q118-vr-gc.uncompressed.bin b/test-assets/q118-vr-gc.uncompressed.bin similarity index 100% rename from psoutils/test-assets/q118-vr-gc.uncompressed.bin rename to test-assets/q118-vr-gc.uncompressed.bin diff --git a/psoutils/test-assets/q118-vr-gc.uncompressed.dat b/test-assets/q118-vr-gc.uncompressed.dat similarity index 100% rename from psoutils/test-assets/q118-vr-gc.uncompressed.dat rename to test-assets/q118-vr-gc.uncompressed.dat