summaryrefslogtreecommitdiffstats
path: root/tools/slang-unit-test/unit-test-compression.cpp
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2024-10-29 14:49:26 +0800
committerGitHub <noreply@github.com>2024-10-29 14:49:26 +0800
commitf65d756bff8d4c5cbc15bd0322a2ae8e6b896a21 (patch)
treeea1d61342cd29368e19135000ec2948813096205 /tools/slang-unit-test/unit-test-compression.cpp
parenta729c15e9dce9f5116a38afc66329ab2ca4cea54 (diff)
format
* format * Minor test fixes * enable checking cpp format in ci
Diffstat (limited to 'tools/slang-unit-test/unit-test-compression.cpp')
-rw-r--r--tools/slang-unit-test/unit-test-compression.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/tools/slang-unit-test/unit-test-compression.cpp b/tools/slang-unit-test/unit-test-compression.cpp
index 486a252b2..28f18997f 100644
--- a/tools/slang-unit-test/unit-test-compression.cpp
+++ b/tools/slang-unit-test/unit-test-compression.cpp
@@ -1,8 +1,7 @@
// unit-compression.cpp
-#include "tools/unit-test/slang-unit-test.h"
-
-#include "../../source/core/slang-lz4-compression-system.h"
#include "../../source/core/slang-deflate-compression-system.h"
+#include "../../source/core/slang-lz4-compression-system.h"
+#include "tools/unit-test/slang-unit-test.h"
using namespace Slang;
@@ -10,9 +9,9 @@ static ICompressionSystem* _getCompressionSystem(CompressionSystemType type)
{
switch (type)
{
- case CompressionSystemType::Deflate: return DeflateCompressionSystem::getSingleton(); break;
- case CompressionSystemType::LZ4: return LZ4CompressionSystem::getSingleton(); break;
- default: break;
+ case CompressionSystemType::Deflate: return DeflateCompressionSystem::getSingleton(); break;
+ case CompressionSystemType::LZ4: return LZ4CompressionSystem::getSingleton(); break;
+ default: break;
}
return nullptr;
}
@@ -23,7 +22,7 @@ SLANG_UNIT_TEST(compression)
for (Index i = 0; i < Count(CompressionSystemType::CountOf); ++i)
{
ICompressionSystem* system = _getCompressionSystem(CompressionSystemType(i));
-
+
if (!system)
{
continue;
@@ -37,13 +36,18 @@ SLANG_UNIT_TEST(compression)
// Use the default style
CompressionStyle style;
- SLANG_CHECK(SLANG_SUCCEEDED(system->compress(&style, src, srcSize, compressedBlob.writeRef())));
-
+ SLANG_CHECK(
+ SLANG_SUCCEEDED(system->compress(&style, src, srcSize, compressedBlob.writeRef())));
+
// Now lets decompress
List<char> decompressedData;
decompressedData.setCount(srcSize);
- SLANG_CHECK(SLANG_SUCCEEDED(system->decompress(compressedBlob->getBufferPointer(), compressedBlob->getBufferSize(), srcSize, decompressedData.getBuffer())));
+ SLANG_CHECK(SLANG_SUCCEEDED(system->decompress(
+ compressedBlob->getBufferPointer(),
+ compressedBlob->getBufferSize(),
+ srcSize,
+ decompressedData.getBuffer())));
SLANG_CHECK(::memcmp(src, decompressedData.getBuffer(), srcSize) == 0);
}
}