Added test project for vfs

- Added test case for: decode_fat_timestamp
- Changed location of: decode_fat_timestamp
This commit is contained in:
Gliniak
2023-08-01 21:04:20 +02:00
parent ce9a82ccf8
commit d9e1c5024f
5 changed files with 63 additions and 24 deletions

View File

@@ -0,0 +1,8 @@
project_root = "../../../.."
include(project_root.."/tools/build")
test_suite("xenia-vfs-tests", project_root, ".", {
links = {
"xenia-vfs",
},
})

View 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