@@ -2383,6 +2383,8 @@ TEST(converter)
23832383 == List<std::string> {" application/pdf" });
23842384 ASSERT (Converter::instance ().getTargetFormat (" application/pdf" , supportedFormats)
23852385 == " application/pdf" );
2386+ ASSERT (Converter::instance ().possibleOutputFormats (supportedFormats, " application/pdf" )
2387+ == List<std::string> {" application/pdf" });
23862388
23872389 // PDF maps to PWG-raster
23882390 supportedFormats = {" image/pwg-raster" };
@@ -2455,12 +2457,16 @@ TEST(converter)
24552457 ASSERT (Converter::instance ().getConvertFun (" text/plain" , " text/plain" ));
24562458 ASSERT (Converter::instance ().getConvertFun (" foo" , " foo" ));
24572459
2460+ ASSERT (Converter::instance ().possibleOutputFormats (" application/pdf" )
2461+ == (List<std::string> {" application/pdf" , " application/postscript" , " image/pwg-raster" , " image/urf" }));
2462+
24582463 // Custom function
24592464 ASSERT_FALSE (Converter::instance ().getConvertFun (" foo" , " bar" ));
24602465 Converter::ConvertFun FooBar = [](std::string, const IppPrintJob&, WriteFun, ProgressFun){return Error ();};
24612466 Converter::instance ().Pipelines .push_back ({{" foo" , " bar" }, FooBar});
24622467 ASSERT (Converter::instance ().getConvertFun (" foo" , " bar" ));
2463-
2468+ ASSERT (Converter::instance ().possibleOutputFormats (" foo" )
2469+ == (List<std::string> {" bar" , " foo" }));
24642470
24652471 // PDF has higher prio than custom format
24662472 Converter::instance ().Pipelines .push_back ({{" application/pdf" , " application/aaa" }, FooBar});
@@ -2469,6 +2475,9 @@ TEST(converter)
24692475 == (List<std::string> {" application/pdf" , " image/pwg-raster" , " application/aaa" }));
24702476 ASSERT (Converter::instance ().getTargetFormat (" application/pdf" , supportedFormats)
24712477 == " application/pdf" );
2478+ ASSERT (Converter::instance ().possibleOutputFormats (" application/pdf" )
2479+ == (List<std::string> {" application/pdf" , " application/postscript" ,
2480+ " image/pwg-raster" , " image/urf" , " application/aaa" }));
24722481
24732482 // ...but will do in a pinch
24742483 supportedFormats = {" application/aaa" };
@@ -2480,6 +2489,10 @@ TEST(converter)
24802489 supportedFormats = {" application/aaa" , " application/bbb" , " application/pdf" };
24812490 ASSERT (Converter::instance ().getTargetFormat (" application/pdf" , supportedFormats)
24822491 == " application/bbb" );
2492+ ASSERT (Converter::instance ().possibleOutputFormats (" application/pdf" )
2493+ == (List<std::string> {" application/bbb" , " application/pdf" , " application/postscript" ,
2494+ " image/pwg-raster" , " image/urf" , " application/aaa" }));
2495+
24832496
24842497}
24852498
0 commit comments