|
|
|
|
@ -47,49 +47,42 @@ struct AbstractFontConverterTest: TestSuite::Tester {
|
|
|
|
|
|
|
|
|
|
void convertGlyphs(); |
|
|
|
|
|
|
|
|
|
void thingNotSupported(); |
|
|
|
|
|
|
|
|
|
void exportFontToSingleData(); |
|
|
|
|
void exportFontToSingleDataNotSupported(); |
|
|
|
|
void exportFontToSingleDataNotImplemented(); |
|
|
|
|
void exportFontToSingleDataNotSingleFile(); |
|
|
|
|
void exportFontToData(); |
|
|
|
|
void exportFontToDataNotSupported(); |
|
|
|
|
void exportFontToDataNotImplemented(); |
|
|
|
|
void exportFontToDataThroughSingleData(); |
|
|
|
|
void exportFontToDataThroughSingleDataFailed(); |
|
|
|
|
void exportFontToFile(); |
|
|
|
|
void exportFontToFileNotSupported(); |
|
|
|
|
void exportFontToFileNotImplemented(); |
|
|
|
|
void exportFontToFileThroughData(); |
|
|
|
|
void exportFontToFileThroughDataFailed(); |
|
|
|
|
void exportFontToFileThroughDataNotWritable(); |
|
|
|
|
|
|
|
|
|
void exportGlyphCacheToSingleData(); |
|
|
|
|
void exportGlyphCacheToSingleDataNotSupported(); |
|
|
|
|
void exportGlyphCacheToSingleDataNotImplemented(); |
|
|
|
|
void exportGlyphCacheToSingleDataNotSingleFile(); |
|
|
|
|
void exportGlyphCacheToData(); |
|
|
|
|
void exportGlyphCacheToDataNotSupported(); |
|
|
|
|
void exportGlyphCacheToDataNotImplemented(); |
|
|
|
|
void exportGlyphCacheToDataThroughSingleData(); |
|
|
|
|
void exportGlyphCacheToDataThroughSingleDataFailed(); |
|
|
|
|
void exportGlyphCacheToFile(); |
|
|
|
|
void exportGlyphCacheToFileNotSupported(); |
|
|
|
|
void exportGlyphCacheToFileNotImplemented(); |
|
|
|
|
void exportGlyphCacheToFileThroughData(); |
|
|
|
|
void exportGlyphCacheToFileThroughDataFailed(); |
|
|
|
|
void exportGlyphCacheToFileThroughDataNotWritable(); |
|
|
|
|
|
|
|
|
|
void importGlyphCacheFromSingleData(); |
|
|
|
|
void importGlyphCacheFromSingleDataNotSupported(); |
|
|
|
|
void importGlyphCacheFromSingleDataNotImplemented(); |
|
|
|
|
void importGlyphCacheFromSingleDataNotSingleFile(); |
|
|
|
|
void importGlyphCacheFromData(); |
|
|
|
|
void importGlyphCacheFromDataNoData(); |
|
|
|
|
void importGlyphCacheFromDataNotSupported(); |
|
|
|
|
void importGlyphCacheFromDataNotImplemented(); |
|
|
|
|
void importGlyphCacheFromDataAsSingleData(); |
|
|
|
|
void importGlyphCacheFromFile(); |
|
|
|
|
void importGlyphCacheFromFileNotSupported(); |
|
|
|
|
void importGlyphCacheFromFileNotImplemented(); |
|
|
|
|
void importGlyphCacheFromFileAsSingleData(); |
|
|
|
|
void importGlyphCacheFromFileAsSingleDataNotFound(); |
|
|
|
|
@ -103,49 +96,42 @@ struct AbstractFontConverterTest: TestSuite::Tester {
|
|
|
|
|
AbstractFontConverterTest::AbstractFontConverterTest() { |
|
|
|
|
addTests({&AbstractFontConverterTest::convertGlyphs, |
|
|
|
|
|
|
|
|
|
&AbstractFontConverterTest::thingNotSupported, |
|
|
|
|
|
|
|
|
|
&AbstractFontConverterTest::exportFontToSingleData, |
|
|
|
|
&AbstractFontConverterTest::exportFontToSingleDataNotSupported, |
|
|
|
|
&AbstractFontConverterTest::exportFontToSingleDataNotImplemented, |
|
|
|
|
&AbstractFontConverterTest::exportFontToSingleDataNotSingleFile, |
|
|
|
|
&AbstractFontConverterTest::exportFontToData, |
|
|
|
|
&AbstractFontConverterTest::exportFontToDataNotSupported, |
|
|
|
|
&AbstractFontConverterTest::exportFontToDataNotImplemented, |
|
|
|
|
&AbstractFontConverterTest::exportFontToDataThroughSingleData, |
|
|
|
|
&AbstractFontConverterTest::exportFontToDataThroughSingleDataFailed, |
|
|
|
|
&AbstractFontConverterTest::exportFontToFile, |
|
|
|
|
&AbstractFontConverterTest::exportFontToFileNotSupported, |
|
|
|
|
&AbstractFontConverterTest::exportFontToFileNotImplemented, |
|
|
|
|
&AbstractFontConverterTest::exportFontToFileThroughData, |
|
|
|
|
&AbstractFontConverterTest::exportFontToFileThroughDataFailed, |
|
|
|
|
&AbstractFontConverterTest::exportFontToFileThroughDataNotWritable, |
|
|
|
|
|
|
|
|
|
&AbstractFontConverterTest::exportGlyphCacheToSingleData, |
|
|
|
|
&AbstractFontConverterTest::exportGlyphCacheToSingleDataNotSupported, |
|
|
|
|
&AbstractFontConverterTest::exportGlyphCacheToSingleDataNotImplemented, |
|
|
|
|
&AbstractFontConverterTest::exportGlyphCacheToSingleDataNotSingleFile, |
|
|
|
|
&AbstractFontConverterTest::exportGlyphCacheToData, |
|
|
|
|
&AbstractFontConverterTest::exportGlyphCacheToDataNotSupported, |
|
|
|
|
&AbstractFontConverterTest::exportGlyphCacheToDataNotImplemented, |
|
|
|
|
&AbstractFontConverterTest::exportGlyphCacheToDataThroughSingleData, |
|
|
|
|
&AbstractFontConverterTest::exportGlyphCacheToDataThroughSingleDataFailed, |
|
|
|
|
&AbstractFontConverterTest::exportGlyphCacheToFile, |
|
|
|
|
&AbstractFontConverterTest::exportGlyphCacheToFileNotSupported, |
|
|
|
|
&AbstractFontConverterTest::exportGlyphCacheToFileNotImplemented, |
|
|
|
|
&AbstractFontConverterTest::exportGlyphCacheToFileThroughData, |
|
|
|
|
&AbstractFontConverterTest::exportGlyphCacheToFileThroughDataFailed, |
|
|
|
|
&AbstractFontConverterTest::exportGlyphCacheToFileThroughDataNotWritable, |
|
|
|
|
|
|
|
|
|
&AbstractFontConverterTest::importGlyphCacheFromSingleData, |
|
|
|
|
&AbstractFontConverterTest::importGlyphCacheFromSingleDataNotSupported, |
|
|
|
|
&AbstractFontConverterTest::importGlyphCacheFromSingleDataNotImplemented, |
|
|
|
|
&AbstractFontConverterTest::importGlyphCacheFromSingleDataNotSingleFile, |
|
|
|
|
&AbstractFontConverterTest::importGlyphCacheFromData, |
|
|
|
|
&AbstractFontConverterTest::importGlyphCacheFromDataNoData, |
|
|
|
|
&AbstractFontConverterTest::importGlyphCacheFromDataNotSupported, |
|
|
|
|
&AbstractFontConverterTest::importGlyphCacheFromDataNotImplemented, |
|
|
|
|
&AbstractFontConverterTest::importGlyphCacheFromDataAsSingleData, |
|
|
|
|
&AbstractFontConverterTest::importGlyphCacheFromFile, |
|
|
|
|
&AbstractFontConverterTest::importGlyphCacheFromFileNotSupported, |
|
|
|
|
&AbstractFontConverterTest::importGlyphCacheFromFileNotImplemented, |
|
|
|
|
&AbstractFontConverterTest::importGlyphCacheFromFileAsSingleData, |
|
|
|
|
&AbstractFontConverterTest::importGlyphCacheFromFileAsSingleDataNotFound, |
|
|
|
|
@ -200,6 +186,37 @@ void AbstractFontConverterTest::convertGlyphs() {
|
|
|
|
|
CORRADE_COMPARE(characters, U" 01Cab"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AbstractFontConverterTest::thingNotSupported() { |
|
|
|
|
CORRADE_SKIP_IF_NO_ASSERT(); |
|
|
|
|
|
|
|
|
|
struct: AbstractFontConverter { |
|
|
|
|
FontConverterFeatures doFeatures() const override { return {}; } |
|
|
|
|
} converter; |
|
|
|
|
|
|
|
|
|
std::ostringstream out; |
|
|
|
|
Error redirectError{&out}; |
|
|
|
|
converter.exportFontToSingleData(dummyFont, dummyGlyphCache, {}); |
|
|
|
|
converter.exportFontToData(dummyFont, dummyGlyphCache, "font.out", {}); |
|
|
|
|
converter.exportFontToFile(dummyFont, dummyGlyphCache, "file.out", {}); |
|
|
|
|
converter.exportGlyphCacheToSingleData(dummyGlyphCache); |
|
|
|
|
converter.exportGlyphCacheToData(dummyGlyphCache, "cache.out"); |
|
|
|
|
converter.exportGlyphCacheToFile(dummyGlyphCache, "cache.out"); |
|
|
|
|
converter.importGlyphCacheFromSingleData({}); |
|
|
|
|
converter.importGlyphCacheFromData({{}}); |
|
|
|
|
converter.importGlyphCacheFromFile({}); |
|
|
|
|
CORRADE_COMPARE_AS(out.str(), |
|
|
|
|
"Text::AbstractFontConverter::exportFontToSingleData(): feature not supported\n" |
|
|
|
|
"Text::AbstractFontConverter::exportFontToData(): feature not supported\n" |
|
|
|
|
"Text::AbstractFontConverter::exportFontToFile(): feature not supported\n" |
|
|
|
|
"Text::AbstractFontConverter::exportGlyphCacheToSingleData(): feature not supported\n" |
|
|
|
|
"Text::AbstractFontConverter::exportGlyphCacheToData(): feature not supported\n" |
|
|
|
|
"Text::AbstractFontConverter::exportGlyphCacheToFile(): feature not supported\n" |
|
|
|
|
"Text::AbstractFontConverter::importGlyphCacheFromSingleData(): feature not supported\n" |
|
|
|
|
"Text::AbstractFontConverter::importGlyphCacheFromData(): feature not supported\n" |
|
|
|
|
"Text::AbstractFontConverter::importGlyphCacheFromFile(): feature not supported\n", |
|
|
|
|
TestSuite::Compare::String); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AbstractFontConverterTest::exportFontToSingleData() { |
|
|
|
|
struct: AbstractFontConverter { |
|
|
|
|
FontConverterFeatures doFeatures() const override { |
|
|
|
|
@ -216,21 +233,6 @@ void AbstractFontConverterTest::exportFontToSingleData() {
|
|
|
|
|
TestSuite::Compare::Container); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AbstractFontConverterTest::exportFontToSingleDataNotSupported() { |
|
|
|
|
CORRADE_SKIP_IF_NO_ASSERT(); |
|
|
|
|
|
|
|
|
|
struct: AbstractFontConverter { |
|
|
|
|
FontConverterFeatures doFeatures() const override { |
|
|
|
|
return FontConverterFeature::ExportFont; |
|
|
|
|
} |
|
|
|
|
} converter; |
|
|
|
|
|
|
|
|
|
std::ostringstream out; |
|
|
|
|
Error redirectError{&out}; |
|
|
|
|
converter.exportFontToSingleData(dummyFont, dummyGlyphCache, {}); |
|
|
|
|
CORRADE_COMPARE(out.str(), "Text::AbstractFontConverter::exportFontToSingleData(): feature not supported\n"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AbstractFontConverterTest::exportFontToSingleDataNotImplemented() { |
|
|
|
|
CORRADE_SKIP_IF_NO_ASSERT(); |
|
|
|
|
|
|
|
|
|
@ -288,21 +290,6 @@ void AbstractFontConverterTest::exportFontToData() {
|
|
|
|
|
TestSuite::Compare::Container); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AbstractFontConverterTest::exportFontToDataNotSupported() { |
|
|
|
|
CORRADE_SKIP_IF_NO_ASSERT(); |
|
|
|
|
|
|
|
|
|
struct: AbstractFontConverter { |
|
|
|
|
FontConverterFeatures doFeatures() const override { |
|
|
|
|
return FontConverterFeature::ExportFont; |
|
|
|
|
} |
|
|
|
|
} converter; |
|
|
|
|
|
|
|
|
|
std::ostringstream out; |
|
|
|
|
Error redirectError{&out}; |
|
|
|
|
converter.exportFontToData(dummyFont, dummyGlyphCache, "font.out", {}); |
|
|
|
|
CORRADE_COMPARE(out.str(), "Text::AbstractFontConverter::exportFontToData(): feature not supported\n"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AbstractFontConverterTest::exportFontToDataNotImplemented() { |
|
|
|
|
CORRADE_SKIP_IF_NO_ASSERT(); |
|
|
|
|
|
|
|
|
|
@ -385,21 +372,6 @@ void AbstractFontConverterTest::exportFontToFile() {
|
|
|
|
|
"\xfe\x02", TestSuite::Compare::FileToString); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AbstractFontConverterTest::exportFontToFileNotSupported() { |
|
|
|
|
CORRADE_SKIP_IF_NO_ASSERT(); |
|
|
|
|
|
|
|
|
|
struct: AbstractFontConverter { |
|
|
|
|
FontConverterFeatures doFeatures() const override { |
|
|
|
|
return FontConverterFeature::ExportGlyphCache; |
|
|
|
|
} |
|
|
|
|
} converter; |
|
|
|
|
|
|
|
|
|
std::ostringstream out; |
|
|
|
|
Error redirectError{&out}; |
|
|
|
|
converter.exportFontToFile(dummyFont, dummyGlyphCache, "file.out", {}); |
|
|
|
|
CORRADE_COMPARE(out.str(), "Text::AbstractFontConverter::exportFontToFile(): feature not supported\n"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AbstractFontConverterTest::exportFontToFileNotImplemented() { |
|
|
|
|
CORRADE_SKIP_IF_NO_ASSERT(); |
|
|
|
|
|
|
|
|
|
@ -506,21 +478,6 @@ void AbstractFontConverterTest::exportGlyphCacheToSingleData() {
|
|
|
|
|
TestSuite::Compare::Container); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AbstractFontConverterTest::exportGlyphCacheToSingleDataNotSupported() { |
|
|
|
|
CORRADE_SKIP_IF_NO_ASSERT(); |
|
|
|
|
|
|
|
|
|
struct: AbstractFontConverter { |
|
|
|
|
FontConverterFeatures doFeatures() const override { |
|
|
|
|
return FontConverterFeature::ExportGlyphCache; |
|
|
|
|
} |
|
|
|
|
} converter; |
|
|
|
|
|
|
|
|
|
std::ostringstream out; |
|
|
|
|
Error redirectError{&out}; |
|
|
|
|
converter.exportGlyphCacheToSingleData(dummyGlyphCache); |
|
|
|
|
CORRADE_COMPARE(out.str(), "Text::AbstractFontConverter::exportGlyphCacheToSingleData(): feature not supported\n"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AbstractFontConverterTest::exportGlyphCacheToSingleDataNotImplemented() { |
|
|
|
|
CORRADE_SKIP_IF_NO_ASSERT(); |
|
|
|
|
|
|
|
|
|
@ -577,21 +534,6 @@ void AbstractFontConverterTest::exportGlyphCacheToData() {
|
|
|
|
|
TestSuite::Compare::Container); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AbstractFontConverterTest::exportGlyphCacheToDataNotSupported() { |
|
|
|
|
CORRADE_SKIP_IF_NO_ASSERT(); |
|
|
|
|
|
|
|
|
|
struct: AbstractFontConverter { |
|
|
|
|
FontConverterFeatures doFeatures() const override { |
|
|
|
|
return FontConverterFeature::ExportGlyphCache; |
|
|
|
|
} |
|
|
|
|
} converter; |
|
|
|
|
|
|
|
|
|
std::ostringstream out; |
|
|
|
|
Error redirectError{&out}; |
|
|
|
|
converter.exportGlyphCacheToData(dummyGlyphCache, "cache.out"); |
|
|
|
|
CORRADE_COMPARE(out.str(), "Text::AbstractFontConverter::exportGlyphCacheToData(): feature not supported\n"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AbstractFontConverterTest::exportGlyphCacheToDataNotImplemented() { |
|
|
|
|
CORRADE_SKIP_IF_NO_ASSERT(); |
|
|
|
|
|
|
|
|
|
@ -675,21 +617,6 @@ void AbstractFontConverterTest::exportGlyphCacheToFile() {
|
|
|
|
|
"\xfe\xed", TestSuite::Compare::FileToString); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AbstractFontConverterTest::exportGlyphCacheToFileNotSupported() { |
|
|
|
|
CORRADE_SKIP_IF_NO_ASSERT(); |
|
|
|
|
|
|
|
|
|
struct: AbstractFontConverter { |
|
|
|
|
FontConverterFeatures doFeatures() const override { |
|
|
|
|
return FontConverterFeature::ExportFont; |
|
|
|
|
} |
|
|
|
|
} converter; |
|
|
|
|
|
|
|
|
|
std::ostringstream out; |
|
|
|
|
Error redirectError{&out}; |
|
|
|
|
converter.exportGlyphCacheToFile(dummyGlyphCache, "cache.out"); |
|
|
|
|
CORRADE_COMPARE(out.str(), "Text::AbstractFontConverter::exportGlyphCacheToFile(): feature not supported\n"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AbstractFontConverterTest::exportGlyphCacheToFileNotImplemented() { |
|
|
|
|
CORRADE_SKIP_IF_NO_ASSERT(); |
|
|
|
|
|
|
|
|
|
@ -795,21 +722,6 @@ void AbstractFontConverterTest::importGlyphCacheFromSingleData() {
|
|
|
|
|
CORRADE_COMPARE(cache->textureSize(), (Vector2i{123, 345})); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AbstractFontConverterTest::importGlyphCacheFromSingleDataNotSupported() { |
|
|
|
|
CORRADE_SKIP_IF_NO_ASSERT(); |
|
|
|
|
|
|
|
|
|
struct: AbstractFontConverter { |
|
|
|
|
FontConverterFeatures doFeatures() const override { |
|
|
|
|
return FontConverterFeature::ImportGlyphCache; |
|
|
|
|
} |
|
|
|
|
} converter; |
|
|
|
|
|
|
|
|
|
std::ostringstream out; |
|
|
|
|
Error redirectError{&out}; |
|
|
|
|
converter.importGlyphCacheFromSingleData({}); |
|
|
|
|
CORRADE_COMPARE(out.str(), "Text::AbstractFontConverter::importGlyphCacheFromSingleData(): feature not supported\n"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AbstractFontConverterTest::importGlyphCacheFromSingleDataNotImplemented() { |
|
|
|
|
CORRADE_SKIP_IF_NO_ASSERT(); |
|
|
|
|
|
|
|
|
|
@ -859,21 +771,6 @@ void AbstractFontConverterTest::importGlyphCacheFromData() {
|
|
|
|
|
CORRADE_COMPARE(cache->textureSize(), (Vector2i{123, 345})); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AbstractFontConverterTest::importGlyphCacheFromDataNotSupported() { |
|
|
|
|
CORRADE_SKIP_IF_NO_ASSERT(); |
|
|
|
|
|
|
|
|
|
struct: AbstractFontConverter { |
|
|
|
|
FontConverterFeatures doFeatures() const override { |
|
|
|
|
return FontConverterFeature::ImportGlyphCache; |
|
|
|
|
} |
|
|
|
|
} converter; |
|
|
|
|
|
|
|
|
|
std::ostringstream out; |
|
|
|
|
Error redirectError{&out}; |
|
|
|
|
converter.importGlyphCacheFromData({{}}); |
|
|
|
|
CORRADE_COMPARE(out.str(), "Text::AbstractFontConverter::importGlyphCacheFromData(): feature not supported\n"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AbstractFontConverterTest::importGlyphCacheFromDataNoData() { |
|
|
|
|
CORRADE_SKIP_IF_NO_ASSERT(); |
|
|
|
|
|
|
|
|
|
@ -946,21 +843,6 @@ void AbstractFontConverterTest::importGlyphCacheFromFile() {
|
|
|
|
|
CORRADE_COMPARE(cache->textureSize(), (Vector2i{123, 345})); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AbstractFontConverterTest::importGlyphCacheFromFileNotSupported() { |
|
|
|
|
CORRADE_SKIP_IF_NO_ASSERT(); |
|
|
|
|
|
|
|
|
|
struct: AbstractFontConverter { |
|
|
|
|
FontConverterFeatures doFeatures() const override { |
|
|
|
|
return FontConverterFeature::ExportGlyphCache; |
|
|
|
|
} |
|
|
|
|
} converter; |
|
|
|
|
|
|
|
|
|
std::ostringstream out; |
|
|
|
|
Error redirectError{&out}; |
|
|
|
|
converter.importGlyphCacheFromFile({}); |
|
|
|
|
CORRADE_COMPARE(out.str(), "Text::AbstractFontConverter::importGlyphCacheFromFile(): feature not supported\n"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AbstractFontConverterTest::importGlyphCacheFromFileNotImplemented() { |
|
|
|
|
CORRADE_SKIP_IF_NO_ASSERT(); |
|
|
|
|
|
|
|
|
|
|