aboutsummaryrefslogtreecommitdiff
path: root/zencore/filesystem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'zencore/filesystem.cpp')
-rw-r--r--zencore/filesystem.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/zencore/filesystem.cpp b/zencore/filesystem.cpp
index 2e4e876e9..9274b35de 100644
--- a/zencore/filesystem.cpp
+++ b/zencore/filesystem.cpp
@@ -1065,6 +1065,23 @@ TEST_CASE("WriteFile")
std::filesystem::remove(TempFile);
}
+TEST_CASE("DiskSpaceInfo")
+{
+ std::filesystem::path BinPath = GetRunningExecutablePath();
+
+ DiskSpace Space = {};
+
+ std::error_code Error;
+ Space = DiskSpaceInfo(BinPath, Error);
+ CHECK(!Error);
+
+ bool Okay = DiskSpaceInfo(BinPath, Space);
+ CHECK(Okay);
+
+ CHECK(int64_t(Space.Total) > 0);
+ CHECK(int64_t(Space.Free) > 0); // Hopefully there's at least one byte free
+}
+
TEST_CASE("PathBuilder")
{
# if ZEN_PLATFORM_WINDOWS