diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2024-11-06 01:47:26 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-05 09:47:26 -0800 |
| commit | b118451e301d734e3e783b3acdf871f3f6ea851c (patch) | |
| tree | 277f160d31e2c442f724bc6a2d3c09fabff403ca /tools/slang-unit-test | |
| parent | 53dd5928c35d5a5cb1f7d2a563348fd1fa87d672 (diff) | |
Move switch statement bodies to their own lines (#5493)
* Move switch statement bodies to their own lines
* format
---------
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'tools/slang-unit-test')
| -rw-r--r-- | tools/slang-unit-test/unit-test-byte-encode.cpp | 16 | ||||
| -rw-r--r-- | tools/slang-unit-test/unit-test-compression.cpp | 11 | ||||
| -rw-r--r-- | tools/slang-unit-test/unit-test-file-system.cpp | 11 | ||||
| -rw-r--r-- | tools/slang-unit-test/unit-test-memory-arena.cpp | 12 |
4 files changed, 36 insertions, 14 deletions
diff --git a/tools/slang-unit-test/unit-test-byte-encode.cpp b/tools/slang-unit-test/unit-test-byte-encode.cpp index 36b9f91d8..633d3918d 100644 --- a/tools/slang-unit-test/unit-test-byte-encode.cpp +++ b/tools/slang-unit-test/unit-test-byte-encode.cpp @@ -94,10 +94,18 @@ SLANG_UNIT_TEST(byteEncode) uint32_t mask; switch (v) { - case 0: mask = 0xffffffff; break; - case 1: mask = 0x00ffffff; break; - case 2: mask = 0x0000ffff; break; - case 3: mask = 0x000000ff; break; + case 0: + mask = 0xffffffff; + break; + case 1: + mask = 0x00ffffff; + break; + case 2: + mask = 0x0000ffff; + break; + case 3: + mask = 0x000000ff; + break; } initialBuffer[i] = randGen.nextInt32() & mask; diff --git a/tools/slang-unit-test/unit-test-compression.cpp b/tools/slang-unit-test/unit-test-compression.cpp index 28f18997f..3b0ba3361 100644 --- a/tools/slang-unit-test/unit-test-compression.cpp +++ b/tools/slang-unit-test/unit-test-compression.cpp @@ -9,9 +9,14 @@ 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; } diff --git a/tools/slang-unit-test/unit-test-file-system.cpp b/tools/slang-unit-test/unit-test-file-system.cpp index 46061e2d8..2a724fb3c 100644 --- a/tools/slang-unit-test/unit-test-file-system.cpp +++ b/tools/slang-unit-test/unit-test-file-system.cpp @@ -361,15 +361,20 @@ static SlangResult _createFileSystem( outFileSystem.setNull(); switch (type) { - case FileSystemType::Zip: return ZipFileSystem::create(outFileSystem); - case FileSystemType::RiffUncompressed: outFileSystem = new RiffFileSystem(nullptr); break; + case FileSystemType::Zip: + return ZipFileSystem::create(outFileSystem); + case FileSystemType::RiffUncompressed: + outFileSystem = new RiffFileSystem(nullptr); + break; case FileSystemType::RiffDeflate: outFileSystem = new RiffFileSystem(DeflateCompressionSystem::getSingleton()); break; case FileSystemType::RiffLZ4: outFileSystem = new RiffFileSystem(LZ4CompressionSystem::getSingleton()); break; - case FileSystemType::Memory: outFileSystem = new MemoryFileSystem; break; + case FileSystemType::Memory: + outFileSystem = new MemoryFileSystem; + break; case FileSystemType::Relative: { ComPtr<ISlangMutableFileSystem> memoryFileSystem(new MemoryFileSystem); diff --git a/tools/slang-unit-test/unit-test-memory-arena.cpp b/tools/slang-unit-test/unit-test-memory-arena.cpp index beb19b28b..3ceca8410 100644 --- a/tools/slang-unit-test/unit-test-memory-arena.cpp +++ b/tools/slang-unit-test/unit-test-memory-arena.cpp @@ -37,10 +37,14 @@ static size_t getAlignment(TestMode mode) switch (mode) { default: - case TestMode::eUnaligned: return 1; - case TestMode::eExplicitAligned: return 16; - case TestMode::eImplicitAligned: return 32; - case TestMode::eDefaultAligned: return MemoryArena::kMinAlignment; + case TestMode::eUnaligned: + return 1; + case TestMode::eExplicitAligned: + return 16; + case TestMode::eImplicitAligned: + return 32; + case TestMode::eDefaultAligned: + return MemoryArena::kMinAlignment; } } |
