File tree Expand file tree Collapse file tree
Tests/ContainerizationEXT4Tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -156,9 +156,9 @@ struct Ext4FormatTests: ~Copyable {
156156 @Test func groupDescriptors( ) throws {
157157 let f = try EXT4 . EXT4Reader ( blockDevice: fsPath)
158158 let gd = try f. getGroupDescriptor ( 0 )
159- #expect( gd. blockBitmapLow == 551 ) // move over by 512 blocks (for inodes )
160- #expect( gd. inodeBitmapLow == 552 ) // move over by 512 blocks (for inodes )
161- #expect( gd. inodeTableLow == 39 )
159+ #expect( gd. blockBitmapLow == 520 )
160+ #expect( gd. inodeBitmapLow == 521 )
161+ #expect( gd. inodeTableLow == 8 )
162162 #expect( gd. freeBlocksCountLow == 32246 ) // 512 block used by larger inode table per block group
163163 #expect( gd. freeInodesCountLow == 8176 ) // 512 times the inodes
164164 #expect( gd. usedDirsCountLow == 5 )
@@ -219,3 +219,14 @@ struct Ext4FormatTests: ~Copyable {
219219 #expect( regFile. sizeLow == 4 )
220220 }
221221}
222+
223+ struct Ext4FormatEmptyRangeTests {
224+ @Test func closeEmptyFilesystem( ) throws {
225+ let fsPath = FilePath (
226+ FileManager . default. temporaryDirectory
227+ . appendingPathComponent ( UUID ( ) . uuidString, isDirectory: false ) )
228+ defer { try ? FileManager . default. removeItem ( at: fsPath. url) }
229+ let formatter = try EXT4 . Formatter ( fsPath, minDiskSize: 32 . kib ( ) )
230+ try formatter. close ( )
231+ }
232+ }
You can’t perform that action at this time.
0 commit comments