From 23864fa8fc9878482dcf133f750e614b344ca9c2 Mon Sep 17 00:00:00 2001 From: Fabrizio Duroni Date: Sat, 19 Oct 2024 12:33:01 +0200 Subject: [PATCH] Added linux tests --- .github/workflows/build-linux.yml | 1 + Tests/Mp3/Mp3FileReaderTest.swift | 9 --------- ...AttachedPictureFrameContentParsingOperationTest.swift | 5 ----- Tests/Parse/ID3DiscPositionStringAdapterTest.swift | 6 ------ Tests/Parse/ID3FrameContentSizeParserTest.swift | 6 ------ Tests/Parse/ID3FrameSizeParserTest.swift | 5 ----- Tests/Parse/ID3GenreStringAdapterTest.swift | 7 ------- Tests/Parse/ID3LocalizedFrameParsingOperationTest.swift | 5 ----- Tests/Parse/ID3PictureTypeAdapterTest.swift | 7 ------- Tests/Parse/ID3RecordingTimestampOperationTest.swift | 5 ----- Tests/Parse/ID3StringContentParsingOperationTest.swift | 8 -------- Tests/Parse/ID3TagSizeParserTest.swift | 5 ----- Tests/Parse/ID3TagVersionParserTest.swift | 6 ------ Tests/Parse/ID3TrackPositionStringAdapterTest.swift | 6 ------ 14 files changed, 1 insertion(+), 80 deletions(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 5046ce7f..ace265d5 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -22,6 +22,7 @@ jobs: - name: Build Linux framework run: | swift build + swift test - name: Build Linux Demo run: | cd Demo/Demo\ Ubuntu diff --git a/Tests/Mp3/Mp3FileReaderTest.swift b/Tests/Mp3/Mp3FileReaderTest.swift index b9c96e17..4104eb53 100644 --- a/Tests/Mp3/Mp3FileReaderTest.swift +++ b/Tests/Mp3/Mp3FileReaderTest.swift @@ -59,13 +59,4 @@ struct Mp3FileReaderTest { // 10 bytes Tag + 34213 bytes according to the Tag Size in the file's ID3 Tag #expect(id3TagData.count == 10 + 34213) } - - static let allTests = [ - ("testNotAnMP3FileWhenReadingEntireFile", testNotAnMP3FileWhenReadingEntireFile), - ("testMP3FileWhenReadingEntireFile", testMP3FileWhenReadingEntireFile), - ("testNotAnMP3fileWhenReadingID3Tag", testNotAnMP3fileWhenReadingID3Tag), - ("testMP3fileWhenReadingID3Tag", testMP3fileWhenReadingID3Tag), - ("testNonExistentMP3fileWhenReadingID3Tag", testNonExistentMP3fileWhenReadingID3Tag), - ("testOnlyReadsID3Tag", testOnlyReadsID3Tag) - ] } diff --git a/Tests/Parse/ID3AttachedPictureFrameContentParsingOperationTest.swift b/Tests/Parse/ID3AttachedPictureFrameContentParsingOperationTest.swift index d9461308..fc01c99b 100644 --- a/Tests/Parse/ID3AttachedPictureFrameContentParsingOperationTest.swift +++ b/Tests/Parse/ID3AttachedPictureFrameContentParsingOperationTest.swift @@ -56,9 +56,4 @@ struct ID3AttachedPictureFrameContentParsingOperationTest { }) } } - - static let allTests = [ - ("testSetTagAttachedPictureJpg", testSetTagAttachedPictureJpg), - ("testSetTagAttachedPicturePng", testSetTagAttachedPicturePng) - ] } diff --git a/Tests/Parse/ID3DiscPositionStringAdapterTest.swift b/Tests/Parse/ID3DiscPositionStringAdapterTest.swift index 6381e79a..9807f030 100644 --- a/Tests/Parse/ID3DiscPositionStringAdapterTest.swift +++ b/Tests/Parse/ID3DiscPositionStringAdapterTest.swift @@ -29,10 +29,4 @@ struct ID3DiscPositionStringAdapterTest { #expect(discPosition.part == 0) #expect(discPosition.total == nil) } - - static let allTests = [ - ("testAdaptNotANumberDiscPosition", testAdaptNotANumberDiscPosition), - ("testAdaptDiscPositionWithoutTotalDiscs", testAdaptDiscPositionWithoutTotalDiscs), - ("testAdaptDiscPositionWithTotalDiscs", testAdaptDiscPositionWithTotalDiscs) - ] } diff --git a/Tests/Parse/ID3FrameContentSizeParserTest.swift b/Tests/Parse/ID3FrameContentSizeParserTest.swift index 53c4a0d8..a008da65 100644 --- a/Tests/Parse/ID3FrameContentSizeParserTest.swift +++ b/Tests/Parse/ID3FrameContentSizeParserTest.swift @@ -58,10 +58,4 @@ import Testing 14 ) } - - static let allTests = [ - ("testParseFrameContentSizeV2", testParseFrameContentSizeV2), - ("testParseFrameContentSizeV3", testParseFrameContentSizeV3), - ("testParseFrameContentSizeV4", testParseFrameContentSizeV4) - ] } diff --git a/Tests/Parse/ID3FrameSizeParserTest.swift b/Tests/Parse/ID3FrameSizeParserTest.swift index d48f6f1e..2df5756a 100644 --- a/Tests/Parse/ID3FrameSizeParserTest.swift +++ b/Tests/Parse/ID3FrameSizeParserTest.swift @@ -42,9 +42,4 @@ struct ID3FrameSizeParserTest { mp3.length + ID3FrameConfiguration().headerSizeFor(version: .version3) ) } - - static let allTests = [ - ("testParseFrameContentSizeV2", testParseFrameContentSizeV2), - ("testParseFrameContentSizeV3", testParseFrameContentSizeV3) - ] } diff --git a/Tests/Parse/ID3GenreStringAdapterTest.swift b/Tests/Parse/ID3GenreStringAdapterTest.swift index 438f8993..08d9e93b 100644 --- a/Tests/Parse/ID3GenreStringAdapterTest.swift +++ b/Tests/Parse/ID3GenreStringAdapterTest.swift @@ -36,11 +36,4 @@ import Testing #expect(ID3GenreStringAdapter().adapt(genre: "(XXX)").identifier == nil) #expect(ID3GenreStringAdapter().adapt(genre: "(XXX)").description == "(XXX)") } - - static let allTests = [ - ("testAdaptGenreWithDescription", testAdaptGenreWithDescription), - ("testAdaptGenreWithoutDescription", testAdaptGenreWithoutDescription), - ("testAdaptGenreWithoutGenreIdentifier", testAdaptGenreWithoutGenreIdentifier), - ("testAdaptID3v3NewGenresNotNumeric", testAdaptID3v3NewGenresNotNumeric) - ] } diff --git a/Tests/Parse/ID3LocalizedFrameParsingOperationTest.swift b/Tests/Parse/ID3LocalizedFrameParsingOperationTest.swift index 347b76f9..193d37c1 100644 --- a/Tests/Parse/ID3LocalizedFrameParsingOperationTest.swift +++ b/Tests/Parse/ID3LocalizedFrameParsingOperationTest.swift @@ -69,9 +69,4 @@ struct ID3LocalizedFrameParsingOperationTest { + content ) } - - static let allTests = [ - ("testParsingValidFrame", testParsingValidFrame), - ("testParsingInvalidLanguage", testParsingInvalidLanguage) - ] } diff --git a/Tests/Parse/ID3PictureTypeAdapterTest.swift b/Tests/Parse/ID3PictureTypeAdapterTest.swift index 7ae97145..73a6c790 100644 --- a/Tests/Parse/ID3PictureTypeAdapterTest.swift +++ b/Tests/Parse/ID3PictureTypeAdapterTest.swift @@ -54,11 +54,4 @@ struct ID3PictureTypeAdapterTest { #expect(id3PictureTypeAdapter.adapt(frame: frame, format: .png, version: .version3) == .frontCover) } - - static let allTests = [ - ("testExtractTypeFromV2TagJpg", testExtractTypeFromV2TagJpg), - ("testExtractTypeFromV2TagPng", testExtractTypeFromV2TagPng), - ("testExtractTypeFromV3TagJpg", testExtractTypeFromV3TagJpg), - ("testExtractTypeFromV3TagPng", testExtractTypeFromV3TagPng) - ] } diff --git a/Tests/Parse/ID3RecordingTimestampOperationTest.swift b/Tests/Parse/ID3RecordingTimestampOperationTest.swift index e45dc990..ac1cf38d 100644 --- a/Tests/Parse/ID3RecordingTimestampOperationTest.swift +++ b/Tests/Parse/ID3RecordingTimestampOperationTest.swift @@ -64,9 +64,4 @@ struct ID3RecordingTimeFrameContentParsingOperationTest { [0x03] + [UInt8]("2016".utf8) ) } - - static let allTests = [ - ("testframeContentValidTimestamp", testframeContentValidTimestamp), - ("testframeContentWithYearInsteadOfTimestamp", testframeContentWithYearInsteadOfTimestamp) - ] } diff --git a/Tests/Parse/ID3StringContentParsingOperationTest.swift b/Tests/Parse/ID3StringContentParsingOperationTest.swift index 94b343df..967bfe06 100644 --- a/Tests/Parse/ID3StringContentParsingOperationTest.swift +++ b/Tests/Parse/ID3StringContentParsingOperationTest.swift @@ -190,12 +190,4 @@ struct ID3StringContentParsingOperationTest { [0x03] + [UInt8](":: π value ::".utf8) ) } - - static let allTests = [ - ("testFrameContentParsedV2", testFrameContentParsedV2), - ("testFrameContentParsedV3", testFrameContentParsedV3), - ("testFrameContentParsedV2utf16", testFrameContentParsedV2utf16), - ("testFrameContentParsedV3utf16", testFrameContentParsedV3utf16), - ("testFrameContentParsedV4utf8", testFrameContentParsedV4utf8) - ] } diff --git a/Tests/Parse/ID3TagSizeParserTest.swift b/Tests/Parse/ID3TagSizeParserTest.swift index b19d0b40..50204dd4 100644 --- a/Tests/Parse/ID3TagSizeParserTest.swift +++ b/Tests/Parse/ID3TagSizeParserTest.swift @@ -20,9 +20,4 @@ struct ID3TagSizeParserTest { let mp3V23 = NSData(contentsOfFile: PathLoader().pathFor(name: "example-v23", fileType: "mp3"))! #expect(ID3TagSizeParser().parse(data: mp3V23) == 245864) } - - static let allTests = [ - ("parseTagSizeV2", parseTagSizeV2), - ("parseFrameContentSizeV3", parseTagSizeV3) - ] } diff --git a/Tests/Parse/ID3TagVersionParserTest.swift b/Tests/Parse/ID3TagVersionParserTest.swift index bbe216c6..852dabea 100644 --- a/Tests/Parse/ID3TagVersionParserTest.swift +++ b/Tests/Parse/ID3TagVersionParserTest.swift @@ -36,10 +36,4 @@ struct ID3TagVersionParserTest { ) #expect(.version3 == ID3TagVersionParser().parse(mp3: mp3WithV2Tag)) } - - static let allTests = [ - ("testExtractVersion2", testExtractVersion2), - ("testExtractVersion3", testExtractVersion3), - ("testDefaultVersion", testDefaultVersion) - ] } diff --git a/Tests/Parse/ID3TrackPositionStringAdapterTest.swift b/Tests/Parse/ID3TrackPositionStringAdapterTest.swift index 878b4798..5eaaad99 100644 --- a/Tests/Parse/ID3TrackPositionStringAdapterTest.swift +++ b/Tests/Parse/ID3TrackPositionStringAdapterTest.swift @@ -29,10 +29,4 @@ struct ID3TrackPositionStringAdapterTest { #expect(trackPosition.part == 0) #expect(trackPosition.total == nil) } - - static let allTests = [ - ("testAdaptNotANumberTrackPosition", testAdaptNotANumberTrackPosition), - ("testAdaptTrackPositionWithoutTotalTracks", testAdaptTrackPositionWithoutTotalTracks), - ("testAdaptTrackPositionWithTotalTrack", testAdaptTrackPositionWithTotalTrack) - ] }