Skip to content

Commit

Permalink
Speex basic unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeugma440 committed Dec 15, 2024
1 parent 29d2951 commit 225689f
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ATL.unit-test/IO/MetaData/MetaIOTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ public void test_RW_Empty(
// Source : totally metadata-free file
string location = TestUtils.GetResourceLocationRoot() + fileName;
string testFileLocation = TestUtils.CopyAsTempTestFile(fileName);
AudioDataManager theFile = new AudioDataManager(ATL.AudioData.AudioDataIOFactory.GetInstance().GetFromPath(testFileLocation));
AudioDataManager theFile = new AudioDataManager(AudioDataIOFactory.GetInstance().GetFromPath(testFileLocation));


// Check that it is indeed metadata-free
Expand Down
52 changes: 52 additions & 0 deletions ATL.unit-test/IO/MetaData/SPX.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using ATL.AudioData;

namespace ATL.test.IO.MetaData
{
[TestClass]
public class SPX : MetaIOTest
{
public SPX()
{
emptyFile = "SPX/empty.spx";
notEmptyFile = "SPX/spx.spx";
tagType = MetaDataIOFactory.TagType.NATIVE;

supportsExtraEmbeddedPictures = false;

testData.EmbeddedPictures.Clear();
testData.Conductor = null;
testData.Date = DateTime.Parse("1997-06-20");
testData.PublishingDate = DateTime.Parse("1998-07-21");
testData.CatalogNumber = "44887733";

testData.AdditionalFields = new Dictionary<string, string>
{
{ "TEST", "xxx" },
{ "VORBIS-VENDOR", "Lavf61.1.100" }
};
}

[TestMethod]
public void TagIO_R_SPX_simple()
{
new ConsoleLogger();

string location = TestUtils.GetResourceLocationRoot() + notEmptyFile;
AudioDataManager theFile = new AudioDataManager(AudioDataIOFactory.GetInstance().GetFromPath(location));

readExistingTagsOnFile(theFile);
}

[TestMethod]
public void TagIO_RW_SPX_Empty()
{
test_RW_Empty(emptyFile, true, true, true, false);
}

[TestMethod]
public void tagIO_RW_SPX_Existing()
{
test_RW_Existing(notEmptyFile, 0);
}
}
}
2 changes: 1 addition & 1 deletion ATL/AudioData/IO/Ogg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ public async Task<bool> WriteAsync(Stream s, TagData tag, ProgressToken<float> w
}
else if (CONTENTS_SPEEX == contents)
{
vorbisTag.switchOggBehaviour();
vorbisTag.switchFlacBehaviour();
await vorbisTag.WriteAsync(memStream, tag);
}
else if (CONTENTS_FLAC == contents)
Expand Down

0 comments on commit 225689f

Please sign in to comment.