Added test project for vfs
- Added test case for: decode_fat_timestamp - Changed location of: decode_fat_timestamp
This commit is contained in:
8
src/xenia/vfs/testing/premake5.lua
Normal file
8
src/xenia/vfs/testing/premake5.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
project_root = "../../../.."
|
||||
include(project_root.."/tools/build")
|
||||
|
||||
test_suite("xenia-vfs-tests", project_root, ".", {
|
||||
links = {
|
||||
"xenia-vfs",
|
||||
},
|
||||
})
|
||||
28
src/xenia/vfs/testing/vfs_test.cc
Normal file
28
src/xenia/vfs/testing/vfs_test.cc
Normal file
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* Xenia : Xbox 360 Emulator Research Project *
|
||||
******************************************************************************
|
||||
* Copyright 2023 Ben Vanik. All rights reserved. *
|
||||
* Released under the BSD license - see LICENSE in the root for more details. *
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include "xenia/vfs/devices/stfs_xbox.h"
|
||||
|
||||
#include "third_party/catch/include/catch.hpp"
|
||||
|
||||
namespace xe::vfs::test {
|
||||
|
||||
TEST_CASE("STFS Decode date and time", "[stfs_decode]") {
|
||||
SECTION("10 June 2022 19:46:00 UTC - Decode") {
|
||||
const uint16_t date = 0x54CA;
|
||||
const uint16_t time = 0x9DBD;
|
||||
const uint64_t result = 132993639580000000;
|
||||
|
||||
const uint64_t timestamp = decode_fat_timestamp(date, time);
|
||||
|
||||
REQUIRE(timestamp == result);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace xe::vfs::test
|
||||
Reference in New Issue
Block a user