test: extend coverage for file/qt/xml utilities and core audio/math
Add/extend tests for: - FileFunctions: config/temp paths, autorecovery, directory overwrite/copy - QtUtils: word wrap, formatted date/time, qHash for rational/TimeRange - XMLUtils: cancel atom integration - Core rational: construction, arithmetic, comparisons, NaN handling - Core SampleBuffer: allocation, channel ops, volume/silence/reverse/speed Coverage improvements: - filefunctions.cpp: 74% -> 90% - qtutils.cpp: 41% -> 73% - xmlutils.cpp: 88% -> 100% - rational.cpp: 74% -> 92% - samplebuffer.cpp: 55% -> 96%
This commit is contained in:
@@ -58,3 +58,28 @@ TEST(CommonXmlUtils, ReadNextStartElementSkipsUnknown)
|
||||
EXPECT_TRUE(olive::XMLReadNextStartElement(&reader));
|
||||
EXPECT_EQ(reader.name().toString(), QStringLiteral("known"));
|
||||
}
|
||||
|
||||
|
||||
TEST(CommonXmlUtils, ReadNextStartElementWithCancel)
|
||||
{
|
||||
QByteArray xml = "<root><child/></root>";
|
||||
QBuffer buffer(&xml);
|
||||
buffer.open(QIODevice::ReadOnly);
|
||||
QXmlStreamReader reader(&buffer);
|
||||
|
||||
olive::CancelAtom atom;
|
||||
EXPECT_TRUE(olive::XMLReadNextStartElement(&reader, &atom));
|
||||
EXPECT_EQ(reader.name().toString(), QStringLiteral("root"));
|
||||
}
|
||||
|
||||
TEST(CommonXmlUtils, ReadNextStartElementRespectsCancel)
|
||||
{
|
||||
QByteArray xml = "<root><child/></root>";
|
||||
QBuffer buffer(&xml);
|
||||
buffer.open(QIODevice::ReadOnly);
|
||||
QXmlStreamReader reader(&buffer);
|
||||
|
||||
olive::CancelAtom atom;
|
||||
atom.Cancel();
|
||||
EXPECT_FALSE(olive::XMLReadNextStartElement(&reader, &atom));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user