-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #104 from AstroTechies/pseudo
chain fix + qol
- Loading branch information
Showing
45 changed files
with
199 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
[workspace] | ||
resolver = "2" | ||
members = [ | ||
"dll_injector", | ||
"github_helpers", | ||
|
Binary file added
BIN
+119 KB
unreal_asset/tests/assets/general/pseudoregalia/BP_PlayerGoatMain.uasset
Binary file not shown.
Binary file added
BIN
+419 KB
unreal_asset/tests/assets/general/pseudoregalia/BP_PlayerGoatMain.uexp
Binary file not shown.
Binary file added
BIN
+30.2 KB
unreal_asset/tests/assets/general/pseudoregalia/BP_looseWeapon.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
use std::io::{Read, Seek, SeekFrom}; | ||
use unreal_asset_base::containers::Chain; | ||
|
||
#[test] | ||
fn read() { | ||
use std::io::Cursor; | ||
let mut v = Vec::with_capacity(12); | ||
Chain::new( | ||
Cursor::new(vec![0, 1, 2, 3, 4, 5, 6, 7]), | ||
Some(Cursor::new(vec![0, 1, 2, 3])), | ||
) | ||
.read_to_end(&mut v) | ||
.unwrap(); | ||
assert_eq!(v, [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3]); | ||
} | ||
|
||
#[test] | ||
fn seek() { | ||
use std::io::Cursor; | ||
let mut chain = Chain::new( | ||
Cursor::new(vec![0, 1, 2, 3]), | ||
Some(Cursor::new(vec![4, 5, 6, 7])), | ||
); | ||
let mut read_at = |pos| { | ||
use byteorder::ReadBytesExt; | ||
use Seek; | ||
chain.seek(pos)?; | ||
chain.read_u8() | ||
}; | ||
assert_eq!(read_at(SeekFrom::Start(0)).unwrap(), 0); | ||
assert!(read_at(SeekFrom::Start(8)).is_err()); | ||
assert_eq!(read_at(SeekFrom::Current(-1)).unwrap(), 7); | ||
assert_eq!(read_at(SeekFrom::Current(-5)).unwrap(), 3); | ||
assert_eq!(read_at(SeekFrom::End(-4)).unwrap(), 4); | ||
assert!(read_at(SeekFrom::End(-12)).is_err()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.