diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2022-09-01 16:39:08 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-01 16:39:08 -0400 |
| commit | cc0b81350f6b681c794b4ac7c0f3b5fe73cb19eb (patch) | |
| tree | 7fd935748f4da5daa381f6cf4ef5d06c6adfc0a6 /tools | |
| parent | f64d8748d4396a90d27adbdc17db3bac4a58d666 (diff) | |
Make ISlangFileSystem derive from ICastable (#2386)
* #include an absolute path didn't work - because paths were taken to always be relative.
* Make ISlangFileSystem derive from ICastable.
* Make ArchiveFileSystem into an interface
Make file systems atomically reference counted.
* Small fix.
* Some small fixes to work around issues of ICastable on ISlangFileSystem
* Use ISlangFileSystem derived type instead of IArchiveFileSystem. Can always get other interface with castAs.
* Some small fixes around change of interface returned from archive type functions.
* Remove CacheFileSystem member from linkage. Can access easily from m_fileSystemExt if necessary with as cast.
* Fix RiffFileSystem casting issue.
* Add a check around CacheFileSystem.
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/slang-unit-test/unit-test-compression.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/slang-unit-test/unit-test-compression.cpp b/tools/slang-unit-test/unit-test-compression.cpp index 89716b443..e3bcbcf00 100644 --- a/tools/slang-unit-test/unit-test-compression.cpp +++ b/tools/slang-unit-test/unit-test-compression.cpp @@ -8,6 +8,8 @@ #include "../../source/core/slang-lz4-compression-system.h" #include "../../source/core/slang-deflate-compression-system.h" +#include "../../source/core/slang-destroyable.h" + using namespace Slang; static bool _equals(const void* data, size_t size, ISlangBlob* blob) @@ -46,16 +48,14 @@ SLANG_UNIT_TEST(compression) for (auto archiveType : archiveTypes) { // Test out archive file systems - RefPtr<ArchiveFileSystem> archiveFileSystem; - SLANG_CHECK(SLANG_SUCCEEDED(createArchiveFileSystem(archiveType, archiveFileSystem))); + ComPtr<ISlangMutableFileSystem> fileSystem; + SLANG_CHECK(SLANG_SUCCEEDED(createArchiveFileSystem(archiveType, fileSystem))); const char contents[] = "I'm compressed"; const char contents2[] = "Some more stuff"; const char contents3[] = "Replace it"; { - ISlangMutableFileSystem* fileSystem = archiveFileSystem; - SLANG_CHECK(SLANG_SUCCEEDED(fileSystem->createDirectory("hello"))); SLANG_CHECK(SLANG_SUCCEEDED(fileSystem->createDirectory("hello2"))); SLANG_CHECK(SLANG_SUCCEEDED(fileSystem->remove("hello"))); @@ -131,11 +131,13 @@ SLANG_UNIT_TEST(compression) // Load and check its okay { + IArchiveFileSystem* archiveFileSystem = as<IArchiveFileSystem>(fileSystem); + ComPtr<ISlangBlob> archiveBlob; SLANG_CHECK(SLANG_SUCCEEDED(archiveFileSystem->storeArchive(false, archiveBlob.writeRef()))); - RefPtr<ArchiveFileSystem> fileSystem; + ComPtr<ISlangFileSystemExt> fileSystem; #if 0 SLANG_CHECK(SLANG_SUCCEEDED(createArchiveFileSystem(archiveType, fileSystem))); |
